1 2 20 21 22 23 package soot.options; 24 import java.util.*; 25 26 27 public class SMBOptions 28 { 29 private Map options; 30 31 public SMBOptions( Map options ) { 32 this.options = options; 33 } 34 35 41 public boolean enabled() { 42 return soot.PhaseOptions.getBoolean( options, "enabled" ); 43 } 44 45 55 public boolean insert_null_checks() { 56 return soot.PhaseOptions.getBoolean( options, "insert-null-checks" ); 57 } 58 59 80 public boolean insert_redundant_casts() { 81 return soot.PhaseOptions.getBoolean( options, "insert-redundant-casts" ); 82 } 83 84 public static final int allowed_modifier_changes_unsafe = 1; 85 public static final int allowed_modifier_changes_safe = 2; 86 public static final int allowed_modifier_changes_none = 3; 87 93 public int allowed_modifier_changes() { 94 String s = soot.PhaseOptions.getString( options, "allowed-modifier-changes" ); 95 96 if( s.equalsIgnoreCase( "unsafe" ) ) 97 return allowed_modifier_changes_unsafe; 98 99 if( s.equalsIgnoreCase( "safe" ) ) 100 return allowed_modifier_changes_safe; 101 102 if( s.equalsIgnoreCase( "none" ) ) 103 return allowed_modifier_changes_none; 104 105 throw new RuntimeException ( "Invalid value "+s+" of phase option allowed-modifier-changes" ); 106 } 107 108 } 109 | Popular Tags |