nus-yam/ex-repair huggingface dataset:
Program: 186744
Project: 186744
Buggy source:
public void recordResultUppaal(WcetCost wcet,double timeDiff,double searchtime,double solvertimemax){
  if (resultRecord == null)   return;
  Config c=projectConfig.getConfig();
  if (projectConfig.addPerformanceResults()) {
    recordCVS("String_Node_Str","String_Node_Str",wcet,timeDiff,searchtime,solvertimemax,c.getOption(JOPConfig.CACHE_IMPL),c.getOption(JOPConfig.CACHE_SIZE_WORDS),c.getOption(JOPConfig.CACHE_BLOCKS),c.getOption(UppAalConfig.UPPAAL_CACHE_APPROX),c.getOption(UppAalConfig.UPPAAL_COMPLEXITY_TRESHOLD),c.getOption(UppAalConfig.UPPAAL_COLLAPSE_LEAVES),c.getOption(UppAalConfig.UPPAAL_CONVEX_HULL),c.getOption(UppAalConfig.UPPAAL_TIGHT_BOUNDS),c.getOption(UppAalConfig.UPPAAL_PROGRESS_MEASURE),c.getOption(UppAalConfig.UPPAAL_SUPERGRAPH_TEMPLATE),c.getOption(UppAalConfig.UPPAAL_EMPTY_INITIAL_CACHE));
  }
 else {
    recordCVS("String_Node_Str","String_Node_Str",wcet,c.getOption(JOPConfig.CACHE_IMPL),c.getOption(JOPConfig.CACHE_SIZE_WORDS),c.getOption(JOPConfig.CACHE_BLOCKS),c.getOption(UppAalConfig.UPPAAL_CACHE_APPROX),c.getOption(UppAalConfig.UPPAAL_COMPLEXITY_TRESHOLD),c.getOption(UppAalConfig.UPPAAL_COLLAPSE_LEAVES),c.getOption(UppAalConfig.UPPAAL_CONVEX_HULL),c.getOption(UppAalConfig.UPPAAL_TIGHT_BOUNDS),c.getOption(UppAalConfig.UPPAAL_PROGRESS_MEASURE),c.getOption(UppAalConfig.UPPAAL_SUPERGRAPH_TEMPLATE),c.getOption(UppAalConfig.UPPAAL_EMPTY_INITIAL_CACHE));
  }
}

Fixed version (ground truth):
public void recordResultUppaal(WcetCost wcet,double timeDiff,double searchtime,double solvertimemax){
  if (resultRecord == null)   return;
  Config c=projectConfig.getConfig();
  OptionGroup o=JOPConfig.getOptions(c);
  if (projectConfig.addPerformanceResults()) {
    recordCVS("String_Node_Str","String_Node_Str",wcet,timeDiff,searchtime,solvertimemax,o.getOption(JOPConfig.CACHE_IMPL),o.getOption(JOPConfig.CACHE_SIZE_WORDS),o.getOption(JOPConfig.CACHE_BLOCKS),c.getOption(UppAalConfig.UPPAAL_CACHE_APPROX),c.getOption(UppAalConfig.UPPAAL_COMPLEXITY_TRESHOLD),c.getOption(UppAalConfig.UPPAAL_COLLAPSE_LEAVES),c.getOption(UppAalConfig.UPPAAL_CONVEX_HULL),c.getOption(UppAalConfig.UPPAAL_TIGHT_BOUNDS),c.getOption(UppAalConfig.UPPAAL_PROGRESS_MEASURE),c.getOption(UppAalConfig.UPPAAL_SUPERGRAPH_TEMPLATE),c.getOption(UppAalConfig.UPPAAL_EMPTY_INITIAL_CACHE));
  }
 else {
    recordCVS("String_Node_Str","String_Node_Str",wcet,o.getOption(JOPConfig.CACHE_IMPL),o.getOption(JOPConfig.CACHE_SIZE_WORDS),o.getOption(JOPConfig.CACHE_BLOCKS),c.getOption(UppAalConfig.UPPAAL_CACHE_APPROX),c.getOption(UppAalConfig.UPPAAL_COMPLEXITY_TRESHOLD),c.getOption(UppAalConfig.UPPAAL_COLLAPSE_LEAVES),c.getOption(UppAalConfig.UPPAAL_CONVEX_HULL),c.getOption(UppAalConfig.UPPAAL_TIGHT_BOUNDS),c.getOption(UppAalConfig.UPPAAL_PROGRESS_MEASURE),c.getOption(UppAalConfig.UPPAAL_SUPERGRAPH_TEMPLATE),c.getOption(UppAalConfig.UPPAAL_EMPTY_INITIAL_CACHE));
  }
}
Program: 186745
Project: 186745
Buggy source:
@Override public Instruction createPushInstruction(ConstantPoolGen cpg){
  return null;
}

Fixed version (ground truth):
@Override public Instruction createPushInstruction(ConstantPoolGen cpg){
  FieldInfo fieldInfo=getValue().getFieldInfo();
  if (fieldInfo != null && fieldInfo.isStatic()) {
    return new GETSTATIC(addConstant(cpg));
  }
  return null;
}
Program: 186746
Project: 186746
Buggy source:
public boolean isConstantValue(){
  return constantValue != null || type.equals(Type.NULL);
}

Fixed version (ground truth):
public boolean isConstantValue(){
  return (constantValue != null && !(constantValue instanceof ConstantFieldInfo)) || Type.NULL.equals(type);
}
Program: 186747
Project: 186747
Buggy source:
public void push(ValueInfo value,boolean addContinueMarker){
  if (Type.VOID.equals(value.getType()))   return;
  stack.add(value);
  if (addContinueMarker && value.usesTwoSlots()) {
    stack.add(ValueInfo.CONTINUED);
  }
}

Fixed version (ground truth):
public void push(ValueInfo value,boolean addContinueMarker){
  if (Type.VOID.equals(value.getType()) && !value.isThisReference())   return;
  stack.add(value);
  if (addContinueMarker && value.usesTwoSlots()) {
    stack.add(ValueInfo.CONTINUED);
  }
}
Program: 186750
Project: 186750
Buggy source:
@Override public void optimizeMethod(MethodInfo method){
  ConstantPoolGen cpg=method.getConstantPoolGen();
  InstructionList il=method.getCode().getInstructionList();
  InvokeMap invokeMap=new InvokeMap();
  for (  InvokeSite invoke : method.getCode().getInvokeSites()) {
    CallString cs=new CallString(invoke);
    while (invoke != null) {
      MethodInfo invokee=helper.devirtualize(cs);
      if (checkInvoke(invoke,cs,invokee,invokeMap)) {
        invoke=performSimpleInline(cs.first(),invokee,invokeMap);
        inlineCounter++;
        if (invokeMap.getInvokeSite() != null) {
          cs.push(invokeMap.getInvokeSite());
        }
 else {
          break;
        }
      }
 else {
        break;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void optimizeMethod(MethodInfo method){
  ConstantPoolGen cpg=method.getConstantPoolGen();
  InstructionList il=method.getCode().getInstructionList();
  InvokeMap invokeMap=new InvokeMap();
  for (  InvokeSite invoke : method.getCode().getInvokeSites()) {
    CallString cs=new CallString(invoke);
    while (invoke != null) {
      MethodInfo invokee=helper.devirtualize(cs);
      if (checkInvoke(invoke,cs,invokee,invokeMap)) {
        invoke=performSimpleInline(invoke,invokee,invokeMap);
        inlineCounter++;
        if (invokeMap.getInvokeSite() != null) {
          cs.push(invokeMap.getInvokeSite());
        }
 else {
          break;
        }
      }
 else {
        break;
      }
    }
  }
}
Program: 186753
Project: 186753
Buggy source:
public boolean visitClass(ClassInfo classInfo){
  MethodInfo m=classInfo.getMethodInfo(methodSig);
  if (m != null) {
    if (m.isPrivate() && !classInfo.equals(invokeeClass)) {
      logger.error("String_Node_Str" + m.getMethodSignature() + "String_Node_Str"+ classInfo.getClassName()+ "String_Node_Str"+ invokee.getClassName());
    }
    if (!m.isAbstract() && (method == null || m.overrides(method,false))) {
      methods.add(m);
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean visitClass(ClassInfo classInfo){
  MethodInfo m;
  if (invokeeClass.isInterface() && !classInfo.isInterface()) {
    m=classInfo.getMethodInfoInherited(methodSig,true);
  }
 else {
    m=classInfo.getMethodInfo(methodSig);
  }
  if (m != null) {
    if (m.isPrivate() && !classInfo.equals(invokeeClass)) {
      logger.error("String_Node_Str" + m.getMethodSignature() + "String_Node_Str"+ classInfo.getClassName()+ "String_Node_Str"+ invokee.getClassName());
    }
    if (!m.isAbstract() && (method == null || m.overrides(method,false))) {
      methods.add(m);
    }
  }
  return true;
}
Program: 186754
Project: 186754
Buggy source:
private void addProcessorModelOptions(){
  config.addOption(Config.PROCESSOR_MODEL);
  OptionGroup jopGroup=config.getOptions().addGroup("String_Node_Str",false);
  jopGroup.addOptions(JOPConfig.jopOptions);
}

Fixed version (ground truth):
private void addProcessorModelOptions(){
  config.addOption(Config.PROCESSOR_MODEL);
  JOPConfig.registerOptions(config);
}
Program: 186755
Project: 186755
Buggy source:
public <T>void setDefaultValue(Option<T> option,T value){
  config.setDefaultProperty(getConfigKey(option),value.toString());
}

Fixed version (ground truth):
public <T>void setDefaultValue(Option<T> option,T value){
  if (!containsOption(option)) {
    throw new BadConfigurationError("String_Node_Str" + option.getKey() + "String_Node_Str"+ prefix);
  }
  config.setDefaultProperty(getConfigKey(option),value.toString());
}
Program: 186756
Project: 186756
Buggy source:
/** 
 * Try to get the value of an option, or return null for optional options with no default value. An exception is thrown if no value (and no default value) is given and the option is not optional, or if the config-value cannot be parsed. <p/> Note that after   {@link #checkOptions()} has been called, this methodshould not throw any errors.
 * @param option the option to get the value for.
 * @param < T >    type of the option.
 * @return the option value or null if
 * @throws Config.BadConfigurationError if the config-value cannot be parsed or if the option is null but required.
 */
public <T>T getOption(Option<T> option) throws Config.BadConfigurationError {
  T opt;
  try {
    opt=tryGetOption(option);
  }
 catch (  IllegalArgumentException e) {
    throw new Config.BadConfigurationError("String_Node_Str" + getConfigKey(option) + "String_Node_Str"+ e.getMessage(),e);
  }
  if (opt == null && !option.isOptional()) {
    throw new Config.BadConfigurationError("String_Node_Str" + getConfigKey(option));
  }
  return opt;
}

Fixed version (ground truth):
/** 
 * Try to get the value of an option, or return null for optional options with no default value. An exception is thrown if no value (and no default value) is given and the option is not optional, or if the config-value cannot be parsed. <p/> Note that after   {@link #checkOptions()} has been called, this methodshould not throw any errors.
 * @param option the option to get the value for.
 * @param < T >    type of the option.
 * @return the option value or null if
 * @throws BadConfigurationError if the option is not defined in this group, if config-value cannotbe parsed or if the option is null but required.
 */
public <T>T getOption(Option<T> option) throws BadConfigurationError {
  if (!containsOption(option)) {
    throw new BadConfigurationError("String_Node_Str" + option.getKey() + "String_Node_Str"+ prefix);
  }
  T opt;
  try {
    opt=tryGetOption(option);
  }
 catch (  IllegalArgumentException e) {
    throw new Config.BadConfigurationError("String_Node_Str" + getConfigKey(option) + "String_Node_Str"+ e.getMessage(),e);
  }
  if (opt == null && !option.isOptional()) {
    throw new Config.BadConfigurationError("String_Node_Str" + getConfigKey(option));
  }
  return opt;
}
Program: 186757
Project: 186757
Buggy source:
/** 
 * Get the parsed default value from the config or from the option if not set.
 * @param option the option to get the default value for.
 * @param < T >    the type of the value
 * @return the default value, or null if no default is set in neither the config nor the option.
 */
public <T>T getDefaultValue(Option<T> option){
  String val=config.getDefaultValue(getConfigKey(option));
  if (val == null) {
    return option.getDefaultValue(this);
  }
 else {
    return option.parse(this,val);
  }
}

Fixed version (ground truth):
/** 
 * Get the parsed default value from the config or from the option if not set.
 * @param option the option to get the default value for.
 * @param < T >    the type of the value
 * @return the default value, or null if no default is set in neither the config nor the option.
 */
public <T>T getDefaultValue(Option<T> option){
  if (!containsOption(option)) {
    throw new BadConfigurationError("String_Node_Str" + option.getKey() + "String_Node_Str"+ prefix);
  }
  String val=config.getDefaultValue(getConfigKey(option));
  if (val == null) {
    return option.getDefaultValue(this);
  }
 else {
    return option.parse(this,val);
  }
}
Program: 186758
Project: 186758
Buggy source:
/** 
 * Try to get the value of an option, or its default value. If no value and no default value is available, this returns null, even if the option is not optional. <p/> Note that after   {@link #checkOptions()} has been called, this methodshould not throw any errors.
 * @param option the option to query.
 * @param < T >    Type of the option
 * @return The value, the default value, or null if no value is available.
 * @throws IllegalArgumentException if the config-value cannot be parsed or is not valid.
 */
public <T>T tryGetOption(Option<T> option) throws IllegalArgumentException {
  String val;
  if (prefix != null && !optionSet.containsKey(option.getKey())) {
    val=config.getValue(option.getKey());
  }
 else {
    val=config.getValue(getConfigKey(option));
  }
  if (val == null) {
    return option.getDefaultValue(this);
  }
 else {
    return option.parse(this,val);
  }
}

Fixed version (ground truth):
/** 
 * Try to get the value of an option, or its default value. If no value and no default value is available, this returns null, even if the option is not optional. <p/> Note that after   {@link #checkOptions()} has been called, this methodshould not throw any errors.
 * @param option the option to query.
 * @param < T >    Type of the option
 * @return The value, the default value, or null if no value is available.
 * @throws IllegalArgumentException if the config-value cannot be parsed or is not valid.
 */
public <T>T tryGetOption(Option<T> option) throws IllegalArgumentException {
  if (!containsOption(option)) {
    throw new BadConfigurationError("String_Node_Str" + option.getKey() + "String_Node_Str"+ prefix);
  }
  String val=config.getValue(getConfigKey(option));
  if (val == null) {
    return option.getDefaultValue(this);
  }
 else {
    return option.parse(this,val);
  }
}
Program: 186759
Project: 186759
Buggy source:
/** 
 * Get the default value from the config or from the option if not set, but do not parse it or replace any keywords.
 * @param option the option to get the default value for.
 * @return the default value as set in the config file or the option.
 */
public String getDefaultValueText(Option option){
  String val=config.getDefaultValue(getConfigKey(option));
  if (val == null) {
    Object def=option.getDefaultValue();
    return def != null ? def.toString() : null;
  }
 else {
    return val;
  }
}

Fixed version (ground truth):
/** 
 * Get the default value from the config or from the option if not set, but do not parse it or replace any keywords.
 * @param option the option to get the default value for.
 * @return the default value as set in the config file or the option.
 */
public String getDefaultValueText(Option option){
  if (!containsOption(option)) {
    throw new BadConfigurationError("String_Node_Str" + option.getKey() + "String_Node_Str"+ prefix);
  }
  String val=config.getDefaultValue(getConfigKey(option));
  if (val == null) {
    Object def=option.getDefaultValue();
    return def != null ? def.toString() : null;
  }
 else {
    return val;
  }
}
Program: 186760
Project: 186760
Buggy source:
public <T>void setOption(Option<T> option,T value){
  config.setProperty(getConfigKey(option),value.toString());
}

Fixed version (ground truth):
public <T>void setOption(Option<T> option,T value){
  if (!containsOption(option)) {
    throw new BadConfigurationError("String_Node_Str" + option.getKey() + "String_Node_Str"+ prefix);
  }
  config.setProperty(getConfigKey(option),value.toString());
}
Program: 186761
Project: 186761
Buggy source:
/** 
 * Check if option has been assigned a value in the config.
 * @param option the option to check.
 * @return true if option has been explicitly set.
 * @see Option#isEnabled(OptionGroup)
 * @see #hasValue(Option)
 */
public boolean isSet(Option<?> option){
  return config.isSet(getConfigKey(option));
}

Fixed version (ground truth):
/** 
 * Check if option has been assigned a value in the config.
 * @param option the option to check.
 * @return true if option has been explicitly set.
 * @see Option#isEnabled(OptionGroup)
 * @see #hasValue(Option)
 */
public boolean isSet(Option<?> option){
  if (!containsOption(option)) {
    throw new BadConfigurationError("String_Node_Str" + option.getKey() + "String_Node_Str"+ prefix);
  }
  return config.isSet(getConfigKey(option));
}
Program: 186762
Project: 186762
Buggy source:
/** 
 * Check if we have any value for this option (either set explicitly or some default value). Does not check if the value can be parsed.
 * @param option the option to check.
 * @return true if there is some value available for this option.
 * @see Option#isEnabled(OptionGroup)
 * @see #isSet(Option)
 */
public boolean hasValue(Option<?> option){
  String val=config.getValue(getConfigKey(option));
  return val != null || option.getDefaultValue(this) != null;
}

Fixed version (ground truth):
/** 
 * Check if we have any value for this option (either set explicitly or some default value). Does not check if the value can be parsed.
 * @param option the option to check.
 * @return true if there is some value available for this option.
 * @see Option#isEnabled(OptionGroup)
 * @see #isSet(Option)
 */
public boolean hasValue(Option<?> option){
  if (!containsOption(option)) {
    throw new BadConfigurationError("String_Node_Str" + option.getKey() + "String_Node_Str"+ prefix);
  }
  String val=config.getValue(getConfigKey(option));
  return val != null || option.getDefaultValue(this) != null;
}
Program: 186763
Project: 186763
Buggy source:
public JOPConfig(Config configData){
  OptionGroup jopConfig=configData.getOptions().getGroup("String_Node_Str");
  this.asmFile=new File(jopConfig.getOption(ASM_FILE));
  this.rws=jopConfig.getOption(READ_WAIT_STATES).intValue();
  this.wws=jopConfig.getOption(WRITE_WAIT_STATES).intValue();
  this.cmp=jopConfig.getOption(MULTIPROCESSOR);
  this.cpus=jopConfig.getOption(CMP_CPUS).intValue();
  this.timeslot=jopConfig.getOption(CMP_TIMESLOT).intValue();
  this.objectCacheName=jopConfig.getOption(CACHE_IMPL);
  this.objectCacheAssociativity=jopConfig.getOption(OBJECT_CACHE_ASSOCIATIVITY).intValue();
  this.objectCacheBlockSize=jopConfig.getOption(OBJECT_CACHE_BLOCK_SIZE).intValue();
  this.objectCacheFieldTag=false;
  this.objectCacheLineSize=jopConfig.getOption(OBJECT_CACHE_WORDS_PER_LINE).intValue();
  this.objectCacheHitCycles=jopConfig.getOption(OBJECT_CACHE_HIT_CYCLES);
  this.objectCacheLoadFieldCycles=jopConfig.getOption(OBJECT_CACHE_LOAD_FIELD_CYCLES);
  this.objectCacheLoadBlockCycles=jopConfig.getOption(OBJECT_CACHE_LOAD_BLOCK_CYCLES);
}

Fixed version (ground truth):
public JOPConfig(Config configData){
  OptionGroup jopConfig=getOptions(configData);
  this.asmFile=new File(jopConfig.getOption(ASM_FILE));
  this.rws=jopConfig.getOption(READ_WAIT_STATES).intValue();
  this.wws=jopConfig.getOption(WRITE_WAIT_STATES).intValue();
  this.cmp=jopConfig.getOption(MULTIPROCESSOR);
  this.cpus=jopConfig.getOption(CMP_CPUS).intValue();
  this.timeslot=jopConfig.getOption(CMP_TIMESLOT).intValue();
  this.objectCacheName=jopConfig.getOption(CACHE_IMPL);
  this.objectCacheAssociativity=jopConfig.getOption(OBJECT_CACHE_ASSOCIATIVITY).intValue();
  this.objectCacheBlockSize=jopConfig.getOption(OBJECT_CACHE_BLOCK_SIZE).intValue();
  this.objectCacheFieldTag=false;
  this.objectCacheLineSize=jopConfig.getOption(OBJECT_CACHE_WORDS_PER_LINE).intValue();
  this.objectCacheHitCycles=jopConfig.getOption(OBJECT_CACHE_HIT_CYCLES);
  this.objectCacheLoadFieldCycles=jopConfig.getOption(OBJECT_CACHE_LOAD_FIELD_CYCLES);
  this.objectCacheLoadBlockCycles=jopConfig.getOption(OBJECT_CACHE_LOAD_BLOCK_CYCLES);
}
Program: 186764
Project: 186764
Buggy source:
/** 
 * Find and remove unused classes, methods and fields
 */
public void removeUnusedMembers(){
  if (!getPhaseOptions().getOption(REMOVE_UNUSED_MEMBERS)) {
    return;
  }
  logger.info("String_Node_Str");
  new UnusedCodeRemover(jcopter,getOptimizeOptions()).execute();
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Find and remove unused classes, methods and fields
 */
public void removeUnusedMembers(){
  if (!getOptimizeOptions().getOption(REMOVE_UNUSED_MEMBERS)) {
    return;
  }
  logger.info("String_Node_Str");
  new UnusedCodeRemover(jcopter,getOptimizeOptions()).execute();
  logger.info("String_Node_Str");
}
Program: 186765
Project: 186765
Buggy source:
public static MethodCache getCacheModel(WCETTool p){
  Config c=p.getConfig();
switch (c.getOption(JOPConfig.CACHE_IMPL)) {
case NO_METHOD_CACHE:
    return new NoMethodCache(p);
case LRU_CACHE:
  return BlockCache.fromConfig(p,true);
case FIFO_CACHE:
return BlockCache.fromConfig(p,false);
case LRU_VARBLOCK_CACHE:
return VarBlockCache.fromConfig(p,true);
case FIFO_VARBLOCK_CACHE:
return VarBlockCache.fromConfig(p,false);
default :
throw new AssertionError("String_Node_Str" + c.getOption(JOPConfig.CACHE_IMPL));
}
}

Fixed version (ground truth):
public static MethodCache getCacheModel(WCETTool p){
  OptionGroup options=JOPConfig.getOptions(p.getConfig());
switch (options.getOption(JOPConfig.CACHE_IMPL)) {
case NO_METHOD_CACHE:
    return new NoMethodCache(p);
case LRU_CACHE:
  return BlockCache.fromConfig(p,true);
case FIFO_CACHE:
return BlockCache.fromConfig(p,false);
case LRU_VARBLOCK_CACHE:
return VarBlockCache.fromConfig(p,true);
case FIFO_VARBLOCK_CACHE:
return VarBlockCache.fromConfig(p,false);
default :
throw new AssertionError("String_Node_Str" + options.getOption(JOPConfig.CACHE_IMPL));
}
}
Program: 186766
Project: 186766
Buggy source:
public static MethodCache fromConfig(WCETTool p,boolean isLRU){
  Config c=p.getConfig();
  return new VarBlockCache(p,c.getOption(JOPConfig.CACHE_BLOCKS).intValue(),c.getOption(JOPConfig.CACHE_SIZE_WORDS).intValue(),isLRU);
}

Fixed version (ground truth):
public static MethodCache fromConfig(WCETTool p,boolean isLRU){
  OptionGroup o=JOPConfig.getOptions(p.getConfig());
  return new VarBlockCache(p,o.getOption(JOPConfig.CACHE_BLOCKS).intValue(),o.getOption(JOPConfig.CACHE_SIZE_WORDS).intValue(),isLRU);
}
Program: 186767
Project: 186767
Buggy source:
/** 
 * If caching is enabled, look for cached results for the given analysis
 */
private Map getCachedResults(Analysis analysis){
  File cacheFile=getCacheFile(analysis);
  try {
    if (!cacheFile.exists())     return null;
    return analysis.deSerializeResult(appInfo,cacheFile);
  }
 catch (  IOException ex) {
    logger.error("String_Node_Str" + analysis.getId() + "String_Node_Str",ex);
  }
catch (  ClassNotFoundException ex) {
    logger.error("String_Node_Str" + analysis.getId() + "String_Node_Str",ex);
  }
catch (  MethodNotFoundException ex) {
    logger.error("String_Node_Str" + analysis.getId() + "String_Node_Str",ex);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * If caching is enabled, look for cached results for the given analysis
 */
private Map getCachedResults(Analysis analysis){
  if (cacheDir == null)   return null;
  File cacheFile=getCacheFile(analysis);
  try {
    if (!cacheFile.exists())     return null;
    return analysis.deSerializeResult(appInfo,cacheFile);
  }
 catch (  IOException ex) {
    logger.error("String_Node_Str" + analysis.getId() + "String_Node_Str",ex);
  }
catch (  ClassNotFoundException ex) {
    logger.error("String_Node_Str" + analysis.getId() + "String_Node_Str",ex);
  }
catch (  MethodNotFoundException ex) {
    logger.error("String_Node_Str" + analysis.getId() + "String_Node_Str",ex);
  }
  return null;
}
Program: 186768
Project: 186768
Buggy source:
@Override public void onSetupConfig(AppSetup setup) throws Config.BadConfigurationException {
  if (setup.getConfig().hasOption(OPT_DFA_CACHE_DIR)) {
    this.cacheDir=new File(setup.getConfig().getOption(OPT_DFA_CACHE_DIR));
  }
}

Fixed version (ground truth):
@Override public void onSetupConfig(AppSetup setup) throws Config.BadConfigurationException {
  if (setup.getConfig().getOption(OPT_DFA_CACHE_DIR) != null) {
    this.cacheDir=new File(setup.getConfig().getOption(OPT_DFA_CACHE_DIR));
  }
}
Program: 186769
Project: 186769
Buggy source:
protected void initialize(){
  PeriodicEventHandler peh=new PeriodicEventHandler(new PriorityParameters(11),new PeriodicParameters(new RelativeTime(0,0),new RelativeTime(1000,0)),new ThreadConfiguration()){
    public void handleAsyncEvent(){
      Terminal.getTerminal().writeln("String_Node_Str");
    }
  }
;
}

Fixed version (ground truth):
protected void initialize(){
  PeriodicEventHandler peh=new PeriodicEventHandler(new PriorityParameters(11),new PeriodicParameters(new RelativeTime(0,0),new RelativeTime(1000,0)),new StorageParameters(0,0,0)){
    public void handleAsyncEvent(){
      Terminal.getTerminal().writeln("String_Node_Str");
    }
  }
;
}
Program: 186770
Project: 186770
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args){
  final ScopedMemory scope=new LTMemory(0,20000L);
  final ScopedMemory inner=new LTMemory(0,10000L);
  final Runnable run=new Runnable(){
    public void run(){
      MyRunner r=new MyRunner();
      for (int i=0; i < 10; ++i) {
        Abc abc=new Abc();
        r.setAbc(abc);
        r.setOuter(scope);
        for (int j=0; j < 10; ++j) {
          inner.enter(r);
        }
      }
    }
  }
;
  System.out.println("String_Node_Str");
  new RtThread(10,500000){
    public void run(){
      for (; ; ) {
        for (int i=0; i < 20; ++i) {
          System.out.print("String_Node_Str");
          scope.enter(run);
        }
        waitForNextPeriod();
      }
    }
  }
;
  System.out.println("String_Node_Str");
  RtThread.startMission();
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param args
 */
public static void main(String[] args){
  final ScopedMemory scope=new LTMemory(20000L);
  final ScopedMemory inner=new LTMemory(10000L);
  final Runnable run=new Runnable(){
    public void run(){
      MyRunner r=new MyRunner();
      for (int i=0; i < 10; ++i) {
        Abc abc=new Abc();
        r.setAbc(abc);
        r.setOuter(scope);
        for (int j=0; j < 10; ++j) {
          inner.enter(r);
        }
      }
    }
  }
;
  System.out.println("String_Node_Str");
  new RtThread(10,500000){
    public void run(){
      for (; ; ) {
        for (int i=0; i < 20; ++i) {
          System.out.print("String_Node_Str");
          scope.enter(run);
        }
        waitForNextPeriod();
      }
    }
  }
;
  System.out.println("String_Node_Str");
  RtThread.startMission();
  System.out.println("String_Node_Str");
}
Program: 186771
Project: 186771
Buggy source:
@SCJProtected public LTMemory(SizeEstimator estimator){
  super(estimator);
}

Fixed version (ground truth):
/** 
 * This is not SCJAllowed because we don't want to instantiate these.  Safety-critical Java developers should instantiate SafetyMemory instead.
 */
@SCJProtected public LTMemory(long size){
  super(size);
}
Program: 186772
Project: 186772
Buggy source:
/** 
 * In vanilla RTSJ, enter() is not necessarily block-free because entering an LTMemory region may have to wait for the region to be finalized.  However, a complaint implementation of JSR 302 shall provide a block-free implementation of enter.  Note that JSR 302 specifies that finalization of LTMemory regions is not performed.
 */
@SCJAllowed(LEVEL_0) @SCJRestricted(maySelfSuspend=false) public void enter(Runnable logic){
}

Fixed version (ground truth):
@SCJProtected @SCJAllowed(LEVEL_0) @SCJRestricted(maySelfSuspend=false) public void enter(Runnable logic){
}
Program: 186773
Project: 186773
Buggy source:
public static void startMission(Safelet scj){
  MissionSequencer ms=scj.getSequencer();
  MissionDescriptor md=ms.getInitialMission();
  md.initialize();
  Terminal.getTerminal().writeln("String_Node_Str");
  RtThread.startMission();
}

Fixed version (ground truth):
public static void startMission(Safelet scj){
  MissionSequencer ms=scj.getSequencer();
  MissionDescriptor md=null;
  md.initialize();
  Terminal.getTerminal().writeln("String_Node_Str");
  RtThread.startMission();
}
Program: 186774
Project: 186774
Buggy source:
ManagedMemory(SizeEstimator estimator){
  super(estimator);
}

Fixed version (ground truth):
ManagedMemory(long size){
  super(size);
}
Program: 186775
Project: 186775
Buggy source:
/** 
 * @param size is the amount of memory that this area can hold.
 */
MissionMemory(SizeEstimator estimator){
  super(estimator);
}

Fixed version (ground truth):
/** 
 * @param size is the amount of memory that this area can hold.
 */
MissionMemory(long size){
  super(size);
}
Program: 186776
Project: 186776
Buggy source:
public PeriodicParameters(RelativeTime start,RelativeTime period){
  this.start=start;
  this.period=period;
}

Fixed version (ground truth):
public PeriodicParameters(RelativeTime start,RelativeTime period){
  super(start,period);
  this.start=start;
  this.period=period;
}
Program: 186777
Project: 186777
Buggy source:
public PrivateMemory(SizeEstimator estimator){
  super(estimator);
}

Fixed version (ground truth):
public PrivateMemory(long size){
  super(size);
}
Program: 186778
Project: 186778
Buggy source:
/** 
 * This is a single mission so we return null for the next mission.
 */
public MissionDescriptor getNextMission(){
  return null;
}

Fixed version (ground truth):
/** 
 * This is a single mission so we return null for the next mission.
 */
public Mission getNextMission(){
  return null;
}
Program: 186779
Project: 186779
Buggy source:
public SingleMissionSequencer(PriorityParameters priority,MissionDescriptor md){
  super(priority);
  mission=md;
}

Fixed version (ground truth):
public SingleMissionSequencer(PriorityParameters priority,MissionDescriptor md){
  super(priority,null,"String_Node_Str");
  mission=md;
}
Program: 186780
Project: 186780
Buggy source:
public Ternary isInterfaceMethod(){
  if (getMethodInfo() != null) {
    return Ternary.valueOf(methodInfo.getClassInfo().isInterface());
  }
  return classRef.isInterface();
}

Fixed version (ground truth):
public Ternary isInterfaceMethod(){
  if (methodInfo != null) {
    return Ternary.valueOf(methodInfo.getClassInfo().isInterface());
  }
  return classRef.isInterface();
}
Program: 186781
Project: 186781
Buggy source:
/** 
 * Find a 'correct' oder for the static <clinit>. Throws an error on cyclic dependencies.
 * @return the ordered list of classes
 * @throws JavaClassFormatError if a cyclic dependency has been found.
 */
public List<ClassInfo> findOrder(){
  printDependency();
  Set<ClassInfo> cliSet=clinit.keySet();
  List<ClassInfo> order=new LinkedList<ClassInfo>();
  int maxIter=cliSet.size();
  for (int i=0; i < maxIter && cliSet.size() != 0; ++i) {
    Iterator itCliSet=cliSet.iterator();
    while (itCliSet.hasNext()) {
      ClassInfo clinf=(ClassInfo)itCliSet.next();
      Set<ClassInfo> depends=clinit.get(clinf);
      if (depends.size() == 0) {
        order.add(clinf);
        for (        ClassInfo clinfInner : clinit.keySet()) {
          Set<ClassInfo> dep=clinit.get(clinfInner);
          dep.remove(clinf);
        }
        itCliSet.remove();
      }
    }
  }
  if (cliSet.size() != 0) {
    printDependency();
    throw new JavaClassFormatError("String_Node_Str");
  }
  return order;
}

Fixed version (ground truth):
/** 
 * Find a 'correct' oder for the static <clinit>. Throws an error on cyclic dependencies.
 * @return the ordered list of classes
 * @throws JavaClassFormatError if a cyclic dependency has been found.
 */
public List<ClassInfo> findOrder(){
  printDependency(false);
  Set<ClassInfo> cliSet=clinit.keySet();
  List<ClassInfo> order=new LinkedList<ClassInfo>();
  int maxIter=cliSet.size();
  for (int i=0; i < maxIter && cliSet.size() != 0; ++i) {
    Iterator itCliSet=cliSet.iterator();
    while (itCliSet.hasNext()) {
      ClassInfo clinf=(ClassInfo)itCliSet.next();
      Set<ClassInfo> depends=clinit.get(clinf);
      if (depends.size() == 0) {
        order.add(clinf);
        for (        ClassInfo clinfInner : clinit.keySet()) {
          Set<ClassInfo> dep=clinit.get(clinfInner);
          dep.remove(clinf);
        }
        itCliSet.remove();
      }
    }
  }
  if (cliSet.size() != 0) {
    printDependency(true);
    throw new JavaClassFormatError("String_Node_Str");
  }
  return order;
}
Program: 186783
Project: 186783
Buggy source:
@Override public boolean visitClass(ClassInfo classInfo){
  MethodInfo mi=classInfo.getMethodInfo(clinitSig);
  if (mi != null) {
    Set<ClassInfo> depends=findDependencies(classInfo,mi,false);
    clinit.put(classInfo,depends);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean visitClass(ClassInfo classInfo){
  MethodInfo mi=classInfo.getMethodInfo(clinitSig);
  if (mi != null) {
    Set<ClassInfo> depends=findDependencies(mi,false);
    clinit.put(classInfo,depends);
  }
  return true;
}
Program: 186784
Project: 186784
Buggy source:
/** 
 * Print the dependency for debugging. Not used at the moment.
 */
private void printDependency(){
  Set<ClassInfo> cliSet=clinit.keySet();
  for (  ClassInfo clinf : cliSet) {
    System.out.println("String_Node_Str" + clinf.getClassName());
    Set<ClassInfo> depends=clinit.get(clinf);
    for (    ClassInfo clf : depends) {
      System.out.println("String_Node_Str" + clf.getClassName());
    }
  }
}

Fixed version (ground truth):
/** 
 * Print the dependency for debugging. Not used at the moment.
 * @param warn if true, print with warning level
 */
private void printDependency(boolean warn){
  Priority lvl=warn ? Level.WARN : Level.DEBUG;
  Set<ClassInfo> cliSet=clinit.keySet();
  for (  ClassInfo clinf : cliSet) {
    logger.log(lvl,"String_Node_Str" + clinf.getClassName());
    Set<ClassInfo> depends=clinit.get(clinf);
    for (    ClassInfo clf : depends) {
      logger.log(lvl,"String_Node_Str" + clf.getClassName());
    }
  }
}
Program: 186785
Project: 186785
Buggy source:
private boolean run(){
  try {
    project.setTopLevelLogger(exec.getExecLogger());
    exec.info("String_Node_Str");
    project.initialize();
    MethodInfo largestMethod=project.getWCETProcessorModel().getMethodCache().checkCache();
    int minWords=MiscUtils.bytesToWords(largestMethod.getCode().getNumberOfBytes(false));
    reportMetric("String_Node_Str",largestMethod.getFQMethodName(),minWords);
  }
 catch (  Exception e) {
    exec.logException("String_Node_Str",e);
    return false;
  }
  if (project.getProjectConfig().doObjectCacheAnalysis()) {
    ObjectCacheAnalysis oca=new ObjectCacheAnalysis(project);
    return oca.run();
  }
 else {
    return runWCETAnalysis();
  }
}

Fixed version (ground truth):
private boolean run(){
  try {
    project.setTopLevelLogger(exec.getExecLogger());
    exec.info("String_Node_Str");
    project.initialize();
    MethodInfo largestMethod=project.getWCETProcessorModel().getMethodCache().checkCache();
    int minWords=MiscUtils.bytesToWords(largestMethod.getCode().getNumberOfBytes());
    reportMetric("String_Node_Str",largestMethod.getFQMethodName(),minWords);
  }
 catch (  Exception e) {
    exec.logException("String_Node_Str",e);
    return false;
  }
  if (project.getProjectConfig().doObjectCacheAnalysis()) {
    ObjectCacheAnalysis oca=new ObjectCacheAnalysis(project);
    return oca.run();
  }
 else {
    return runWCETAnalysis();
  }
}
Program: 186788
Project: 186788
Buggy source:
public static void main(String[] args){
  AESCsp aes=new AESCsp();
  int start=0;
  int stop=0;
  int time=0;
  System.out.println("String_Node_Str");
  int nrCpu=Runtime.getRuntime().availableProcessors();
  if (nrCpu < 3) {
    throw new Error("String_Node_Str");
  }
  new RtThread(aes.source,1,1000).setProcessor(1);
  new RtThread(aes.enc,1,1000).setProcessor(2);
  aes.reset(100);
  System.out.println("String_Node_Str");
  RtThread.startMission();
  start=(int)System.currentTimeMillis();
  while (!finished) {
    ;
  }
  stop=(int)System.currentTimeMillis();
  System.out.println("String_Node_Str" + start);
  System.out.println("String_Node_Str" + stop);
  time=stop - start;
  System.out.println("String_Node_Str" + time);
  System.out.println("String_Node_Str" + aes.sink.ok);
}

Fixed version (ground truth):
public static void main(String[] args){
  AESCsp aes=new AESCsp();
  int start=0;
  int stop=0;
  int time=0;
  System.out.println("String_Node_Str");
  int nrCpu=Runtime.getRuntime().availableProcessors();
  if (nrCpu < 3) {
    throw new Error("String_Node_Str");
  }
  new RtThread(aes.source,1,1000).setProcessor(1);
  new RtThread(aes.enc,1,1000).setProcessor(2);
  aes.reset(10);
  System.out.println("String_Node_Str");
  RtThread.startMission();
  start=(int)System.currentTimeMillis();
  while (!finished) {
    ;
  }
  stop=(int)System.currentTimeMillis();
  System.out.println("String_Node_Str" + start);
  System.out.println("String_Node_Str" + stop);
  time=stop - start;
  System.out.println("String_Node_Str" + time);
  System.out.println("String_Node_Str" + aes.sink.ok);
}
Program: 186789
Project: 186789
Buggy source:
/** 
 * Check if this class is either an extension or an implementation of the given class or interface. <p>Note that this is slightly different from   {@code isExtensionOf() || isImplementationOf()}, because an interface is an instance of java.lang.Object, but it neither implements or extends java.lang.Object.</p>
 * @see #isExtensionOf(ClassInfo)
 * @param classInfo the super class to check.
 * @return true if this class is is a subtype of the given class.
 */
public boolean isSubclassOf(ClassInfo classInfo){
  if (!classInfo.isInterface()) {
    return classInfo.isSuperclassOf(this);
  }
  if (isInterface()) {
    return classInfo.isExtensionOf(this);
  }
 else {
    return classInfo.isImplementationOf(this);
  }
}

Fixed version (ground truth):
/** 
 * Check if this class is either an extension or an implementation of the given class or interface. <p>Note that this is slightly different from   {@code isExtensionOf() || isImplementationOf()}, because an interface is an instance of java.lang.Object, but it neither implements or extends java.lang.Object.</p>
 * @see #isExtensionOf(ClassInfo)
 * @param classInfo the super class to check.
 * @return true if this class is is a subtype of the given class.
 */
public boolean isSubclassOf(ClassInfo classInfo){
  if (!classInfo.isInterface()) {
    return classInfo.isSuperclassOf(this);
  }
  if (isInterface()) {
    return this.isExtensionOf(classInfo);
  }
 else {
    return this.isImplementationOf(classInfo);
  }
}
Program: 186790
Project: 186790
Buggy source:
/** 
 * Find the class enclosing this class which is the same as or a superclass or an interface of the given class. If the given class is a subclass of this class, this returns null.
 * @param classInfo the (sub)class containing this class.
 * @param membersOnly if true, only check outer classes of member inner classes.
 * @return the found enclosing class or null if none found.
 */
public ClassInfo getEnclosingSuperClassOf(ClassInfo classInfo,boolean membersOnly){
  if (membersOnly && isLocalInnerClass()) {
    return null;
  }
  ClassInfo outer=enclosingClass;
  while (outer != null) {
    if (outer.isSubclassOf(classInfo)) {
      return outer;
    }
    if (membersOnly && outer.isLocalInnerClass()) {
      return null;
    }
 else {
      outer=outer.getEnclosingClassInfo();
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Find the class enclosing this class which is the same as or a superclass or an interface of the given class. If the given class is a subclass of this class, this returns null.
 * @param classInfo the (sub)class containing this class.
 * @param membersOnly if true, only check outer classes of member inner classes.
 * @return the found enclosing class or null if none found.
 */
public ClassInfo getEnclosingSuperClassOf(ClassInfo classInfo,boolean membersOnly){
  if (membersOnly && isLocalInnerClass()) {
    return null;
  }
  ClassInfo outer=enclosingClass;
  while (outer != null) {
    if (classInfo.isSubclassOf(outer)) {
      return outer;
    }
    if (membersOnly && outer.isLocalInnerClass()) {
      return null;
    }
 else {
      outer=outer.getEnclosingClassInfo();
    }
  }
  return null;
}
Program: 186791
Project: 186791
Buggy source:
private int mapIndex(int oldIndex){
  return idMap.get(oldIndex);
}

Fixed version (ground truth):
private int mapIndex(int oldIndex){
  if (oldIndex == 0)   return 0;
  return idMap.get(oldIndex);
}
Program: 186792
Project: 186792
Buggy source:
/** 
 * Find all referenced members in a class.
 * @param classInfo the class to search.
 * @param checkMembers if false, do not check fields and methods. Else check everything.
 * @return a set of class names and class member signatures found in the class.
 */
public static Set<String> findReferencedMembers(ClassInfo classInfo,boolean checkMembers){
  Set<String> members=new HashSet<String>();
  ClassMemberVisitor visitor=new ClassMemberVisitor(members);
  JavaClass javaClass=classInfo.compile();
  Set<Integer> ids=findPoolReferences(classInfo,javaClass);
  List<InvokeSite> invokes=new ArrayList<InvokeSite>();
  if (checkMembers) {
    for (    Field field : javaClass.getFields()) {
      FieldInfo fieldInfo=classInfo.getFieldInfo(field.getName());
      visitor.visitField(fieldInfo);
      ids.addAll(findPoolReferences(fieldInfo,field));
    }
    for (    Method method : javaClass.getMethods()) {
      MethodInfo methodInfo=classInfo.getMethodInfo(method.getName() + method.getSignature());
      visitor.visitMethod(methodInfo);
      ids.addAll(findPoolReferences(methodInfo,method,true));
    }
  }
  visitor.visitClass(classInfo);
  visitPoolReferences(classInfo,visitor,ids);
  return members;
}

Fixed version (ground truth):
/** 
 * Find all referenced members in a class.
 * @param classInfo the class to search.
 * @param checkMembers if false, do not check fields and methods. Else check everything.
 * @return a set of class names and class member signatures found in the class.
 */
public static Set<String> findReferencedMembers(ClassInfo classInfo,boolean checkMembers){
  Set<String> members=new HashSet<String>();
  ClassMemberVisitor visitor=new ClassMemberVisitor(members);
  JavaClass javaClass=classInfo.compile();
  Set<Integer> ids=findPoolReferences(classInfo,javaClass);
  List<InvokeSite> invokes=new ArrayList<InvokeSite>();
  if (checkMembers) {
    for (    Field field : javaClass.getFields()) {
      FieldInfo fieldInfo=classInfo.getFieldInfo(field.getName());
      visitor.visitField(fieldInfo);
      ids.addAll(findPoolReferences(fieldInfo,field));
    }
    for (    Method method : javaClass.getMethods()) {
      MethodInfo methodInfo=classInfo.getMethodInfo(method.getName() + method.getSignature());
      visitor.visitMethod(methodInfo);
      ids.addAll(findPoolReferences(methodInfo,method));
    }
  }
  visitor.visitClass(classInfo);
  visitPoolReferences(classInfo,visitor,ids);
  return members;
}
Program: 186793
Project: 186793
Buggy source:
@Override public void visitMethodCode(MethodCode methodCode){
  visitConstantUtf8(cpg.addUtf8("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void visitMethodCode(MethodCode methodCode){
  throw new AssertionError("String_Node_Str");
}
Program: 186794
Project: 186794
Buggy source:
/** 
 * Create a new visitor.
 * @param classInfo the classinfo which will be visited.
 * @param addInvokeSites if true, also remember all visited invocations (as well as the referenced index).
 */
public IdFinderVisitor(ClassInfo classInfo,boolean addInvokeSites){
  this.classInfo=classInfo;
  this.addInvokeSites=addInvokeSites;
  this.ids=new HashSet<Integer>();
  this.cpg=classInfo.getConstantPoolGen();
  this.cp=cpg.getConstantPool();
  this.invokeSites=new LinkedList<InvokeSite>();
  this.classTraverser=new DescendingClassTraverser(this);
}

Fixed version (ground truth):
/** 
 * Create a new visitor.
 * @param classInfo the classinfo which will be visited.
 */
public IdFinderVisitor(ClassInfo classInfo){
  this.classInfo=classInfo;
  this.ids=new HashSet<Integer>();
  this.cpg=classInfo.getConstantPoolGen();
  this.cp=cpg.getConstantPool();
  this.classTraverser=new DescendingClassTraverser(this);
}
Program: 186795
Project: 186795
Buggy source:
private static Set<Integer> findPoolReferences(FieldInfo fieldInfo,Field field){
  ClassInfo classInfo=fieldInfo.getClassInfo();
  IdFinderVisitor visitor=new IdFinderVisitor(classInfo,false);
  visitor.visitConstantUtf8(field.getNameIndex());
  visitor.visitConstantUtf8(field.getSignatureIndex());
  DescendingClassTraverser traverser=new DescendingClassTraverser(visitor);
  traverser.visitAttributes(fieldInfo,field.getAttributes());
  return visitor.getIds();
}

Fixed version (ground truth):
private static Set<Integer> findPoolReferences(FieldInfo fieldInfo,Field field){
  ClassInfo classInfo=fieldInfo.getClassInfo();
  IdFinderVisitor visitor=new IdFinderVisitor(classInfo);
  visitor.visitConstantUtf8(field.getNameIndex());
  visitor.visitConstantUtf8(field.getSignatureIndex());
  DescendingClassTraverser traverser=new DescendingClassTraverser(visitor);
  traverser.visitAttributes(fieldInfo,field.getAttributes());
  return visitor.getIds();
}
Program: 186796
Project: 186796
Buggy source:
private void visitInstructionList(MethodCode methodCode,InstructionList il){
  for (  InstructionHandle ih : il.getInstructionHandles()) {
    Instruction i=ih.getInstruction();
    if (addInvokeSites && i instanceof InvokeInstruction) {
      InvokeSite site=methodCode.getInvokeSite(ih);
      invokeSites.add(site);
    }
    if (i instanceof CPInstruction) {
      visitConstant(((CPInstruction)i).getIndex());
    }
  }
}

Fixed version (ground truth):
private void visitInstructionList(MethodCode methodCode,InstructionList il){
  for (  InstructionHandle ih : il.getInstructionHandles()) {
    Instruction i=ih.getInstruction();
    if (i instanceof CPInstruction) {
      visitConstant(((CPInstruction)i).getIndex());
    }
  }
}
Program: 186797
Project: 186797
Buggy source:
/** 
 * Rebuild the constantpool from a new, empty constantpool. <p>This updates the indices of all references in the code of all methods of this class, therefore do not call this method while modifying the code.</p> <p> Note that the ConstantPoolRebuilder implements ClassVisitor, so you can also use  {@link AppInfo#iterate(ClassVisitor)} to apply it to all classes.</p>
 * @param rebuilder the builder to use to rebuild the pool.
 */
public void rebuildConstantPool(ConstantPoolRebuilder rebuilder){
  ConstantPoolGen newPool=new ConstantPoolGen();
  Set<Integer> usedIndices=ClassReferenceFinder.findPoolReferences(this,true);
  rebuilder.createNewConstantPool(cpg,usedIndices);
  rebuilder.updateClassGen(this,classGen);
  for (  MethodInfo m : methods.values()) {
    rebuilder.updateMethodGen(m,m.getInternalMethodGen());
  }
  for (  FieldInfo f : fields.values()) {
    rebuilder.updateFieldGen(f,f.getInternalFieldGen());
  }
  cpg=newPool;
}

Fixed version (ground truth):
/** 
 * Rebuild the constantpool from a new, empty constantpool. <p>This updates the indices of all references in the code of all methods of this class, therefore do not call this method while modifying the code.</p> <p> Note that the ConstantPoolRebuilder implements ClassVisitor, so you can also use  {@link AppInfo#iterate(ClassVisitor)} to apply it to all classes.</p>
 * @param rebuilder the builder to use to rebuild the pool.
 */
public void rebuildConstantPool(ConstantPoolRebuilder rebuilder){
  ConstantPoolGen newPool=new ConstantPoolGen();
  Set<Integer> usedIndices=ConstantPoolReferenceFinder.findPoolReferences(this,true);
  rebuilder.createNewConstantPool(cpg,usedIndices);
  rebuilder.updateClassGen(this,classGen);
  for (  MethodInfo m : methods.values()) {
    rebuilder.updateMethodGen(m,m.getInternalMethodGen());
  }
  for (  FieldInfo f : fields.values()) {
    rebuilder.updateFieldGen(f,f.getInternalFieldGen());
  }
  cpg=newPool;
}