nus-yam/ex-repair huggingface dataset:
Program: 186894
Project: 186894
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++) {
    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;
}

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;
    }
    String className;
    if (ref.isArray()) {
      Type baseType=((ArrayType)ref.getType()).getBasicType();
      if (baseType instanceof ObjectType) {
        className=((ObjectType)baseType).getClassName();
      }
 else {
        continue;
      }
    }
 else {
      className=ref.getClassName();
    }
    ClassInfo cls;
    if (appInfo.hasClassInfo(className)) {
      cls=appInfo.getClassInfo(className);
    }
 else {
      cls=appInfo.loadClass(className);
      if (cls != null) {
        newClasses.add(cls);
        cnt++;
      }
    }
    if (cls != null) {
      enqueue(cls);
    }
  }
  return cnt;
}
Program: 186895
Project: 186895
Buggy source:
public ClassRef(String className,boolean anInterface){
  this.className=className;
  this.anInterface=anInterface ? Ternary.TRUE : Ternary.FALSE;
}

Fixed version (ground truth):
public ClassRef(String className,boolean anInterface){
  this.className=className;
  this.anInterface=anInterface ? Ternary.TRUE : Ternary.FALSE;
  arrayClass=className.startsWith("String_Node_Str");
}
Program: 186896
Project: 186896
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: 186897
Project: 186897
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: 186898
Project: 186898
Buggy source:
@Override public ObjectType getType(){
  return getValue().getType();
}

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

Fixed version (ground truth):
@Override public Type getType(){
  return getValue().getType();
}
Program: 186900
Project: 186900
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: 186901
Project: 186901
Buggy source:
@Override public ObjectType getType(){
  return getClassRef().getType();
}

Fixed version (ground truth):
@Override public Type getType(){
  return getValue().getDescriptor().getType();
}
Program: 186902
Project: 186902
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: 186903
Project: 186903
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: 186904
Project: 186904
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: 186905
Project: 186905
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: 186907
Project: 186907
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: 186908
Project: 186908
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: 186909
Project: 186909
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: 186910
Project: 186910
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: 186911
Project: 186911
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: 186912
Project: 186912
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: 186913
Project: 186913
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: 186914
Project: 186914
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: 186915
Project: 186915
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: 186916
Project: 186916
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: 186917
Project: 186917
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: 186918
Project: 186918
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: 186920
Project: 186920
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: 186921
Project: 186921
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: 186922
Project: 186922
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: 186924
Project: 186924
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: 186925
Project: 186925
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: 186926
Project: 186926
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: 186927
Project: 186927
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: 186930
Project: 186930
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: 186931
Project: 186931
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: 186933
Project: 186933
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: 186934
Project: 186934
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: 186935
Project: 186935
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: 186937
Project: 186937
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: 186942
Project: 186942
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: 186943
Project: 186943
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: 186944
Project: 186944
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: 186945
Project: 186945
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: 186946
Project: 186946
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: 186949
Project: 186949
Buggy source:
public boolean isSubset(BoundedSet<V> otherEntry){
  if (otherEntry.isTop())   return true;
 else   if (this.isTop())   return false;
  return otherEntry.getSet().containsAll(this.getSet());
}

Fixed version (ground truth):
public boolean isSubset(BoundedSet<V> otherEntry){
  if (otherEntry.isSaturated())   return true;
 else   if (this.isSaturated())   return false;
  return otherEntry.getSet().containsAll(this.getSet());
}
Program: 186950
Project: 186950
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  BoundedSetImpl other=(BoundedSetImpl)obj;
  if (this.getSize() != other.getSize())   return false;
  if (this.isSaturated)   return other.isSaturated;
 else   return setImpl.equals(other.setImpl);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  BoundedSetImpl other=(BoundedSetImpl)obj;
  if (this.isSaturated)   return other.isSaturated;
  if (this.getSize() != other.getSize())   return false;
 else   return setImpl.equals(other.setImpl);
}
Program: 186951
Project: 186951
Buggy source:
private BoundedSetImpl(HashSet<V> joinedSet){
  setImpl=joinedSet;
}

Fixed version (ground truth):
private BoundedSetImpl(HashSet<V> set){
  if (set.size() > limit) {
    this.isSaturated=true;
  }
 else {
    setImpl=set;
  }
}
Program: 186952
Project: 186952
Buggy source:
public BoundedSet<V> join(BoundedSet<V> other){
  HashSet<V> joinedSet=new HashSet<V>();
  joinedSet.addAll(this.getSet());
  if (other == null)   return new BoundedSetImpl(joinedSet);
  joinedSet.addAll(other.getSet());
  if (joinedSet.size() >= limit) {
    return top;
  }
 else {
    return new BoundedSetImpl(joinedSet);
  }
}

Fixed version (ground truth):
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;
}
Program: 186953
Project: 186953
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: 186954
Project: 186954
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: 186955
Project: 186955
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: 186956
Project: 186956
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: 186957
Project: 186957
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: 186958
Project: 186958
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: 186959
Project: 186959
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: 186960
Project: 186960
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));
  }
}
Program: 186961
Project: 186961
Buggy source:
@Override public int hashCode(){
  if (this == TOP)   return 1;
 else   return 2 + map.hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  if (isTop())   return 1;
 else   return 2 + map.hashCode();
}
Program: 186962
Project: 186962
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  SymbolicAddressMap other=(SymbolicAddressMap)obj;
  if (map == null || other.map == null)   return false;
  return map.equals(other.map);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  SymbolicAddressMap other=(SymbolicAddressMap)obj;
  if (this.isTop() || other.isTop())   return (this.isTop() && other.isTop());
  return map.equals(other.map);
}
Program: 186963
Project: 186963
Buggy source:
@Override protected SymbolicAddressMap clone() throws CloneNotSupportedException {
  if (this == TOP)   return this;
  return new SymbolicAddressMap(this);
}

Fixed version (ground truth):
@Override protected SymbolicAddressMap clone(){
  if (this.isTop())   return this;
  return new SymbolicAddressMap(this);
}
Program: 186964
Project: 186964
Buggy source:
public BoundedSet<SymbolicAddress> getStack(int index){
  if (this == TOP)   return bsFactory.top();
  Location stackLoc=new Location(index);
  BoundedSet<SymbolicAddress> val=map.get(stackLoc);
  if (val == null)   throw new AssertionError("String_Node_Str" + index);
  return val;
}

Fixed version (ground truth):
public BoundedSet<SymbolicAddress> getStack(int index){
  if (this.isTop())   return bsFactory.top();
  Location stackLoc=new Location(index);
  BoundedSet<SymbolicAddress> val=map.get(stackLoc);
  if (val == null)   throw new AssertionError("String_Node_Str" + index);
  return val;
}
Program: 186965
Project: 186965
Buggy source:
/** 
 * Set stack info from other other map, upto bound. Used to restore stack frames when returning from a method 
 */
public void addStackUpto(SymbolicAddressMap in,int bound){
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : map.entrySet()) {
    Location loc=entry.getKey();
    if (!loc.isHeapLoc() && loc.stackLoc < bound) {
      map.put(loc,in.getStack(loc.stackLoc));
    }
  }
}

Fixed version (ground truth):
/** 
 * Set stack info from other other map, upto bound. Used to restore stack frames when returning from a method 
 */
public void addStackUpto(SymbolicAddressMap in,int bound){
  if (in == null) {
    throw new AssertionError("String_Node_Str");
  }
  if (this.isTop())   return;
  if (in.isTop()) {
    setTop();
    return;
  }
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : in.map.entrySet()) {
    Location loc=entry.getKey();
    if (!loc.isHeapLoc() && loc.stackLoc < bound) {
      map.put(loc,in.getStack(loc.stackLoc));
    }
  }
}
Program: 186966
Project: 186966
Buggy source:
public void join(SymbolicAddressMap b){
  joinReturned(b,0);
}

Fixed version (ground truth):
public void join(SymbolicAddressMap b){
  if (b == null)   return;
  joinReturned(b,0);
}
Program: 186969
Project: 186969
Buggy source:
public BoundedSet<SymbolicAddress> getTopOfStack(){
  return map.get(new Location(topOfStack));
}

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