nus-yam/ex-repair huggingface dataset:
Program: 85283
Project: 85283
Buggy source:
private void emitUnits(){
  AbstractInsnNode insn=instructions.getFirst();
  ArrayDeque<LabelNode> labls=new ArrayDeque<LabelNode>();
  while (insn != null) {
    if (insn instanceof LabelNode)     labls.add((LabelNode)insn);
    Unit u=units.get(insn);
    if (u == null) {
      insn=insn.getNext();
      continue;
    }
    emitUnits(u);
    if (insn instanceof LabelNode && u instanceof IdentityStmt && ((IdentityStmt)u).getRightOp() instanceof CaughtExceptionRef) {
      Collection<UnitBox> traps=trapHandlers.get((LabelNode)insn);
      for (      UnitBox ub : traps)       ub.setUnit(u);
    }
    while (!labls.isEmpty()) {
      LabelNode ln=labls.poll();
      Collection<UnitBox> boxes=labels.get(ln);
      if (boxes != null) {
        for (        UnitBox box : boxes) {
          box.setUnit(u instanceof UnitContainer ? ((UnitContainer)u).getFirstUnit() : u);
        }
      }
    }
    insn=insn.getNext();
  }
  if (labls.isEmpty())   return;
  Unit end=Jimple.v().newNopStmt();
  body.getUnits().add(end);
  while (!labls.isEmpty()) {
    LabelNode ln=labls.poll();
    Collection<UnitBox> boxes=labels.get(ln);
    if (boxes != null) {
      for (      UnitBox box : boxes)       box.setUnit(end);
    }
  }
}

Fixed version (ground truth):
private void emitUnits(){
  AbstractInsnNode insn=instructions.getFirst();
  ArrayDeque<LabelNode> labls=new ArrayDeque<LabelNode>();
  while (insn != null) {
    if (insn instanceof LabelNode)     labls.add((LabelNode)insn);
    Unit u=units.get(insn);
    if (u == null) {
      insn=insn.getNext();
      continue;
    }
    emitUnits(u);
{
      IdentityStmt caughtEx=null;
      if (u instanceof IdentityStmt)       caughtEx=(IdentityStmt)u;
 else       if (u instanceof UnitContainer)       caughtEx=getIdentityRefFromContrainer((UnitContainer)u);
      if (insn instanceof LabelNode && caughtEx != null && caughtEx.getRightOp() instanceof CaughtExceptionRef) {
        Collection<UnitBox> traps=trapHandlers.get((LabelNode)insn);
        for (        UnitBox ub : traps)         ub.setUnit(caughtEx);
      }
    }
    while (!labls.isEmpty()) {
      LabelNode ln=labls.poll();
      Collection<UnitBox> boxes=labels.get(ln);
      if (boxes != null) {
        for (        UnitBox box : boxes) {
          box.setUnit(u instanceof UnitContainer ? ((UnitContainer)u).getFirstUnit() : u);
        }
      }
    }
    insn=insn.getNext();
  }
  if (labls.isEmpty())   return;
  Unit end=Jimple.v().newNopStmt();
  body.getUnits().add(end);
  while (!labls.isEmpty()) {
    LabelNode ln=labls.poll();
    Collection<UnitBox> boxes=labels.get(ln);
    if (boxes != null) {
      for (      UnitBox box : boxes)       box.setUnit(end);
    }
  }
}
Program: 85284
Project: 85284
Buggy source:
/** 
 * Returns the RefType with the given className. Returns null if no type with the given name can be found.
 */
public RefType getRefTypeUnsafe(String className){
  RefType refType=nameToClass.get(className);
  return refType;
}

Fixed version (ground truth):
/** 
 * Returns the RefType with the given className. Returns null if no type with the given name can be found.
 */
public RefType getRefTypeUnsafe(String className){
  RefType refType=nameToClass.get(unescapeName(className));
  return refType;
}
Program: 85285
Project: 85285
Buggy source:
final public BitVector get(Type type){
  if (type == null)   return null;
  while (allocNodeListener.hasNext()) {
    AllocNode n=allocNodeListener.next();
    for (    final Type t : Scene.v().getTypeNumberer()) {
      if (!(t instanceof RefLikeType))       continue;
      if (t instanceof AnySubType)       continue;
      if (isUnresolved(t))       continue;
      if (castNeverFails(n.getType(),t)) {
        BitVector mask=typeMask.get(t);
        if (mask == null) {
          typeMask.put(t,mask=new BitVector());
          for (          final AllocNode an : pag.getAllocNodeNumberer()) {
            if (castNeverFails(an.getType(),t)) {
              mask.set(an.getNumber());
            }
          }
          continue;
        }
        mask.set(n.getNumber());
      }
    }
  }
  BitVector ret=(BitVector)typeMask.get(type);
  if (ret == null && fh != null)   if (type instanceof RefType && ((RefType)type).getSootClass().isPhantom())   return new BitVector();
 else   throw new RuntimeException("String_Node_Str" + type);
  return ret;
}

Fixed version (ground truth):
final public BitVector get(Type type){
  if (type == null)   return null;
  while (allocNodeListener.hasNext()) {
    AllocNode n=allocNodeListener.next();
    for (    final Type t : Scene.v().getTypeNumberer()) {
      if (!(t instanceof RefLikeType))       continue;
      if (t instanceof AnySubType)       continue;
      if (isUnresolved(t))       continue;
      if (castNeverFails(n.getType(),t)) {
        BitVector mask=typeMask.get(t);
        if (mask == null) {
          typeMask.put(t,mask=new BitVector());
          for (          final AllocNode an : pag.getAllocNodeNumberer()) {
            if (castNeverFails(an.getType(),t)) {
              mask.set(an.getNumber());
            }
          }
          continue;
        }
        mask.set(n.getNumber());
      }
    }
  }
  BitVector ret=(BitVector)typeMask.get(type);
  if (ret == null && fh != null) {
    SootClass curClass=((RefType)type).getSootClass();
    if (type instanceof RefType && curClass.isPhantom())     return new BitVector();
 else {
      while (curClass.hasSuperclass()) {
        curClass=curClass.getSuperclass();
        if (type instanceof RefType && curClass.isPhantom())         return new BitVector();
      }
      throw new RuntimeException("String_Node_Str" + type);
    }
  }
  return ret;
}
Program: 85286
Project: 85286
Buggy source:
/** 
 * Constructs a hierarchy from the current scene. 
 */
public FastHierarchy(){
  this.sc=Scene.v();
  for (final Iterator<SootClass> clIt=sc.getClasses().snapshotIterator(); clIt.hasNext(); ) {
    SootClass cl=clIt.next();
    if (cl.resolvingLevel() < SootClass.HIERARCHY)     continue;
    if (!cl.isInterface() && cl.hasSuperclass()) {
      classToSubclasses.put(cl.getSuperclass(),cl);
    }
    for (    final SootClass supercl : cl.getInterfaces()) {
      if (cl.isInterface()) {
        interfaceToSubinterfaces.put(supercl,cl);
      }
 else {
        interfaceToImplementers.put(supercl,cl);
      }
    }
  }
  dfsVisit(0,Scene.v().getSootClass("String_Node_Str"));
  for (final Iterator<SootClass> phantomClassIt=Scene.v().getPhantomClasses().snapshotIterator(); phantomClassIt.hasNext(); ) {
    SootClass phantomClass=phantomClassIt.next();
    if (!phantomClass.isInterface())     dfsVisit(0,phantomClass);
  }
}

Fixed version (ground truth):
/** 
 * Constructs a hierarchy from the current scene. 
 */
public FastHierarchy(){
  this.sc=Scene.v();
  for (  SootClass cl : sc.getClasses().getElementsUnsorted()) {
    if (cl.resolvingLevel() < SootClass.HIERARCHY)     continue;
    if (!cl.isInterface() && cl.hasSuperclass()) {
      classToSubclasses.put(cl.getSuperclass(),cl);
    }
    for (    final SootClass supercl : cl.getInterfaces()) {
      if (cl.isInterface()) {
        interfaceToSubinterfaces.put(supercl,cl);
      }
 else {
        interfaceToImplementers.put(supercl,cl);
      }
    }
  }
  dfsVisit(0,Scene.v().getSootClass("String_Node_Str"));
  for (final Iterator<SootClass> phantomClassIt=Scene.v().getPhantomClasses().snapshotIterator(); phantomClassIt.hasNext(); ) {
    SootClass phantomClass=phantomClassIt.next();
    if (!phantomClass.isInterface())     dfsVisit(0,phantomClass);
  }
}
Program: 85287
Project: 85287
Buggy source:
/** 
 * Returns the field of this class with the given subsignature. If such a field does not exist, null is returned.
 */
public SootField getFieldUnsafe(String subsignature){
  checkLevel(SIGNATURES);
  for (  SootField field : fields) {
    if (field.getSubSignature().equals(subsignature))     return field;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the field of this class with the given subsignature. If such a field does not exist, null is returned.
 */
public SootField getFieldUnsafe(String subsignature){
  checkLevel(SIGNATURES);
  for (  SootField field : fields.getElementsUnsorted()) {
    if (field.getSubSignature().equals(subsignature))     return field;
  }
  return null;
}
Program: 85288
Project: 85288
Buggy source:
/** 
 * Returns the field of this class with the given name. Throws a RuntimeException if there is more than one field with the given name. Returns null if no field with the given name exists.
 */
public SootField getFieldByNameUnsafe(String name){
  checkLevel(SIGNATURES);
  SootField foundField=null;
  for (  SootField field : fields) {
    if (field.getName().equals(name)) {
      if (foundField == null)       foundField=field;
 else       throw new RuntimeException("String_Node_Str" + name);
    }
  }
  return foundField;
}

Fixed version (ground truth):
/** 
 * Returns the field of this class with the given name. Throws a RuntimeException if there is more than one field with the given name. Returns null if no field with the given name exists.
 */
public SootField getFieldByNameUnsafe(String name){
  checkLevel(SIGNATURES);
  SootField foundField=null;
  for (  SootField field : fields.getElementsUnsorted()) {
    if (field.getName().equals(name)) {
      if (foundField == null)       foundField=field;
 else       throw new RuntimeException("String_Node_Str" + name);
    }
  }
  return foundField;
}
Program: 85289
Project: 85289
Buggy source:
@Override public void visitMethodInsn(int opcode,String owner,String name,String desc,boolean isInterf){
  super.visitMethodInsn(opcode,owner,name,desc,isInterf);
  for (  Type t : AsmUtil.toJimpleDesc(desc)) {
    if (t instanceof RefType)     scb.addDep(t);
  }
  scb.addDep(AsmUtil.toBaseType(owner));
}

Fixed version (ground truth):
@Override public void visitMethodInsn(int opcode,String owner,String name,String desc,boolean isInterf){
  super.visitMethodInsn(opcode,owner,name,desc,isInterf);
  for (  Type t : AsmUtil.toJimpleDesc(desc)) {
    addDeps(t);
  }
  scb.addDep(AsmUtil.toBaseType(owner));
}
Program: 85290
Project: 85290
Buggy source:
private void runPacksForOneClassAtATime(){
  if (Options.v().src_prec() == Options.src_prec_class && Options.v().keep_line_number()) {
    LineNumberAdder lineNumAdder=LineNumberAdder.v();
    lineNumAdder.internalTransform("String_Node_Str",null);
  }
  setupJAR();
  for (  String path : (Collection<String>)Options.v().process_dir()) {
    for (    String cl : SourceLocator.v().getClassesUnder(path)) {
      SootClass clazz=Scene.v().forceResolve(cl,SootClass.SIGNATURES);
      clazz.setApplicationClass();
    }
    for (    String cl : SourceLocator.v().getClassesUnder(path)) {
      ClassSource source=SourceLocator.v().getClassSource(cl);
      if (source == null)       throw new RuntimeException("String_Node_Str");
      SootClass clazz=Scene.v().getSootClass(cl);
      clazz.setResolvingLevel(SootClass.BODIES);
      source.resolve(clazz);
      for (      SootClass sc : Scene.v().getApplicationClasses()) {
        if (Options.v().validate())         sc.validate();
        if (!sc.isPhantom)         ConstantInitializerToTagTransformer.v().transformClass(sc,true);
      }
      runBodyPacks(clazz);
      writeClass(clazz);
      if (!Options.v().no_writeout_body_releasing())       releaseBodies(clazz);
    }
  }
  tearDownJAR();
  handleInnerClasses();
}

Fixed version (ground truth):
private void runPacksForOneClassAtATime(){
  if (Options.v().src_prec() == Options.src_prec_class && Options.v().keep_line_number()) {
    LineNumberAdder lineNumAdder=LineNumberAdder.v();
    lineNumAdder.internalTransform("String_Node_Str",null);
  }
  setupJAR();
  for (  String path : (Collection<String>)Options.v().process_dir()) {
    for (    String cl : SourceLocator.v().getClassesUnder(path)) {
      SootClass clazz=Scene.v().forceResolve(cl,SootClass.SIGNATURES);
      clazz.setApplicationClass();
    }
    for (    String cl : SourceLocator.v().getClassesUnder(path)) {
      SootClass clazz=null;
      ClassSource source=SourceLocator.v().getClassSource(cl);
      try {
        if (source == null)         throw new RuntimeException("String_Node_Str");
        clazz=Scene.v().getSootClass(cl);
        clazz.setResolvingLevel(SootClass.BODIES);
        source.resolve(clazz);
      }
  finally {
        if (source != null)         source.close();
      }
      for (      SootClass sc : Scene.v().getApplicationClasses()) {
        if (Options.v().validate())         sc.validate();
        if (!sc.isPhantom)         ConstantInitializerToTagTransformer.v().transformClass(sc,true);
      }
      runBodyPacks(clazz);
      writeClass(clazz);
      if (!Options.v().no_writeout_body_releasing())       releaseBodies(clazz);
    }
  }
  tearDownJAR();
  handleInnerClasses();
}
Program: 85291
Project: 85291
Buggy source:
/** 
 * Attempts to load the given class and all of the required support classes. Returns the original class if it was loaded, or null otherwise.
 */
public SootClass tryLoadClass(String className,int desiredLevel){
  setPhantomRefs(true);
  if (!getPhantomRefs() && SourceLocator.v().getClassSource(className) == null) {
    setPhantomRefs(false);
    return null;
  }
  SootResolver resolver=SootResolver.v();
  SootClass toReturn=resolver.resolveClass(className,desiredLevel);
  setPhantomRefs(false);
  return toReturn;
}

Fixed version (ground truth):
/** 
 * Attempts to load the given class and all of the required support classes. Returns the original class if it was loaded, or null otherwise.
 */
public SootClass tryLoadClass(String className,int desiredLevel){
  setPhantomRefs(true);
  ClassSource source=SourceLocator.v().getClassSource(className);
  try {
    if (!getPhantomRefs() && source == null) {
      setPhantomRefs(false);
      return null;
    }
  }
  finally {
    if (source != null)     source.close();
  }
  SootResolver resolver=SootResolver.v();
  SootClass toReturn=resolver.resolveClass(className,desiredLevel);
  setPhantomRefs(false);
  return toReturn;
}
Program: 85294
Project: 85294
Buggy source:
/** 
 * Returns a body corresponding to the parsed jimple for m.  If necessary, applies the BodyExtractorWalker to initialize the bodies map. 
 * @param m the method we want to get a body for.
 * @return the actual body for the given method.
 */
public Body getBody(SootMethod m){
  if (methodToParsedBodyMap == null)   stashBodiesForClass(m.getDeclaringClass());
  return methodToParsedBodyMap.get(m);
}

Fixed version (ground truth):
/** 
 * Returns a body corresponding to the parsed jimple for m.  If necessary, applies the BodyExtractorWalker to initialize the bodies map. 
 * @param m the method we want to get a body for.
 * @return the actual body for the given method.
 */
public Body getBody(SootMethod m){
  if (methodToParsedBodyMap == null) {
synchronized (this) {
      if (methodToParsedBodyMap == null)       stashBodiesForClass(m.getDeclaringClass());
    }
  }
  return methodToParsedBodyMap.get(m);
}
Program: 85295
Project: 85295
Buggy source:
private void stashBodiesForClass(SootClass sc){
  methodToParsedBodyMap=new HashMap<SootMethod,JimpleBody>();
  Walker w=new BodyExtractorWalker(sc,SootResolver.v(),methodToParsedBodyMap);
  boolean oldPhantomValue=Scene.v().getPhantomRefs();
  Scene.v().setPhantomRefs(true);
  mTree.apply(w);
  Scene.v().setPhantomRefs(oldPhantomValue);
}

Fixed version (ground truth):
private void stashBodiesForClass(SootClass sc){
  HashMap<SootMethod,JimpleBody> methodToBodyMap=new HashMap<SootMethod,JimpleBody>();
  Walker w=new BodyExtractorWalker(sc,SootResolver.v(),methodToBodyMap);
  boolean oldPhantomValue=Scene.v().getPhantomRefs();
  Scene.v().setPhantomRefs(true);
  mTree.apply(w);
  Scene.v().setPhantomRefs(oldPhantomValue);
  methodToParsedBodyMap=methodToBodyMap;
}
Program: 85296
Project: 85296
Buggy source:
/** 
 * Fills in the pointer assignment graph returned by setup. 
 */
public void build(){
  QueueReader<Edge> callEdges;
  if (ofcg != null) {
    callEdges=ofcg.callGraph().listener();
    ofcg.build();
    reachables=ofcg.reachableMethods();
    reachables.update();
  }
 else {
    callEdges=cgb.getCallGraph().listener();
    cgb.build();
    reachables=cgb.reachables();
  }
  for (  final SootClass c : Scene.v().getClasses()) {
    handleClass(c);
  }
  while (callEdges.hasNext()) {
    Edge e=callEdges.next();
    if (e.getTgt().method().getDeclaringClass().isConcrete()) {
      MethodPAG.v(pag,e.tgt()).addToPAG(null);
      pag.addCallTarget(e);
    }
  }
  if (pag.getOpts().verbose()) {
    G.v().out.println("String_Node_Str" + totalMethods);
    G.v().out.println("String_Node_Str" + analyzedMethods);
    G.v().out.println("String_Node_Str" + classes);
  }
}

Fixed version (ground truth):
/** 
 * Fills in the pointer assignment graph returned by setup. 
 */
public void build(){
  QueueReader<Edge> callEdges;
  if (ofcg != null) {
    callEdges=ofcg.callGraph().listener();
    ofcg.build();
    reachables=ofcg.reachableMethods();
    reachables.update();
  }
 else {
    callEdges=cgb.getCallGraph().listener();
    cgb.build();
    reachables=cgb.reachables();
  }
  for (  final SootClass c : Scene.v().getClasses()) {
    handleClass(c);
  }
  while (callEdges.hasNext()) {
    Edge e=callEdges.next();
    if (e.getTgt().method().getDeclaringClass().isConcrete()) {
      if (e.tgt().isConcrete() || e.tgt().isNative())       MethodPAG.v(pag,e.tgt()).addToPAG(null);
      pag.addCallTarget(e);
    }
  }
  if (pag.getOpts().verbose()) {
    G.v().out.println("String_Node_Str" + totalMethods);
    G.v().out.println("String_Node_Str" + analyzedMethods);
    G.v().out.println("String_Node_Str" + classes);
  }
}
Program: 85297
Project: 85297
Buggy source:
private void toInstructions(Collection<Unit> units,StmtVisitor stmtV){
  for (  Unit u : units) {
    stmtV.beginNewStmt((Stmt)u);
    u.apply(stmtV);
  }
  stmtV.finalizeInstructions();
}

Fixed version (ground truth):
private void toInstructions(Collection<Unit> units,StmtVisitor stmtV){
  Set<ClassConstant> monitorConsts=new HashSet<ClassConstant>();
  for (  Unit u : units) {
    if (u instanceof MonitorStmt) {
      MonitorStmt monitorStmt=(MonitorStmt)u;
      if (monitorStmt.getOp() instanceof ClassConstant) {
        monitorConsts.add((ClassConstant)monitorStmt.getOp());
      }
    }
  }
  boolean monitorAllocsMade=false;
  for (  Unit u : units) {
    if (!monitorAllocsMade && !monitorConsts.isEmpty() && !(u instanceof IdentityStmt)) {
      stmtV.preAllocateMonitorConsts(monitorConsts);
      monitorAllocsMade=true;
    }
    stmtV.beginNewStmt((Stmt)u);
    u.apply(stmtV);
  }
  stmtV.finalizeInstructions();
}
Program: 85298
Project: 85298
Buggy source:
private Insn buildMonitorInsn(MonitorStmt stmt,Opcode opc){
  Value lockValue=stmt.getOp();
  constantV.setOrigStmt(stmt);
  Register lockReg=null;
  if (lockValue instanceof Constant && opc == Opcode.MONITOR_EXIT)   if ((lockReg=monitorRegs.get(lockValue)) != null)   lockReg=lockReg.clone();
  if (lockReg == null) {
    lockReg=regAlloc.asImmediate(lockValue,constantV);
    regAlloc.lockRegister(lockReg);
    if (lockValue instanceof Constant) {
      monitorRegs.put((Constant)lockValue,lockReg);
      regAlloc.lockRegister(lockReg);
    }
  }
  return new Insn11x(opc,lockReg);
}

Fixed version (ground truth):
private Insn buildMonitorInsn(MonitorStmt stmt,Opcode opc){
  Value lockValue=stmt.getOp();
  constantV.setOrigStmt(stmt);
  Register lockReg=null;
  if (lockValue instanceof Constant)   if ((lockReg=monitorRegs.get(lockValue)) != null)   lockReg=lockReg.clone();
  if (lockReg == null) {
    lockReg=regAlloc.asImmediate(lockValue,constantV);
    regAlloc.lockRegister(lockReg);
    if (lockValue instanceof Constant) {
      monitorRegs.put((Constant)lockValue,lockReg);
      regAlloc.lockRegister(lockReg);
    }
  }
  return new Insn11x(opc,lockReg);
}
Program: 85299
Project: 85299
Buggy source:
private void emitUnits(){
  AbstractInsnNode insn=instructions.getFirst();
  ArrayDeque<LabelNode> labls=new ArrayDeque<LabelNode>();
  while (insn != null) {
    if (insn instanceof LabelNode)     labls.add((LabelNode)insn);
    Unit u=units.get(insn);
    if (u == null) {
      insn=insn.getNext();
      continue;
    }
    emitUnits(u);
    if (insn instanceof LabelNode && u instanceof IdentityStmt && ((IdentityStmt)u).getRightOp() instanceof CaughtExceptionRef) {
      Collection<UnitBox> traps=trapHandlers.get((LabelNode)insn);
      for (      UnitBox ub : traps)       ub.setUnit(u);
    }
    while (!labls.isEmpty()) {
      LabelNode ln=labls.poll();
      Collection<UnitBox> boxes=labels.get(ln);
      if (boxes != null) {
        for (        UnitBox box : boxes) {
          Unit uu=u;
          while (uu instanceof UnitContainer)           uu=((UnitContainer)uu).units[0];
          box.setUnit(uu);
        }
      }
    }
    insn=insn.getNext();
  }
  if (labls.isEmpty())   return;
  Unit end=Jimple.v().newNopStmt();
  body.getUnits().add(end);
  while (!labls.isEmpty()) {
    LabelNode ln=labls.poll();
    Collection<UnitBox> boxes=labels.get(ln);
    if (boxes != null) {
      for (      UnitBox box : boxes)       box.setUnit(end);
    }
  }
}

Fixed version (ground truth):
private void emitUnits(){
  AbstractInsnNode insn=instructions.getFirst();
  ArrayDeque<LabelNode> labls=new ArrayDeque<LabelNode>();
  while (insn != null) {
    if (insn instanceof LabelNode)     labls.add((LabelNode)insn);
    Unit u=units.get(insn);
    if (u == null) {
      insn=insn.getNext();
      continue;
    }
    emitUnits(u);
    if (insn instanceof LabelNode && u instanceof IdentityStmt && ((IdentityStmt)u).getRightOp() instanceof CaughtExceptionRef) {
      Collection<UnitBox> traps=trapHandlers.get((LabelNode)insn);
      for (      UnitBox ub : traps)       ub.setUnit(u);
    }
    while (!labls.isEmpty()) {
      LabelNode ln=labls.poll();
      Collection<UnitBox> boxes=labels.get(ln);
      if (boxes != null) {
        for (        UnitBox box : boxes) {
          box.setUnit(u instanceof UnitContainer ? ((UnitContainer)u).getFirstUnit() : u);
        }
      }
    }
    insn=insn.getNext();
  }
  if (labls.isEmpty())   return;
  Unit end=Jimple.v().newNopStmt();
  body.getUnits().add(end);
  while (!labls.isEmpty()) {
    LabelNode ln=labls.poll();
    Collection<UnitBox> boxes=labels.get(ln);
    if (boxes != null) {
      for (      UnitBox box : boxes)       box.setUnit(end);
    }
  }
}
Program: 85302
Project: 85302
Buggy source:
/** 
 * Get the index of the enclosing function of the specified node.
 */
public int getMethodIDFromPtr(IVarAbstraction pn){
  SootMethod sm=null;
  int ret=Constants.SUPER_MAIN;
  Node node=pn.getWrappedNode();
  if (node instanceof AllocNode) {
    sm=((AllocNode)node).getMethod();
  }
 else   if (node instanceof LocalVarNode) {
    sm=((LocalVarNode)node).getMethod();
  }
 else   if (node instanceof AllocDotField) {
    sm=((AllocDotField)node).getBase().getMethod();
  }
  if (sm != null && func2int.containsKey(sm)) {
    int id=func2int.get(sm);
    if (vis_cg[id] == 0)     ret=Constants.UNKNOWN_FUNCTION;
    if (ret == -1)     System.out.println();
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Get the index of the enclosing function of the specified node.
 */
public int getMethodIDFromPtr(IVarAbstraction pn){
  SootMethod sm=null;
  int ret=Constants.SUPER_MAIN;
  Node node=pn.getWrappedNode();
  if (node instanceof AllocNode) {
    sm=((AllocNode)node).getMethod();
  }
 else   if (node instanceof LocalVarNode) {
    sm=((LocalVarNode)node).getMethod();
  }
 else   if (node instanceof AllocDotField) {
    sm=((AllocDotField)node).getBase().getMethod();
  }
  if (sm != null && func2int.containsKey(sm)) {
    int id=func2int.get(sm);
    if (vis_cg[id] == 0)     ret=Constants.UNKNOWN_FUNCTION;
 else     ret=id;
  }
  return ret;
}
Program: 85304
Project: 85304
Buggy source:
/** 
 * Returns the RefType with the given class name or primitive type.  
 * @throws RuntimeException if the Type for this name cannot be found.Use  {@link #getRefTypeUnsafe(String)} to check if type is an registered RefType.
 */
public Type getType(String arg){
  String type=arg.replaceAll("String_Node_Str","String_Node_Str");
  int arrayCount=arg.contains("String_Node_Str") ? arg.replaceAll("String_Node_Str","String_Node_Str").length() / 2 : 0;
  Type result=getRefTypeUnsafe(type);
  if (result == null) {
switch (type) {
case "String_Node_Str":
      result=LongType.v();
    break;
case "String_Node_Str":
  result=ShortType.v();
break;
case "String_Node_Str":
result=DoubleType.v();
break;
case "String_Node_Str":
result=IntType.v();
break;
case "String_Node_Str":
result=FloatType.v();
break;
case "String_Node_Str":
result=ByteType.v();
break;
case "String_Node_Str":
result=CharType.v();
break;
case "String_Node_Str":
result=VoidType.v();
break;
case "String_Node_Str":
result=BooleanType.v();
break;
default :
throw new RuntimeException("String_Node_Str" + type + "String_Node_Str");
}
}
if (arrayCount != 0) {
result=ArrayType.v(result,arrayCount);
}
return result;
}

Fixed version (ground truth):
/** 
 * Returns the RefType with the given class name or primitive type.  
 * @throws RuntimeException if the Type for this name cannot be found.Use  {@link #getRefTypeUnsafe(String)} to check if type is an registered RefType.
 */
public Type getType(String arg){
  String type=arg.replaceAll("String_Node_Str","String_Node_Str");
  int arrayCount=arg.contains("String_Node_Str") ? arg.replaceAll("String_Node_Str","String_Node_Str").length() / 2 : 0;
  Type result=getRefTypeUnsafe(type);
  if (result == null) {
    if (type.equals("String_Node_Str"))     result=LongType.v();
 else     if (type.equals("String_Node_Str"))     result=ShortType.v();
 else     if (type.equals("String_Node_Str"))     result=DoubleType.v();
 else     if (type.equals("String_Node_Str"))     result=IntType.v();
 else     if (type.equals("String_Node_Str"))     result=FloatType.v();
 else     if (type.equals("String_Node_Str"))     result=ByteType.v();
 else     if (type.equals("String_Node_Str"))     result=CharType.v();
 else     if (type.equals("String_Node_Str"))     result=VoidType.v();
 else     if (type.equals("String_Node_Str"))     result=BooleanType.v();
 else     throw new RuntimeException("String_Node_Str" + type + "String_Node_Str");
  }
  if (arrayCount != 0) {
    result=ArrayType.v(result,arrayCount);
  }
  return result;
}
Program: 85305
Project: 85305
Buggy source:
/** 
 * <p> Returns a <code>ThrowableSet</code> representing the set of exceptions included in <code>include</code> minus the set of exceptions included in <code>exclude</code>. Creates a new <code>ThrowableSet</code> only if there was not already one whose contents correspond to <code>include</code> - <code>exclude</code>. </p>
 * @param include A set of  {@link RefLikeType} objects representingexception types included in the result; may be <code>null</code> if there are no included types.
 * @param exclude A set of  {@link AnySubType} objects representing exceptiontypes excluded from the result; may be <code>null</code> if there are no excluded types.
 * @return a <code>ThrowableSet</code> representing the set ofexceptions corresponding to <code>include</code> - <code>exclude</code>.
 */
private ThrowableSet registerSetIfNew(Set<RefLikeType> include,Set<AnySubType> exclude){
  if (INSTRUMENTING) {
    registrationCalls++;
  }
  ThrowableSet result=new ThrowableSet(include,exclude);
  Reference<ThrowableSet> ref=registry.get(result);
  if (null != ref) {
    ThrowableSet old=ref.get();
    if (null != old)     return old;
  }
  registry.put(result,new WeakReference<ThrowableSet>(result));
  return result;
}

Fixed version (ground truth):
/** 
 * <p> Returns a <code>ThrowableSet</code> representing the set of exceptions included in <code>include</code> minus the set of exceptions included in <code>exclude</code>. Creates a new <code>ThrowableSet</code> only if there was not already one whose contents correspond to <code>include</code> - <code>exclude</code>. </p>
 * @param include A set of  {@link RefLikeType} objects representingexception types included in the result; may be <code>null</code> if there are no included types.
 * @param exclude A set of  {@link AnySubType} objects representing exceptiontypes excluded from the result; may be <code>null</code> if there are no excluded types.
 * @return a <code>ThrowableSet</code> representing the set ofexceptions corresponding to <code>include</code> - <code>exclude</code>.
 */
private ThrowableSet registerSetIfNew(Set<RefLikeType> include,Set<AnySubType> exclude){
  if (INSTRUMENTING) {
    registrationCalls++;
  }
  ThrowableSet result=new ThrowableSet(include,exclude);
  ThrowableSet ref=registry.get(result);
  if (null != ref) {
    return ref;
  }
  registry.put(result,result);
  return result;
}
Program: 85306
Project: 85306
Buggy source:
private void emitUnits(){
  AbstractInsnNode insn=instructions.getFirst();
  ArrayDeque<LabelNode> labls=new ArrayDeque<LabelNode>();
  while (insn != null) {
    if (insn instanceof LabelNode)     labls.add((LabelNode)insn);
    Unit u=units.get(insn);
    if (u == null) {
      insn=insn.getNext();
      continue;
    }
    emitUnits(u);
    if (insn instanceof LabelNode && u instanceof IdentityStmt && ((IdentityStmt)u).getRightOp() instanceof CaughtExceptionRef) {
      Collection<UnitBox> traps=trapHandlers.get((LabelNode)insn);
      for (      UnitBox ub : traps)       ub.setUnit(u);
    }
    while (!labls.isEmpty()) {
      LabelNode ln=labls.poll();
      Collection<UnitBox> boxes=labels.get(ln);
      if (boxes != null) {
        for (        UnitBox box : boxes) {
          Unit uu=u;
          while (uu instanceof UnitContainer)           uu=((UnitContainer)u).units[0];
          box.setUnit(uu);
        }
      }
    }
    insn=insn.getNext();
  }
  if (labls.isEmpty())   return;
  Unit end=Jimple.v().newNopStmt();
  body.getUnits().add(end);
  while (!labls.isEmpty()) {
    LabelNode ln=labls.poll();
    Collection<UnitBox> boxes=labels.get(ln);
    if (boxes != null) {
      for (      UnitBox box : boxes)       box.setUnit(end);
    }
  }
}

Fixed version (ground truth):
private void emitUnits(){
  AbstractInsnNode insn=instructions.getFirst();
  ArrayDeque<LabelNode> labls=new ArrayDeque<LabelNode>();
  while (insn != null) {
    if (insn instanceof LabelNode)     labls.add((LabelNode)insn);
    Unit u=units.get(insn);
    if (u == null) {
      insn=insn.getNext();
      continue;
    }
    emitUnits(u);
    if (insn instanceof LabelNode && u instanceof IdentityStmt && ((IdentityStmt)u).getRightOp() instanceof CaughtExceptionRef) {
      Collection<UnitBox> traps=trapHandlers.get((LabelNode)insn);
      for (      UnitBox ub : traps)       ub.setUnit(u);
    }
    while (!labls.isEmpty()) {
      LabelNode ln=labls.poll();
      Collection<UnitBox> boxes=labels.get(ln);
      if (boxes != null) {
        for (        UnitBox box : boxes) {
          Unit uu=u;
          while (uu instanceof UnitContainer)           uu=((UnitContainer)uu).units[0];
          box.setUnit(uu);
        }
      }
    }
    insn=insn.getNext();
  }
  if (labls.isEmpty())   return;
  Unit end=Jimple.v().newNopStmt();
  body.getUnits().add(end);
  while (!labls.isEmpty()) {
    LabelNode ln=labls.poll();
    Collection<UnitBox> boxes=labels.get(ln);
    if (boxes != null) {
      for (      UnitBox box : boxes)       box.setUnit(end);
    }
  }
}
Program: 85308
Project: 85308
Buggy source:
/** 
 * Returns a list of superinterfaces of c, excluding itself. 
 */
public List<SootClass> getSuperinterfacesOf(SootClass c){
  c.checkLevel(SootClass.HIERARCHY);
  if (!c.isInterface())   throw new RuntimeException("String_Node_Str");
  checkState();
  if (interfaceToSuperinterfaces.get(c) != null)   return interfaceToSuperinterfaces.get(c);
  List<SootClass> l=new ArrayList<SootClass>();
  for (  SootClass si : interfaceToDirSuperinterfaces.get(c)) {
    l.addAll(getSuperinterfacesOfIncluding(si));
  }
  interfaceToSuperinterfaces.put(c,Collections.unmodifiableList(l));
  return Collections.unmodifiableList(l);
}

Fixed version (ground truth):
/** 
 * Returns a list of superinterfaces of c, excluding itself. 
 */
public List<SootClass> getSuperinterfacesOf(SootClass c){
  c.checkLevel(SootClass.HIERARCHY);
  if (!c.isInterface())   throw new RuntimeException("String_Node_Str");
  checkState();
  List<SootClass> cached=interfaceToSuperinterfaces.get(c);
  if (cached != null)   return cached;
  List<SootClass> l=new ArrayList<SootClass>();
  for (  SootClass si : interfaceToDirSuperinterfaces.get(c)) {
    l.addAll(getSuperinterfacesOfIncluding(si));
  }
  interfaceToSuperinterfaces.put(c,Collections.unmodifiableList(l));
  return Collections.unmodifiableList(l);
}
Program: 85309
Project: 85309
Buggy source:
public void setMainClassFromOptions(){
  if (mainClass != null)   return;
  if (Options.v().main_class() != null && Options.v().main_class().length() > 0) {
    setMainClass(getSootClass(Options.v().main_class()));
  }
 else {
    for (Iterator<String> classIter=Options.v().classes().iterator(); classIter.hasNext(); ) {
      SootClass c=getSootClass(classIter.next());
      if (c.declaresMethod("String_Node_Str",Collections.<Type>singletonList(ArrayType.v(RefType.v("String_Node_Str"),1)),VoidType.v())) {
        G.v().out.println("String_Node_Str" + c.getName() + "String_Node_Str");
        setMainClass(c);
        return;
      }
    }
    for (Iterator<SootClass> classIter=getApplicationClasses().iterator(); classIter.hasNext(); ) {
      SootClass c=(SootClass)classIter.next();
      if (c.declaresMethod("String_Node_Str",Collections.<Type>singletonList(ArrayType.v(RefType.v("String_Node_Str"),1)),VoidType.v())) {
        G.v().out.println("String_Node_Str" + c.getName() + "String_Node_Str");
        setMainClass(c);
        return;
      }
    }
  }
}

Fixed version (ground truth):
public void setMainClassFromOptions(){
  if (mainClass != null)   return;
  if (Options.v().main_class() != null && Options.v().main_class().length() > 0) {
    setMainClass(getSootClass(Options.v().main_class()));
  }
 else {
    for (Iterator<String> classIter=Options.v().classes().iterator(); classIter.hasNext(); ) {
      SootClass c=getSootClass(classIter.next());
      if (c.declaresMethod("String_Node_Str",Collections.<Type>singletonList(ArrayType.v(RefType.v("String_Node_Str"),1)),VoidType.v())) {
        G.v().out.println("String_Node_Str" + c.getName() + "String_Node_Str");
        setMainClass(c);
        return;
      }
    }
    for (Iterator<SootClass> classIter=getApplicationClasses().iterator(); classIter.hasNext(); ) {
      SootClass c=classIter.next();
      if (c.declaresMethod("String_Node_Str",Collections.<Type>singletonList(ArrayType.v(RefType.v("String_Node_Str"),1)),VoidType.v())) {
        G.v().out.println("String_Node_Str" + c.getName() + "String_Node_Str");
        setMainClass(c);
        return;
      }
    }
  }
}
Program: 85310
Project: 85310
Buggy source:
/** 
 * Returns the list of SootClasses that have been resolved at least to  the level specified. 
 */
public List<SootClass> getClasses(int desiredLevel){
  List<SootClass> ret=new ArrayList<SootClass>();
  for (Iterator<SootClass> clIt=getClasses().iterator(); clIt.hasNext(); ) {
    final SootClass cl=(SootClass)clIt.next();
    if (cl.resolvingLevel() >= desiredLevel)     ret.add(cl);
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Returns the list of SootClasses that have been resolved at least to  the level specified. 
 */
public List<SootClass> getClasses(int desiredLevel){
  List<SootClass> ret=new ArrayList<SootClass>();
  for (Iterator<SootClass> clIt=getClasses().iterator(); clIt.hasNext(); ) {
    final SootClass cl=clIt.next();
    if (cl.resolvingLevel() >= desiredLevel)     ret.add(cl);
  }
  return ret;
}
Program: 85311
Project: 85311
Buggy source:
public void loadDynamicClasses(){
  dynamicClasses=new ArrayList<SootClass>();
  HashSet<String> dynClasses=new HashSet<String>();
  dynClasses.addAll(Options.v().dynamic_class());
  for (Iterator<String> pathIt=Options.v().dynamic_dir().iterator(); pathIt.hasNext(); ) {
    final String path=(String)pathIt.next();
    dynClasses.addAll(SourceLocator.v().getClassesUnder(path));
  }
  for (Iterator<String> pkgIt=Options.v().dynamic_package().iterator(); pkgIt.hasNext(); ) {
    final String pkg=(String)pkgIt.next();
    dynClasses.addAll(SourceLocator.v().classesInDynamicPackage(pkg));
  }
  for (  String className : dynClasses) {
    dynamicClasses.add(loadClassAndSupport(className));
  }
  for (Iterator<SootClass> iterator=dynamicClasses.iterator(); iterator.hasNext(); ) {
    SootClass c=iterator.next();
    if (!c.isConcrete()) {
      if (Options.v().verbose()) {
        G.v().out.println("String_Node_Str" + c.getName() + "String_Node_Str");
      }
      iterator.remove();
    }
  }
}

Fixed version (ground truth):
public void loadDynamicClasses(){
  dynamicClasses=new ArrayList<SootClass>();
  HashSet<String> dynClasses=new HashSet<String>();
  dynClasses.addAll(Options.v().dynamic_class());
  for (Iterator<String> pathIt=Options.v().dynamic_dir().iterator(); pathIt.hasNext(); ) {
    final String path=pathIt.next();
    dynClasses.addAll(SourceLocator.v().getClassesUnder(path));
  }
  for (Iterator<String> pkgIt=Options.v().dynamic_package().iterator(); pkgIt.hasNext(); ) {
    final String pkg=pkgIt.next();
    dynClasses.addAll(SourceLocator.v().classesInDynamicPackage(pkg));
  }
  for (  String className : dynClasses) {
    dynamicClasses.add(loadClassAndSupport(className));
  }
  for (Iterator<SootClass> iterator=dynamicClasses.iterator(); iterator.hasNext(); ) {
    SootClass c=iterator.next();
    if (!c.isConcrete()) {
      if (Options.v().verbose()) {
        G.v().out.println("String_Node_Str" + c.getName() + "String_Node_Str");
      }
      iterator.remove();
    }
  }
}
Program: 85313
Project: 85313
Buggy source:
private void setupJAR(){
  if (Options.v().output_jar()) {
    String outFileName=SourceLocator.v().getOutputDir();
    try {
      jarFile=new JarOutputStream(new FileOutputStream(outFileName));
    }
 catch (    IOException e) {
      throw new CompilationDeathException("String_Node_Str" + outFileName);
    }
  }
 else {
    jarFile=null;
  }
}

Fixed version (ground truth):
private void setupJAR(){
  if (Options.v().output_jar()) {
    String outFileName=SourceLocator.v().getOutputJarName();
    try {
      jarFile=new JarOutputStream(new FileOutputStream(outFileName));
    }
 catch (    IOException e) {
      throw new CompilationDeathException("String_Node_Str" + outFileName);
    }
  }
 else {
    jarFile=null;
  }
}
Program: 85314
Project: 85314
Buggy source:
public String getOutputDir(){
  String ret=Options.v().output_dir();
  if (ret.length() == 0) {
    ret="String_Node_Str";
    if (Options.v().output_jar()) {
      ret+=File.separatorChar + "String_Node_Str";
    }
  }
  File dir=new File(ret);
  if (!dir.exists()) {
    try {
      if (!Options.v().output_jar()) {
        dir.mkdirs();
      }
 else {
        dir.getParentFile().mkdirs();
      }
    }
 catch (    SecurityException se) {
      G.v().out.println("String_Node_Str" + ret);
      throw new CompilationDeathException(CompilationDeathException.COMPILATION_ABORTED);
    }
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Returns the output directory given by   {@link Options} or a default if notset. Also ensures that all directories in the path exist.
 * @return the output directory from {@link Options} or a default if not set
 */
public String getOutputDir(){
  File dir;
  if (Options.v().output_dir().length() == 0) {
    dir=new File("String_Node_Str");
  }
 else {
    dir=new File(Options.v().output_dir());
    if (dir.getPath().endsWith("String_Node_Str")) {
      dir=dir.getParentFile();
      if (dir == null) {
        dir=new File("String_Node_Str");
      }
    }
  }
  ensureDirectoryExists(dir);
  return dir.getPath();
}
Program: 85315
Project: 85315
Buggy source:
private String getDavaFilenameFor(SootClass c,StringBuffer b){
  b.append("String_Node_Str");
  b.append(File.separatorChar);
{
    String classPath=b.toString() + "String_Node_Str";
    File dir=new File(classPath);
    if (!dir.exists())     try {
      dir.mkdirs();
    }
 catch (    SecurityException se) {
      G.v().out.println("String_Node_Str" + classPath);
      throw new CompilationDeathException(CompilationDeathException.COMPILATION_ABORTED);
    }
  }
  b.append("String_Node_Str");
  b.append(File.separatorChar);
  String fixedPackageName=c.getJavaPackageName();
  if (fixedPackageName.equals("String_Node_Str") == false) {
    b.append(fixedPackageName.replace('.',File.separatorChar));
    b.append(File.separatorChar);
  }
{
    String path=b.toString();
    File dir=new File(path);
    if (!dir.exists())     try {
      dir.mkdirs();
    }
 catch (    SecurityException se) {
      G.v().out.println("String_Node_Str" + path);
      throw new CompilationDeathException(CompilationDeathException.COMPILATION_ABORTED);
    }
  }
  b.append(c.getShortJavaStyleName());
  b.append("String_Node_Str");
  return b.toString();
}

Fixed version (ground truth):
private String getDavaFilenameFor(SootClass c,StringBuffer b){
  b.append("String_Node_Str");
  b.append(File.separatorChar);
  ensureDirectoryExists(new File(b.toString() + "String_Node_Str"));
  b.append("String_Node_Str");
  b.append(File.separatorChar);
  String fixedPackageName=c.getJavaPackageName();
  if (!fixedPackageName.equals("String_Node_Str")) {
    b.append(fixedPackageName.replace('.',File.separatorChar));
    b.append(File.separatorChar);
  }
  ensureDirectoryExists(new File(b.toString()));
  b.append(c.getShortJavaStyleName());
  b.append("String_Node_Str");
  return b.toString();
}
Program: 85317
Project: 85317
Buggy source:
/** 
 * Returns a list of superinterfaces of c, excluding itself. 
 */
public List<SootClass> getSuperinterfacesOf(SootClass c){
  c.checkLevel(SootClass.HIERARCHY);
  if (!c.isInterface())   throw new RuntimeException("String_Node_Str");
  checkState();
  if (interfaceToSuperinterfaces.get(c) != null)   return interfaceToSuperinterfaces.get(c);
  List<SootClass> l=new ArrayList<SootClass>();
  ListIterator<SootClass> it=interfaceToDirSuperinterfaces.get(c).listIterator();
  while (it.hasNext()) {
    l.addAll(getSuperinterfacesOfIncluding(it.next()));
  }
  interfaceToSuperinterfaces.put(c,Collections.unmodifiableList(l));
  return Collections.unmodifiableList(l);
}

Fixed version (ground truth):
/** 
 * Returns a list of superinterfaces of c, excluding itself. 
 */
public List<SootClass> getSuperinterfacesOf(SootClass c){
  c.checkLevel(SootClass.HIERARCHY);
  if (!c.isInterface())   throw new RuntimeException("String_Node_Str");
  checkState();
  if (interfaceToSuperinterfaces.get(c) != null)   return interfaceToSuperinterfaces.get(c);
  List<SootClass> l=new ArrayList<SootClass>();
  for (  SootClass si : interfaceToDirSuperinterfaces.get(c)) {
    l.addAll(getSuperinterfacesOfIncluding(si));
  }
  interfaceToSuperinterfaces.put(c,Collections.unmodifiableList(l));
  return Collections.unmodifiableList(l);
}
Program: 85318
Project: 85318
Buggy source:
/** 
 * Returns a list of subinterfaces of c, excluding itself. 
 */
public List<SootClass> getSubinterfacesOf(SootClass c){
  c.checkLevel(SootClass.HIERARCHY);
  if (!c.isInterface())   throw new RuntimeException("String_Node_Str");
  checkState();
  if (interfaceToSubinterfaces.get(c) != null)   return interfaceToSubinterfaces.get(c);
  List<SootClass> l=new ArrayList<SootClass>();
  ListIterator<SootClass> it=interfaceToDirSubinterfaces.get(c).listIterator();
  while (it.hasNext()) {
    l.addAll(getSubinterfacesOfIncluding(it.next()));
  }
  interfaceToSubinterfaces.put(c,Collections.unmodifiableList(l));
  return Collections.unmodifiableList(l);
}

Fixed version (ground truth):
/** 
 * Returns a list of subinterfaces of c, excluding itself. 
 */
public List<SootClass> getSubinterfacesOf(SootClass c){
  c.checkLevel(SootClass.HIERARCHY);
  if (!c.isInterface())   throw new RuntimeException("String_Node_Str");
  checkState();
  if (interfaceToSubinterfaces.get(c) != null)   return interfaceToSubinterfaces.get(c);
  List<SootClass> l=new ArrayList<SootClass>();
  for (  SootClass si : interfaceToDirSubinterfaces.get(c)) {
    l.addAll(getSubinterfacesOfIncluding(si));
  }
  interfaceToSubinterfaces.put(c,Collections.unmodifiableList(l));
  return Collections.unmodifiableList(l);
}
Program: 85325
Project: 85325
Buggy source:
/** 
 * All the pointers that we need their points-to information are marked.
 * @param virtualBaseSet
 */
protected void setAllUserCodeVariablesUseful(){
  for (int i=0; i < n_var; ++i) {
    IVarAbstraction pn=int2var.get(i);
    if (pn != pn.getRepresentative())     continue;
    Node node=pn.getWrappedNode();
    int sm_id=geomPTA.getMappedMethodID(pn);
    if (!geomPTA.isReachableMethod(sm_id))     continue;
    if (node instanceof VarNode) {
      boolean defined_in_lib=false;
      if (node instanceof LocalVarNode) {
        defined_in_lib=((LocalVarNode)node).getMethod().isJavaLibraryMethod();
      }
 else       if (node instanceof GlobalVarNode) {
        SootClass sc=((GlobalVarNode)node).getDeclaringClass();
        if (sc != null)         defined_in_lib=sc.isJavaLibraryClass();
      }
      if (!defined_in_lib && !geomPTA.isExceptionPointer(node)) {
        pn.willUpdate=true;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * All the pointers that we need their points-to information are marked.
 * @param virtualBaseSet
 */
protected void setAllUserCodeVariablesUseful(){
  for (int i=0; i < n_var; ++i) {
    IVarAbstraction pn=int2var.get(i);
    if (pn != pn.getRepresentative())     continue;
    Node node=pn.getWrappedNode();
    int sm_id=geomPTA.getMethodIDFromPtr(pn);
    if (!geomPTA.isReachableMethod(sm_id))     continue;
    if (node instanceof VarNode) {
      boolean defined_in_lib=false;
      if (node instanceof LocalVarNode) {
        defined_in_lib=((LocalVarNode)node).getMethod().isJavaLibraryMethod();
      }
 else       if (node instanceof GlobalVarNode) {
        SootClass sc=((GlobalVarNode)node).getDeclaringClass();
        if (sc != null)         defined_in_lib=sc.isJavaLibraryClass();
      }
      if (!defined_in_lib && !geomPTA.isExceptionPointer(node)) {
        pn.willUpdate=true;
      }
    }
  }
}