nus-yam/ex-repair huggingface dataset:
Program: 6161
Project: 6161
Buggy source:
public ClassInfo getClassInfo(){
  if (classInfo == null) {
    classInfo=AppInfo.getSingleton().getClassInfo(className);
  }
  return classInfo;
}

Fixed version (ground truth):
public ClassInfo getClassInfo(){
  if (classInfo == null && !arrayClass) {
    classInfo=AppInfo.getSingleton().getClassInfo(className);
  }
  return classInfo;
}
Program: 6162
Project: 6162
Buggy source:
public ObjectType getType(){
  return new ObjectType(getClassName());
}

Fixed version (ground truth):
public ReferenceType getType(){
  if (arrayClass) {
    int dim=className.lastIndexOf('[') + 1;
    return new ArrayType(Type.getType(className.substring(dim)),dim);
  }
  return new ObjectType(getClassName());
}
Program: 6163
Project: 6163
Buggy source:
@Override public ObjectType getType(){
  return getValue().getType();
}

Fixed version (ground truth):
@Override public ReferenceType getType(){
  return getValue().getType();
}
Program: 6164
Project: 6164
Buggy source:
@Override public ObjectType getType(){
  return getClassRef().getType();
}

Fixed version (ground truth):
@Override public Type getType(){
  return getValue().getType();
}
Program: 6165
Project: 6165
Buggy source:
public abstract ClassRef getClassRef();

Fixed version (ground truth):
/** 
 * Get a reference to the class this constant refers to if it is a class-, method- or field-constant.
 * @return the referenced class or null if no class is referenced by this constant type.
 */
public abstract ClassRef getClassRef();
Program: 6166
Project: 6166
Buggy source:
@Override public ObjectType getType(){
  return getClassRef().getType();
}

Fixed version (ground truth):
@Override public Type getType(){
  return getValue().getDescriptor().getType();
}
Program: 6167
Project: 6167
Buggy source:
public Ternary isInterfaceMethod(){
  return classRef.isInterface();
}

Fixed version (ground truth):
public Ternary isInterfaceMethod(){
  if (methodInfo != null) {
    return Ternary.valueOf(methodInfo.getClassInfo().isInterface());
  }
  return classRef.isInterface();
}
Program: 6168
Project: 6168
Buggy source:
public MethodRef getMethodRef(Signature signature,boolean isInterfaceMethod){
  ClassInfo cls=getClassInfo(signature.getClassName());
  if (cls != null) {
    if (cls.isInterface() != isInterfaceMethod) {
      throw new ClassFormatException("String_Node_Str" + cls.getClassName() + "String_Node_Str");
    }
    MethodInfo method=cls.getMethodInfo(signature);
    if (method == null) {
      return new MethodRef(cls.getClassRef(),signature.getMemberName(),signature.getMemberDescriptor());
    }
 else {
      return method.getMethodRef();
    }
  }
  return new MethodRef(new ClassRef(signature.getClassName(),isInterfaceMethod),signature.getMemberName(),signature.getMemberDescriptor());
}

Fixed version (ground truth):
public MethodRef getMethodRef(Signature signature,boolean isInterfaceMethod){
  ClassInfo cls=classes.get(signature.getClassName());
  if (cls != null) {
    if (cls.isInterface() != isInterfaceMethod) {
      throw new ClassFormatException("String_Node_Str" + cls.getClassName() + "String_Node_Str");
    }
    MethodInfo method=cls.getMethodInfo(signature);
    if (method == null) {
      return new MethodRef(cls.getClassRef(),signature.getMemberName(),signature.getMemberDescriptor());
    }
 else {
      return method.getMethodRef();
    }
  }
  return new MethodRef(new ClassRef(signature.getClassName(),isInterfaceMethod),signature.getMemberName(),signature.getMemberDescriptor());
}
Program: 6169
Project: 6169
Buggy source:
public FieldRef getFieldRef(Signature signature){
  ClassInfo cls=getClassInfo(signature.getClassName());
  if (cls != null) {
    FieldInfo field=cls.getFieldInfo(signature.getMemberName());
    if (field == null) {
      return new FieldRef(cls.getClassRef(),signature.getMemberName(),signature.getMemberDescriptor().getType());
    }
 else {
      return field.getFieldRef();
    }
  }
  return new FieldRef(new ClassRef(signature.getClassName()),signature.getMemberName(),signature.getMemberDescriptor().getType());
}

Fixed version (ground truth):
public FieldRef getFieldRef(Signature signature){
  ClassInfo cls=classes.get(signature.getClassName());
  if (cls != null) {
    FieldInfo field=cls.getFieldInfo(signature.getMemberName());
    if (field == null) {
      return new FieldRef(cls.getClassRef(),signature.getMemberName(),signature.getMemberDescriptor().getType());
    }
 else {
      return field.getFieldRef();
    }
  }
  return new FieldRef(new ClassRef(signature.getClassName()),signature.getMemberName(),signature.getMemberDescriptor().getType());
}
Program: 6170
Project: 6170
Buggy source:
public ClassRef getClassRef(String className,boolean isInterface){
  ClassInfo cls=getClassInfo(className);
  if (cls != null) {
    if (cls.isInterface() != isInterface) {
      throw new ClassFormatException("String_Node_Str" + className + "String_Node_Str");
    }
    return cls.getClassRef();
  }
  return new ClassRef(className,isInterface);
}

Fixed version (ground truth):
public ClassRef getClassRef(String className,boolean isInterface){
  ClassInfo cls=classes.get(className);
  if (cls != null) {
    if (cls.isInterface() != isInterface) {
      throw new ClassFormatException("String_Node_Str" + className + "String_Node_Str");
    }
    return cls.getClassRef();
  }
  return new ClassRef(className,isInterface);
}
Program: 6172
Project: 6172
Buggy source:
public MethodInfo renameMethod(Signature signature,String newName){
  return null;
}

Fixed version (ground truth):
public MethodInfo renameMethod(String memberSignature,String newName){
  MethodInfo method=methods.remove(memberSignature);
  if (method == null) {
    return null;
  }
  method.getMethodGen().setName(newName);
  methods.put(method.getMemberSignature(),method);
  return method;
}
Program: 6173
Project: 6173
Buggy source:
public MethodInfo copyMethod(Signature signature,String newName){
  return null;
}

Fixed version (ground truth):
public MethodInfo copyMethod(String memberSignature,String newName){
  MethodInfo method=methods.get(memberSignature);
  if (method == null) {
    return null;
  }
  method.compileCodeRep();
  MethodGen methodGen=new MethodGen(method.getMethod(),getClassName(),cpg);
  methodGen.setName(newName);
  MethodInfo newMethod=new MethodInfo(this,methodGen);
  methods.put(newMethod.getMemberSignature(),newMethod);
  return newMethod;
}
Program: 6174
Project: 6174
Buggy source:
public FieldInfo renameField(String name,String newName){
  return null;
}

Fixed version (ground truth):
public FieldInfo renameField(String name,String newName){
  FieldInfo field=fields.remove(name);
  if (field == null) {
    return null;
  }
  field.getFieldGen().setName(newName);
  fields.put(newName,field);
  return field;
}
Program: 6175
Project: 6175
Buggy source:
/** 
 * Check if this class is either an extension or an implementation of the given class or interface.
 * @param classInfo the super class to check.
 * @return true if this class is is a subtype of the given class.
 */
public boolean isSubtypeOf(ClassInfo classInfo){
  if (!classInfo.isInterface()) {
    return classInfo.isSuperclassOf(this);
  }
  Set<ClassInfo> supers=getAllSuperClasses();
  return supers.contains(classInfo);
}

Fixed version (ground truth):
/** 
 * Check if this class is either an extension or an implementation of the given class or interface.
 * @param classInfo the super class to check.
 * @return true if this class is is a subtype of the given class.
 */
public boolean isSubtypeOf(ClassInfo classInfo){
  if (!classInfo.isInterface()) {
    return classInfo.isSuperclassOf(this);
  }
  Set<ClassInfo> supers=getAncestors();
  return supers.contains(classInfo);
}
Program: 6176
Project: 6176
Buggy source:
public FieldInfo copyField(String name,String newName){
  return null;
}

Fixed version (ground truth):
public FieldInfo copyField(String name,String newName){
  FieldInfo field=fields.get(name);
  if (field == null) {
    return null;
  }
  FieldGen fieldGen=new FieldGen(field.getField(),cpg);
  fieldGen.setName(newName);
  FieldInfo newField=new FieldInfo(this,fieldGen);
  fields.put(newName,newField);
  return newField;
}
Program: 6177
Project: 6177
Buggy source:
/** 
 * Check if the given class is a subclass of this class.
 * @param classInfo the possible subclass of this class.
 * @return true if the given class is this class or a superclass of this class.
 */
public boolean isSuperclassOf(ClassInfo classInfo){
  ClassInfo cls=classInfo;
  while (cls != null) {
    if (this.equals(cls)) {
      return true;
    }
    cls=cls.getSuperClassInfo();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check if the given class is the same as this class or a subclass of this class.
 * @param classInfo the possible subclass of this class.
 * @return true if the given class is this class or a superclass of this class.
 */
public boolean isSuperclassOf(ClassInfo classInfo){
  ClassInfo cls=classInfo;
  while (cls != null) {
    if (this.equals(cls)) {
      return true;
    }
    cls=cls.getSuperClassInfo();
  }
  return false;
}
Program: 6178
Project: 6178
Buggy source:
public ConstantInfo getConstantInfo(int i){
  if (i < 0 || i >= cpg.getSize()) {
    return null;
  }
  Constant c=cpg.getConstant(i);
  return ConstantInfo.createFromConstant(cpg.getConstantPool(),c);
}

Fixed version (ground truth):
public ConstantInfo getConstantInfo(int i){
  if (i < 0 || i >= cpg.getSize()) {
    return null;
  }
  Constant c=cpg.getConstant(i);
  if (c == null) {
    return null;
  }
  return ConstantInfo.createFromConstant(cpg.getConstantPool(),c);
}
Program: 6179
Project: 6179
Buggy source:
/** 
 * Check if the given class is an extension of this class, i.e. if this is a class, check if the given class is a subclass, if this is an interface, check if the given class is an interface and if this is an extension of the given interface.
 * @param classInfo the class to check.
 * @return true if the class is an extension of this class.
 */
public boolean isExtensionOf(ClassInfo classInfo){
  if (!isInterface()) {
    return isSuperclassOf(classInfo);
  }
  if (!classInfo.isInterface()) {
    return false;
  }
  Set<ClassInfo> interfaces=classInfo.getAllSuperClasses();
  return interfaces.contains(this);
}

Fixed version (ground truth):
/** 
 * Check if the given class is an extension of this class, i.e. if this is a class, check if the given class is a subclass, if this is an interface, check if the given class is an interface and if this is an extension of the given interface.
 * @param classInfo the class to check.
 * @return true if the class is an extension of this class.
 */
public boolean isExtensionOf(ClassInfo classInfo){
  if (!isInterface()) {
    return isSuperclassOf(classInfo);
  }
  if (!classInfo.isInterface()) {
    return false;
  }
  Set<ClassInfo> interfaces=classInfo.getAncestors();
  return interfaces.contains(this);
}
Program: 6180
Project: 6180
Buggy source:
public MethodGen getMethodGen(){
  compileCodeRep();
  return new MethodGen(methodGen.getMethod(),methodGen.getClassName(),methodGen.getConstantPool());
}

Fixed version (ground truth):
/** 
 * Should only be used by ClassInfo.
 * @return the internal methodGen.                           
 */
protected MethodGen getMethodGen(){
  return methodGen;
}
Program: 6181
Project: 6181
Buggy source:
/** 
 * Setup the logger using configuration options. You may want to call   {@link #setReportLoggers(File,File)}first to define the report loggers.
 * @param config the config settings to use.
 */
public void setupLogger(Config config){
  boolean verbose=config.getOption(Config.VERBOSE);
  boolean debug=config.getOption(Config.DEBUG);
  ConsoleAppender defaultAppender;
  if (verbose) {
    defaultAppender=new ConsoleAppender(new PatternLayout("String_Node_Str"),"String_Node_Str");
  }
 else {
    defaultAppender=new ConsoleAppender(new ConsoleLayout("String_Node_Str"),"String_Node_Str");
  }
  defaultAppender.setName("String_Node_Str");
  if (debug) {
    defaultAppender.setThreshold(verbose ? Level.DEBUG : Level.INFO);
  }
 else {
    defaultAppender.setThreshold(Level.WARN);
  }
  Logger.getRootLogger().addAppender(defaultAppender);
  PropertyConfigurator.configure(config.getProperties());
}

Fixed version (ground truth):
/** 
 * Setup the logger using configuration options. You may want to call   {@link #setReportLoggers(File,File)}first to define the report loggers.
 * @param config the config settings to use.
 */
public void setupLogger(Config config){
  boolean verbose=config.getOption(Config.VERBOSE);
  boolean debug=config.getOption(Config.DEBUG);
  boolean quiet=config.getOption(Config.QUIET);
  ConsoleAppender defaultAppender;
  if (verbose) {
    defaultAppender=new ConsoleAppender(new PatternLayout("String_Node_Str"),"String_Node_Str");
  }
 else {
    defaultAppender=new ConsoleAppender(new ConsoleLayout("String_Node_Str"),"String_Node_Str");
  }
  defaultAppender.setName("String_Node_Str");
  Level defaultLevel=Level.INFO;
  if (debug) {
    defaultLevel=Level.DEBUG;
  }
 else   if (quiet) {
    defaultLevel=Level.WARN;
  }
  defaultAppender.setThreshold(defaultLevel);
  Logger.getRootLogger().addAppender(defaultAppender);
  Logger.getRootLogger().setLevel(defaultLevel);
  PropertyConfigurator.configure(config.getProperties());
}
Program: 6182
Project: 6182
Buggy source:
private void processQueue(){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str");
  }
  while (!queue.isEmpty()) {
    ClassInfo next=queue.remove(0);
    if (logger.isTraceEnabled()) {
      logger.trace("String_Node_Str" + next.getClassName());
    }
    int found=processClass(next);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + found + "String_Node_Str"+ next.getClassName());
    }
  }
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + newClasses.size() + "String_Node_Str");
  }
}

Fixed version (ground truth):
private void processQueue(){
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str");
  }
  while (!queue.isEmpty()) {
    ClassInfo next=queue.remove(0);
    if (logger.isTraceEnabled()) {
      logger.trace("String_Node_Str" + next.getClassName());
    }
    int found=processClass(next);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + found + "String_Node_Str"+ next.getClassName());
    }
  }
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + newClasses.size() + "String_Node_Str");
  }
}
Program: 6183
Project: 6183
Buggy source:
private int processClass(ClassInfo classInfo){
  AppInfo appInfo=AppInfo.getSingleton();
  int cnt=0;
  int size=classInfo.getConstantPoolSize();
  for (int i=0; i < size; i++) {
    ClassRef ref=classInfo.getConstantInfo(i).getClassRef();
    if (ref == null) {
      continue;
    }
    ClassInfo cls=ref.getClassInfo();
    if (cls == null) {
      cls=appInfo.loadClass(ref.getClassName());
      if (cls != null) {
        newClasses.add(cls);
        cnt++;
      }
    }
    if (cls != null) {
      enqueue(cls);
    }
  }
  return cnt;
}

Fixed version (ground truth):
private int processClass(ClassInfo classInfo){
  AppInfo appInfo=AppInfo.getSingleton();
  int cnt=0;
  int size=classInfo.getConstantPoolSize();
  for (int i=0; i < size; i++) {
    ConstantInfo constantInfo=classInfo.getConstantInfo(i);
    if (constantInfo == null) {
      continue;
    }
    ClassRef ref=constantInfo.getClassRef();
    if (ref == null) {
      continue;
    }
    ClassInfo cls=ref.getClassInfo();
    if (cls == null) {
      cls=appInfo.loadClass(ref.getClassName());
      if (cls != null) {
        newClasses.add(cls);
        cnt++;
      }
    }
    if (cls != null) {
      enqueue(cls);
    }
  }
  return cnt;
}
Program: 6185
Project: 6185
Buggy source:
public static void main(String[] args){
  JCopter jcopter=new JCopter();
  AppSetup setup=new AppSetup(true);
  setup.setUsageInfo("String_Node_Str","String_Node_Str");
  setup.addStandardOptions(true,true);
  setup.addPackageOptions(true);
  setup.addWriteOptions(true);
  setup.registerModule("String_Node_Str",jcopter);
  String[] rest=setup.setupConfig(args);
  setup.setupLogger();
  setup.setupAppInfo(rest,true);
  jcopter.run(setup);
  setup.writeClasses();
}

Fixed version (ground truth):
public static void main(String[] args){
  JCopter jcopter=new JCopter();
  AppSetup setup=new AppSetup(true);
  setup.setUsageInfo("String_Node_Str","String_Node_Str");
  setup.addStandardOptions(true,true);
  setup.addPackageOptions(true);
  setup.addWriteOptions(true);
  setup.registerModule("String_Node_Str",jcopter);
  String[] rest=setup.setupConfig(args,"String_Node_Str");
  setup.setupLogger();
  setup.setupAppInfo(rest,true);
  jcopter.run(setup);
  setup.writeClasses();
}
Program: 6186
Project: 6186
Buggy source:
private void handleClassLoadFailure(String message,Exception cause){
  if (exitOnMissingClass) {
    System.out.println(message);
    System.exit(4);
  }
 else {
    throw new MissingClassError(message,cause);
  }
}

Fixed version (ground truth):
private void handleClassLoadFailure(String message,Exception cause){
  if (exitOnMissingClass) {
    logger.error(message,cause);
    System.exit(4);
  }
 else {
    throw new MissingClassError(message,cause);
  }
}
Program: 6187
Project: 6187
Buggy source:
public void printVersion(){
  if (versionInfo != null && !"String_Node_Str".equals(versionInfo)) {
    System.out.println(versionInfo);
  }
  for (  String name : modules.keySet()) {
    versionInfo+=name + "String_Node_Str" + modules.get(name).getModuleVersion();
  }
}

Fixed version (ground truth):
public void printVersion(){
  if (versionInfo != null && !"String_Node_Str".equals(versionInfo)) {
    System.out.println(versionInfo);
  }
  for (  String name : tools.keySet()) {
    System.out.println(name + "String_Node_Str" + tools.get(name).getToolVersion());
  }
}
Program: 6189
Project: 6189
Buggy source:
public void setUsageInfo(String prgmName,String description,String optionSyntax){
  this.prgmName=prgmName;
  usageDescription=description;
  this.optionSyntax=optionSyntax;
}

Fixed version (ground truth):
public void setUsageInfo(String programName,String description,String optionSyntax){
  this.programName=programName;
  usageDescription=description;
  this.optionSyntax=optionSyntax;
}
Program: 6190
Project: 6190
Buggy source:
public void printUsage(){
  String optionDesc;
  if (optionSyntax != null) {
    optionDesc="String_Node_Str" + optionSyntax;
  }
 else {
    optionDesc="String_Node_Str";
    if (config.getOptions().availableCommands().size() > 0) {
      optionDesc+="String_Node_Str";
    }
    if (handleAppInfoInit) {
      optionDesc+="String_Node_Str";
    }
  }
  System.out.print("String_Node_Str" + prgmName);
  System.out.println(optionDesc);
  System.out.println();
  if (usageDescription != null && !"String_Node_Str".equals(usageDescription)) {
    System.out.println(usageDescription);
    System.out.println();
  }
  System.out.println("String_Node_Str");
  for (  Option<?> option : config.getOptions().availableOptions()) {
    System.out.println(option.toString(config.getDefaultIndent(),config.getOptions()));
  }
  System.out.println();
}

Fixed version (ground truth):
public void printUsage(){
  String optionDesc;
  if (optionSyntax != null) {
    optionDesc="String_Node_Str" + optionSyntax;
  }
 else {
    optionDesc="String_Node_Str";
    if (config.getOptions().availableCommands().size() > 0) {
      optionDesc+="String_Node_Str";
    }
    if (handleAppInfoInit) {
      optionDesc+="String_Node_Str";
    }
  }
  System.out.print("String_Node_Str" + (programName != null ? programName : "String_Node_Str"));
  System.out.println(optionDesc);
  System.out.println();
  if (usageDescription != null && !"String_Node_Str".equals(usageDescription)) {
    System.out.println(usageDescription);
    System.out.println();
  }
  System.out.println("String_Node_Str");
  for (  Option<?> option : config.getOptions().availableOptions()) {
    System.out.println(option.toString(config.getDefaultIndent(),config.getOptions()));
  }
  System.out.println();
  if (loadSystemProps && configFilename != null) {
    System.out.println("String_Node_Str" + configFilename + "String_Node_Str");
    System.out.println("String_Node_Str");
  }
 else   if (configFilename != null) {
    System.out.println("String_Node_Str" + configFilename + "String_Node_Str");
  }
 else   if (loadSystemProps) {
    System.out.println("String_Node_Str");
  }
}
Program: 6191
Project: 6191
Buggy source:
public AppSetup(Properties defaultProps,boolean loadSystemProps){
  Properties def;
  if (loadSystemProps) {
    def=new Properties(defaultProps);
    def.putAll(System.getProperties());
  }
 else {
    def=defaultProps;
  }
  config=new Config(def);
  appInfo=AppInfo.getSingleton();
  logConfig=new LogConfig();
  modules=new HashMap<String,Module>();
}

Fixed version (ground truth):
/** 
 * Initialize a new AppSetup and set the given default properties (note that tools can add their own default config).
 * @param defaultProps defaults or the config.
 * @param loadSystemProps if true, add all JVM system properties to the default properties.  
 */
public AppSetup(Properties defaultProps,boolean loadSystemProps){
  this.loadSystemProps=loadSystemProps;
  Properties def=new Properties();
  if (defaultProps != null) {
    def.putAll(defaultProps);
  }
  if (loadSystemProps) {
    def.putAll(System.getProperties());
  }
  config=new Config(def);
  appInfo=AppInfo.getSingleton();
  logConfig=new LogConfig();
  tools=new HashMap<String,JopTool>();
}
Program: 6192
Project: 6192
Buggy source:
/** 
 * Write the AppInfo classes to the directory specified by the outDir option.
 * @param outDir the option for the classfiles output directory.
 */
public void writeClasses(Option<String> outDir){
  try {
    ClassWriter writer=new ClassWriter();
    writer.setup(config.getOptions());
    writer.write(config.getOption(outDir));
  }
 catch (  IOException e) {
    System.out.println("String_Node_Str" + e.getMessage());
    System.exit(5);
  }
}

Fixed version (ground truth):
/** 
 * Write the AppInfo classes to the directory specified by the outDir option.
 * @param outDir the option for the classfiles output directory.
 */
public void writeClasses(Option<String> outDir){
  try {
    ClassWriter writer=new ClassWriter();
    writer.setup(config.getOptions());
    writer.write(config.getOption(outDir));
  }
 catch (  IOException e) {
    ClassWriter.logger.error("String_Node_Str" + e.getMessage(),e);
    System.exit(5);
  }
}
Program: 6195
Project: 6195
Buggy source:
public void printUsage(){
  String optionDesc;
  if (optionSyntax != null) {
    optionDesc="String_Node_Str" + optionSyntax;
  }
 else {
    optionDesc="String_Node_Str";
    if (config.getOptions().availableCommands().size() > 0) {
      optionDesc+="String_Node_Str";
    }
    if (handleAppInfoInit) {
      optionDesc+="String_Node_Str";
    }
  }
  System.out.print("String_Node_Str" + prgmName);
  System.out.println(optionDesc);
  System.out.println();
  if (usageDescription != null && !"String_Node_Str".equals(usageDescription)) {
    System.out.println(usageDescription);
    System.out.println();
  }
  System.out.println("String_Node_Str");
  for (  Option<?> option : config.getOptions().availableOptions()) {
    System.out.println(option.toString(20));
  }
}

Fixed version (ground truth):
public void printUsage(){
  String optionDesc;
  if (optionSyntax != null) {
    optionDesc="String_Node_Str" + optionSyntax;
  }
 else {
    optionDesc="String_Node_Str";
    if (config.getOptions().availableCommands().size() > 0) {
      optionDesc+="String_Node_Str";
    }
    if (handleAppInfoInit) {
      optionDesc+="String_Node_Str";
    }
  }
  System.out.print("String_Node_Str" + prgmName);
  System.out.println(optionDesc);
  System.out.println();
  if (usageDescription != null && !"String_Node_Str".equals(usageDescription)) {
    System.out.println(usageDescription);
    System.out.println();
  }
  System.out.println("String_Node_Str");
  for (  Option<?> option : config.getOptions().availableOptions()) {
    System.out.println(option.toString(config.getDefaultIndent()));
  }
}
Program: 6196
Project: 6196
Buggy source:
/** 
 * Setup the logger. You may want to call   {@link #setupConfig(String[])} first toload commandline options.
 * @see com.jopdesign.common.logger.LogConfig#setupLogger(Config)
 */
public void setupLogger(){
  logConfig.setupLogger(config);
}

Fixed version (ground truth):
/** 
 * Setup the logger. You may want to call   {@link #setupConfig(String[])} first toload commandline options.
 * @see LogConfig#setupLogger(Config)
 */
public void setupLogger(){
  logConfig.setupLogger(config);
}
Program: 6198
Project: 6198
Buggy source:
@Override protected String getDefaultsText(){
  if (optional && !defaultValue) {
    return "String_Node_Str";
  }
  return super.getDefaultsText();
}

Fixed version (ground truth):
@Override protected String getDefaultsText(){
  if (optional && !defaultValue) {
    return skipChecks ? "String_Node_Str" : "String_Node_Str";
  }
  return super.getDefaultsText();
}
Program: 6199
Project: 6199
Buggy source:
/** 
 * Dump configuration of all set properties for debugging purposes. To print a list of all options with their values, use   {@link OptionGroup#dumpConfiguration(int)}.
 * @param indent indent used for keys
 * @return a dump of all options with their respective values.
 */
public String dumpConfiguration(int indent){
  StringBuilder sb=new StringBuilder();
  for (  Map.Entry<Object,Object> e : props.entrySet()) {
    sb.append(String.format("String_Node_Str" + indent + "String_Node_Str","String_Node_Str",e.getKey(),e.getValue() == null ? "String_Node_Str" : e.getValue()));
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Dump configuration of all set properties for debugging purposes. To print a list of all options with their values, use   {@link #printConfiguration(int)}.
 * @see #printConfiguration(int)
 * @param indent indent used for keys
 * @return a dump of all options with their respective values.
 */
public String dumpConfiguration(int indent){
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  printConfig(new PrintStream(os),indent,new HashSet<String>());
  return os.toString();
}
Program: 6200
Project: 6200
Buggy source:
public String toString(int lAdjust){
  StringBuffer s=new StringBuffer("String_Node_Str");
  s.append(key);
  for (int i=s.length(); i <= lAdjust; i++) {
    s.append(' ');
  }
  s.append(' ');
  s.append(descrString());
  return s.toString();
}

Fixed version (ground truth):
public String toString(int lAdjust){
  StringBuffer s=new StringBuffer("String_Node_Str");
  if (shortKey != SHORT_NONE) {
    s.append('-');
    s.append(shortKey);
    s.append("String_Node_Str");
  }
 else {
    s.append("String_Node_Str");
  }
  s.append(key);
  for (int i=s.length(); i <= lAdjust; i++) {
    s.append(' ');
  }
  s.append("String_Node_Str");
  s.append(descrString());
  return s.toString();
}
Program: 6202
Project: 6202
Buggy source:
/** 
 * Rebuild the constantpool and remove all entries marked for removal by   {@link #removeConstant(int)}as well as all duplicate entries. <p>This also 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>
 * @see #removeConstant(int)
 * @return true if the constantpool has been changed
 */
public boolean cleanupConstantPool(){
  ConstantPoolGen newPool=new ConstantPoolGen();
  int[] idxMap=new int[cpg.getSize()];
  boolean changed=false;
  for (int i=0; i < idxMap.length; i++) {
    if (removeIndices.contains(i)) {
      idxMap[i]=-1;
      changed=true;
      continue;
    }
    idxMap[i]=newPool.addConstant(cpg.getConstant(i),cpg);
    if (idxMap[i] != i) {
      changed=true;
    }
  }
  if (!changed) {
    return false;
  }
  classGen.setConstantPool(newPool);
  return true;
}

Fixed version (ground truth):
/** 
 * Rebuild the constantpool and remove all entries marked for removal by   {@link #removeConstant(int)}as well as all duplicate entries. <p>This also 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>
 * @see #removeConstant(int)
 * @return true if the constantpool has been changed
 */
public boolean cleanupConstantPool(){
  if (removeIndices.isEmpty()) {
    return false;
  }
  ConstantPoolGen newPool=new ConstantPoolGen();
  int[] idxMap=new int[cpg.getSize()];
  for (int i=0; i < idxMap.length; i++) {
    if (removeIndices.contains(i)) {
      idxMap[i]=-1;
      continue;
    }
    Constant c=cpg.getConstant(i);
    if (c == null) {
      continue;
    }
    idxMap[i]=newPool.addConstant(c,cpg);
  }
  classGen.setConstantPool(newPool);
  return true;
}
Program: 6203
Project: 6203
Buggy source:
/** 
 * Setup the logger. You may want to call   {@link #setupConfig(String[])} first toload commandline options.
 * @see LogConfig#setupLogger(Config)
 */
public void setupLogger(){
  logConfig.setupLogger(config);
}

Fixed version (ground truth):
/** 
 * Setup the logger. You may want to call   {@link #setupConfig(String[])} first toload commandline options.
 * @see LogConfig#setupLogger(Config)
 * @param addReportLoggers if true, add html-report loggers writing to {@link Config#WRITE_PATH}.
 */
public void setupLogger(boolean addReportLoggers){
  logConfig.setupLogger(config);
  if (addReportLoggers) {
    String outDir=config.getOption(Config.WRITE_PATH) + File.separator;
    try {
      logConfig.setReportLoggers(new File(outDir + "String_Node_Str"),new File(outDir + "String_Node_Str"));
    }
 catch (    IOException e) {
      System.err.println("String_Node_Str" + e.getMessage());
      System.exit(4);
    }
  }
}
Program: 6204
Project: 6204
Buggy source:
/** 
 * Setup the logger using configuration options. You may want to call   {@link #setReportLoggers(File,File)}first to define the report loggers.
 * @param config the config settings to use.
 */
public void setupLogger(Config config){
  boolean verbose=config.getOption(Config.VERBOSE);
  boolean debug=config.getOption(Config.DEBUG);
  boolean quiet=config.getOption(Config.QUIET);
  ConsoleAppender defaultAppender;
  if (verbose) {
    defaultAppender=new ConsoleAppender(new PatternLayout("String_Node_Str"),"String_Node_Str");
  }
 else {
    defaultAppender=new ConsoleAppender(new ConsoleLayout("String_Node_Str"),"String_Node_Str");
  }
  defaultAppender.setName("String_Node_Str");
  Level defaultLevel=Level.INFO;
  if (debug) {
    defaultLevel=Level.DEBUG;
  }
 else   if (quiet) {
    defaultLevel=Level.WARN;
  }
  defaultAppender.setThreshold(defaultLevel);
  Logger.getRootLogger().addAppender(defaultAppender);
  Logger.getRootLogger().setLevel(defaultLevel);
  PropertyConfigurator.configure(config.getProperties());
}

Fixed version (ground truth):
/** 
 * Setup the logger using configuration options. You may want to call   {@link #setReportLoggers(File,File)}first to define the report loggers.
 * @param config the config settings to use.
 */
public void setupLogger(Config config){
  boolean verbose=config.getOption(Config.VERBOSE);
  boolean debug=config.getOption(Config.DEBUG);
  boolean quiet=config.getOption(Config.QUIET);
  ConsoleAppender defaultAppender;
  if (verbose) {
    defaultAppender=new ConsoleAppender(new PatternLayout("String_Node_Str"),"String_Node_Str");
  }
 else {
    defaultAppender=new ConsoleAppender(new ConsoleLayout("String_Node_Str"),"String_Node_Str");
  }
  defaultAppender.setName("String_Node_Str");
  Level defaultLevel=Level.INFO;
  if (debug) {
    defaultLevel=Level.DEBUG;
  }
 else   if (quiet) {
    defaultLevel=Level.WARN;
  }
  defaultAppender.setThreshold(defaultLevel);
  Logger.getRootLogger().addAppender(defaultAppender);
  Logger.getRootLogger().setLevel(Level.ALL);
  PropertyConfigurator.configure(config.getProperties());
}
Program: 6205
Project: 6205
Buggy source:
private void processQueue(){
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str");
  }
  while (!queue.isEmpty()) {
    ClassInfo next=queue.remove(0);
    if (logger.isTraceEnabled()) {
      logger.trace("String_Node_Str" + next.getClassName());
    }
    int found=processClass(next);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + found + "String_Node_Str"+ next.getClassName());
    }
  }
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + newClasses.size() + "String_Node_Str");
  }
}

Fixed version (ground truth):
private void processQueue(){
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str");
  }
  while (!queue.isEmpty()) {
    ClassInfo next=queue.remove(0);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + next.getClassName());
    }
    int found=processClass(next);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + found + "String_Node_Str"+ next.getClassName());
    }
  }
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + newClasses.size() + "String_Node_Str");
  }
}
Program: 6206
Project: 6206
Buggy source:
public static void main(String[] args){
  ExampleTool example=new ExampleTool();
  Properties defaults=null;
  try {
    defaults=AppSetup.loadResourceProps(ExampleTool.class,"String_Node_Str");
  }
 catch (  IOException e) {
    System.out.println("String_Node_Str" + e.getMessage());
    System.exit(1);
  }
  AppSetup setup=new AppSetup(defaults,true);
  setup.setUsageInfo("String_Node_Str","String_Node_Str");
  setup.setVersionInfo("String_Node_Str");
  setup.addStandardOptions(true,true);
  setup.addWriteOptions(true);
  setup.registerModule("String_Node_Str",example);
  String[] rest=setup.setupConfig(args,"String_Node_Str");
  setup.setupLogger();
  setup.setupAppInfo(rest,true);
  setup.writeClasses();
}

Fixed version (ground truth):
public static void main(String[] args){
  ExampleTool example=new ExampleTool();
  Properties defaults=null;
  try {
    defaults=AppSetup.loadResourceProps(ExampleTool.class,"String_Node_Str");
  }
 catch (  IOException e) {
    System.out.println("String_Node_Str" + e.getMessage());
    System.exit(1);
  }
  AppSetup setup=new AppSetup(defaults,true);
  setup.setUsageInfo("String_Node_Str","String_Node_Str");
  setup.setVersionInfo("String_Node_Str");
  setup.addStandardOptions(true,true);
  setup.addWriteOptions(true);
  setup.registerModule("String_Node_Str",example);
  String[] rest=setup.setupConfig(args,"String_Node_Str");
  setup.setupLogger(false);
  setup.setupAppInfo(rest,true);
  setup.writeClasses();
}
Program: 6207
Project: 6207
Buggy source:
public static void main(String[] args){
  JCopter jcopter=new JCopter();
  AppSetup setup=new AppSetup(true);
  setup.setUsageInfo("String_Node_Str","String_Node_Str");
  setup.addStandardOptions(true,true);
  setup.addPackageOptions(true);
  setup.addWriteOptions(true);
  setup.registerModule("String_Node_Str",jcopter);
  String[] rest=setup.setupConfig(args,"String_Node_Str");
  setup.setupLogger();
  setup.setupAppInfo(rest,true);
  jcopter.run(setup);
  setup.writeClasses();
}

Fixed version (ground truth):
public static void main(String[] args){
  JCopter jcopter=new JCopter();
  AppSetup setup=new AppSetup(true);
  setup.setUsageInfo("String_Node_Str","String_Node_Str");
  setup.addStandardOptions(true,true);
  setup.addPackageOptions(true);
  setup.addWriteOptions(true);
  setup.registerModule("String_Node_Str",jcopter);
  String[] rest=setup.setupConfig(args,"String_Node_Str");
  setup.setupLogger(true);
  setup.setupAppInfo(rest,true);
  jcopter.run(setup);
  setup.writeClasses();
}
Program: 6209
Project: 6209
Buggy source:
/** 
 * @param args File containing regex pattern to be matched.
 */
public static void main(String[] args) throws IOException {
  byte[] input;
{
    byte[] buf=new byte[1 << 20];
    int read;
    int offset=0;
    int capacity=buf.length;
    while ((read=System.in.read(buf,offset,capacity)) != -1) {
      System.out.write(buf,offset,read);
      offset+=read;
      capacity-=read;
      if (capacity == 0) {
        throw new IOException();
      }
    }
    input=new byte[offset];
    System.arraycopy(buf,0,input,0,offset);
  }
  File patternFile=new File(args[0]);
  long patternFileLen=patternFile.length();
  if (patternFileLen > Integer.MAX_VALUE) {
    throw new IOException();
  }
  byte[] pattern=new byte[(int)patternFileLen];
  new FileInputStream(patternFile).read(pattern);
  Pattern p=Pattern.compile(headerPattern + new String(pattern) + trailerPattern,Pattern.DOTALL);
  System.exit(p.matcher(new String(input)).matches() ? 0 : 2);
}

Fixed version (ground truth):
/** 
 * @param args File containing regex pattern to be matched by System.in.
 */
public static void main(String[] args) throws IOException {
  byte[] input;
{
    byte[] buf=new byte[1 << 20];
    int read;
    int offset=0;
    int capacity=buf.length;
    while ((read=System.in.read(buf,offset,capacity)) != -1) {
      System.out.write(buf,offset,read);
      offset+=read;
      capacity-=read;
      if (capacity == 0) {
        throw new IOException();
      }
    }
    input=new byte[offset];
    System.arraycopy(buf,0,input,0,offset);
  }
  File patternFile=new File(args[0]);
  long patternFileLen=patternFile.length();
  if (patternFileLen > Integer.MAX_VALUE) {
    throw new IOException();
  }
  byte[] pattern=new byte[(int)patternFileLen];
  new FileInputStream(patternFile).read(pattern);
  Pattern p=Pattern.compile(headerPattern + new String(pattern) + trailerPattern,Pattern.DOTALL);
  System.exit(p.matcher(new String(input)).matches() ? 0 : 2);
}
Program: 6214
Project: 6214
Buggy source:
private List<MethodInfo> dfaReceivers(InstructionHandle ih,List<MethodInfo> staticImpls){
  if (this.receiverAnalysis != null && receiverAnalysis.containsKey(ih)) {
    ContextMap<String,String> receivers=receiverAnalysis.get(ih);
    List<MethodInfo> dynImpls=new Vector<MethodInfo>();
    Set<String> dynReceivers=receivers.keySet();
    for (    MethodInfo impl : staticImpls) {
      if (dynReceivers.contains(impl.getFQMethodName())) {
        dynReceivers.remove(impl.getFQMethodName());
        dynImpls.add(impl);
      }
 else {
        logger.info("String_Node_Str" + impl);
      }
    }
    if (!dynReceivers.isEmpty()) {
      throw new AssertionError("String_Node_Str" + dynReceivers);
    }
    return dynImpls;
  }
 else {
    return staticImpls;
  }
}

Fixed version (ground truth):
private List<MethodInfo> dfaReceivers(InstructionHandle ih,List<MethodInfo> staticImpls){
  if (this.receiverAnalysis != null && receiverAnalysis.containsKey(ih)) {
    ContextMap<String,String> receivers=receiverAnalysis.get(ih);
    List<MethodInfo> dynImpls=new Vector<MethodInfo>();
    Set<String> dynReceivers=new HashSet<String>(receivers.keySet());
    for (    MethodInfo impl : staticImpls) {
      if (dynReceivers.contains(impl.getFQMethodName())) {
        dynReceivers.remove(impl.getFQMethodName());
        dynImpls.add(impl);
      }
 else {
        logger.info("String_Node_Str" + impl);
      }
    }
    if (!dynReceivers.isEmpty()) {
      throw new AssertionError("String_Node_Str" + dynReceivers);
    }
    return dynImpls;
  }
 else {
    return staticImpls;
  }
}
Program: 6216
Project: 6216
Buggy source:
public void add(V el){
  setImpl.add(el);
  if (setImpl.size() >= limit) {
    this.isSaturated=true;
    this.setImpl=null;
  }
}

Fixed version (ground truth):
public void add(V el){
  if (this.isSaturated())   return;
  setImpl.add(el);
  if (setImpl.size() > limit) {
    setTop();
  }
}
Program: 6217
Project: 6217
Buggy source:
public int getSize(){
  if (isSaturated)   return limit;
 else   return setImpl.size();
}

Fixed version (ground truth):
public int getSize(){
  if (isSaturated)   return limit + 1;
 else   return setImpl.size();
}
Program: 6218
Project: 6218
Buggy source:
public void addAll(BoundedSet<V> other){
  setImpl.addAll(other.getSet());
  if (setImpl.size() >= limit) {
    this.isSaturated=true;
    this.setImpl=null;
  }
}

Fixed version (ground truth):
public void addAll(BoundedSet<V> other){
  if (this.isSaturated())   return;
  if (other.isSaturated()) {
    setTop();
    return;
  }
  setImpl.addAll(other.getSet());
  if (setImpl.size() > limit) {
    setTop();
  }
}
Program: 6219
Project: 6219
Buggy source:
public BoundedSet<V> join(BoundedSet<V> other){
  if (this.isSaturated())   return this;
 else   if (other.isSaturated())   return other;
  HashSet<V> joinedSet=new HashSet<V>();
  joinedSet.addAll(this.getSet());
  if (other != null)   joinedSet.addAll(other.getSet());
  BoundedSetImpl r=new BoundedSetImpl(joinedSet);
  System.out.println(String.format("String_Node_Str",this,other,r));
  return r;
}

Fixed version (ground truth):
public BoundedSet<V> join(BoundedSet<V> other){
  if (this.isSaturated())   return this;
 else   if (other != null && other.isSaturated())   return other;
  HashSet<V> joinedSet=new HashSet<V>();
  joinedSet.addAll(this.getSet());
  if (other != null)   joinedSet.addAll(other.getSet());
  BoundedSetImpl r=new BoundedSetImpl(joinedSet);
  return r;
}
Program: 6220
Project: 6220
Buggy source:
public boolean isSubset(SymbolicAddressMap other){
  if (other == TOP)   return true;
 else   if (this == TOP)   return false;
 else   if (other == null)   return false;
  for (  Location l : this.map.keySet()) {
    BoundedSet<SymbolicAddress> thisEntry=map.get(l);
    BoundedSet<SymbolicAddress> otherEntry=other.map.get(l);
    if (otherEntry == null)     return false;
    if (!thisEntry.isSubset(otherEntry))     return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean isSubset(SymbolicAddressMap other){
  if (other.isTop())   return true;
 else   if (this.isTop())   return false;
 else   if (other == null)   return false;
  for (  Location l : this.map.keySet()) {
    BoundedSet<SymbolicAddress> thisEntry=map.get(l);
    BoundedSet<SymbolicAddress> otherEntry=other.map.get(l);
    if (otherEntry == null)     return false;
    if (!thisEntry.isSubset(otherEntry))     return false;
  }
  return true;
}
Program: 6221
Project: 6221
Buggy source:
public BoundedSet<SymbolicAddress> getTopOfStack(){
  if (this == TOP)   return bsFactory.top();
  return map.get(new Location(topOfStack));
}

Fixed version (ground truth):
public BoundedSet<SymbolicAddress> getTopOfStack(){
  if (this.isTop())   return bsFactory.top();
  return map.get(new Location(topOfStack));
}
Program: 6222
Project: 6222
Buggy source:
public void put(Location l,BoundedSet<SymbolicAddress> bs){
  if (this == TOP)   return;
  if (!l.isHeapLoc() && l.stackLoc > this.topOfStack) {
    this.topOfStack=l.stackLoc;
  }
  this.map.put(l,bs);
}

Fixed version (ground truth):
public void put(Location l,BoundedSet<SymbolicAddress> bs){
  if (this.isTop())   return;
  if (!l.isHeapLoc() && l.stackLoc > this.topOfStack) {
    this.topOfStack=l.stackLoc;
  }
  this.map.put(l,bs);
}
Program: 6223
Project: 6223
Buggy source:
/** 
 * Clone address map, but only those stack variables below   {@code bound} 
 */
public SymbolicAddressMap cloneFilterStack(int bound){
  if (this == TOP)   return this;
  SymbolicAddressMap copy=new SymbolicAddressMap(this.bsFactory);
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : map.entrySet()) {
    Location loc=entry.getKey();
    if (loc.isHeapLoc() || loc.stackLoc < bound) {
      copy.put(loc,entry.getValue());
    }
  }
  return copy;
}

Fixed version (ground truth):
/** 
 * Clone address map, but only those stack variables below   {@code bound} 
 */
public SymbolicAddressMap cloneFilterStack(int bound){
  if (this.isTop())   return this;
  SymbolicAddressMap copy=new SymbolicAddressMap(this.bsFactory);
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : map.entrySet()) {
    Location loc=entry.getKey();
    if (loc.isHeapLoc() || loc.stackLoc < bound) {
      copy.put(loc,entry.getValue());
    }
  }
  return copy;
}
Program: 6224
Project: 6224
Buggy source:
public void putStack(int index,BoundedSet<SymbolicAddress> bs){
  if (this == TOP)   return;
  this.put(new Location(index),bs);
}

Fixed version (ground truth):
public void putStack(int index,BoundedSet<SymbolicAddress> bs){
  if (this.isTop())   return;
  this.put(new Location(index),bs);
}
Program: 6225
Project: 6225
Buggy source:
/** 
 * Print results
 * @param indent Indentation (amount of leading whitespace)
 */
public void print(PrintStream out,int indent){
  StringBuffer indentstr=new StringBuffer();
  for (int i=0; i < indent; i++)   indentstr.append(' ');
  out.print(indentstr.toString());
  if (this == TOP) {
    out.println("String_Node_Str");
    return;
  }
  out.println("String_Node_Str" + map.size() + "String_Node_Str");
  indentstr.append(' ');
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : map.entrySet()) {
    out.print(indentstr.toString());
    out.print(entry.getKey());
    out.print("String_Node_Str");
    out.print(entry.getValue());
    out.print("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Print results
 * @param indent Indentation (amount of leading whitespace)
 */
public void print(PrintStream out,int indent){
  StringBuffer indentstr=new StringBuffer();
  for (int i=0; i < indent; i++)   indentstr.append(' ');
  out.print(indentstr.toString());
  if (this.isTop()) {
    out.println("String_Node_Str");
    return;
  }
  out.println("String_Node_Str" + map.size() + "String_Node_Str");
  indentstr.append(' ');
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : map.entrySet()) {
    out.print(indentstr.toString());
    out.print(entry.getKey());
    out.print("String_Node_Str");
    out.print(entry.getValue());
    out.print("String_Node_Str");
  }
}
Program: 6226
Project: 6226
Buggy source:
/** 
 * Clone address map, but only those stack variables with index greater than or equal to  {@code framePtr}. The stack variables are move down to the beginning of the stack. 
 */
public SymbolicAddressMap cloneInvoke(int framePtr){
  if (this == TOP)   return this;
  SymbolicAddressMap copy=new SymbolicAddressMap(this.bsFactory);
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : map.entrySet()) {
    Location loc=entry.getKey();
    if (loc.isHeapLoc()) {
      copy.put(loc,entry.getValue());
    }
 else     if (loc.stackLoc >= framePtr) {
      copy.putStack(loc.stackLoc - framePtr,entry.getValue());
    }
  }
  return copy;
}

Fixed version (ground truth):
/** 
 * Clone address map, but only those stack variables with index greater than or equal to  {@code framePtr}. The stack variables are move down to the beginning of the stack. 
 */
public SymbolicAddressMap cloneInvoke(int framePtr){
  if (this.isTop())   return this;
  SymbolicAddressMap copy=new SymbolicAddressMap(this.bsFactory);
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : map.entrySet()) {
    Location loc=entry.getKey();
    if (loc.isHeapLoc()) {
      copy.put(loc,entry.getValue());
    }
 else     if (loc.stackLoc >= framePtr) {
      copy.putStack(loc.stackLoc - framePtr,entry.getValue());
    }
  }
  return copy;
}
Program: 6227
Project: 6227
Buggy source:
/** 
 * Merge in df info from returned method 
 */
public void joinReturned(SymbolicAddressMap returned,int framePtr){
  if (this == TOP)   return;
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : returned.map.entrySet()) {
    Location loc=entry.getKey();
    BoundedSet<SymbolicAddress> currentSet=map.get(loc);
    BoundedSet<SymbolicAddress> returnedSet=returned.map.get(loc);
    if (loc.isHeapLoc()) {
      put(loc,returnedSet.join(currentSet));
    }
 else {
      putStack(loc.stackLoc + framePtr,returnedSet.join(currentSet));
    }
  }
}

Fixed version (ground truth):
/** 
 * Merge in df info from returned method. 
 */
public void joinReturned(SymbolicAddressMap returned,int framePtr){
  if (returned == null) {
    throw new AssertionError("String_Node_Str");
  }
  if (this.isTop())   return;
 else   if (returned.isTop()) {
    setTop();
    return;
  }
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : returned.map.entrySet()) {
    Location locReturnedFrame=entry.getKey();
    Location locCallerFrame;
    if (locReturnedFrame.isHeapLoc()) {
      locCallerFrame=locReturnedFrame;
    }
 else {
      locCallerFrame=new Location(locReturnedFrame.stackLoc + framePtr);
    }
    BoundedSet<SymbolicAddress> callerSet=map.get(locCallerFrame);
    BoundedSet<SymbolicAddress> returnedSet=returned.map.get(locReturnedFrame);
    put(locCallerFrame,returnedSet.join(callerSet));
  }
}