nus-yam/ex-repair huggingface dataset:
Program: 88784
Project: 88784
Buggy source:
public void addType(Type t){
  for (Iterator vcsIt=currentvcss.iterator(); vcsIt.hasNext(); ) {
    final VirtualCallSite vcs=(VirtualCallSite)vcsIt.next();
    VirtualCalls.v().resolve(t,vcs.getInstanceInvokeExpr(),vcs.getContainer(),targetsQueue);
    while (true) {
      SootMethod target=(SootMethod)targets.next();
      if (target == null)       break;
      cg.addEdge(new Edge(vcs.getContainer(),vcs.getStmt(),target));
    }
    if (vcs.getInstanceInvokeExpr().getMethod().getNumberedSubSignature() == sigStart) {
      VirtualCalls.v().resolve(t,vcs.getInstanceInvokeExpr(),vcs.getContainer(),targetsQueue);
      while (true) {
        SootMethod target=(SootMethod)targets.next();
        if (target == null)         break;
        cg.addEdge(new Edge(vcs.getContainer(),vcs.getStmt(),target,Edge.THREAD));
      }
    }
  }
}

Fixed version (ground truth):
public void addType(Type t){
  for (Iterator vcsIt=currentvcss.iterator(); vcsIt.hasNext(); ) {
    final VirtualCallSite vcs=(VirtualCallSite)vcsIt.next();
    VirtualCalls.v().resolve(t,vcs.getInstanceInvokeExpr(),vcs.getContainer(),targetsQueue);
    while (true) {
      SootMethod target=(SootMethod)targets.next();
      if (target == null)       break;
      cg.addEdge(new Edge(vcs.getContainer(),vcs.getStmt(),target));
    }
    if (vcs.getInstanceInvokeExpr().getMethod().getNumberedSubSignature() == sigStart) {
      VirtualCalls.v().resolveThread(t,vcs.getInstanceInvokeExpr(),vcs.getContainer(),targetsQueue);
      while (true) {
        SootMethod target=(SootMethod)targets.next();
        if (target == null)         break;
        cg.addEdge(new Edge(vcs.getContainer(),vcs.getStmt(),target,Edge.THREAD));
      }
    }
  }
}
Program: 88786
Project: 88786
Buggy source:
protected final int anyRefInfo(Value r,FlowSet f){
  if (isAlwaysNull(r))   return kNull;
 else   if (isAlwaysTop(r))   return kTop;
 else   return refInfo(r,f);
}

Fixed version (ground truth):
protected final int anyRefInfo(Value r,FlowSet f){
  if (isAlwaysNull(r))   return kNull;
 else   if (isAlwaysTop(r))   return kTop;
 else   if (isAlwaysNonNull(r))   return kNonNull;
 else   return refInfo(r,f);
}
Program: 88787
Project: 88787
Buggy source:
/** 
 * Removes the edge e from the call graph. Returns true iff the edge was originally present in the call graph. 
 */
public boolean removeEdge(Edge e){
  if (!edges.remove(e))   return false;
  e.remove();
  return true;
}

Fixed version (ground truth):
/** 
 * Removes the edge e from the call graph. Returns true iff the edge was originally present in the call graph. 
 */
public boolean removeEdge(Edge e){
  if (!edges.remove(e))   return false;
  e.remove();
  if (srcMethodToEdge.get(e.src()) == e) {
    if (e.nextBySrc().src() == e.src()) {
      srcMethodToEdge.put(e.src(),e.nextBySrc());
    }
 else {
      srcMethodToEdge.put(e.src(),null);
    }
  }
  if (srcUnitToEdge.get(e.srcUnit()) == e) {
    if (e.nextBySrc().srcUnit() == e.srcUnit()) {
      srcUnitToEdge.put(e.srcUnit(),e.nextBySrc());
    }
 else {
      srcUnitToEdge.put(e.srcUnit(),null);
    }
  }
  if (tgtToEdge.get(e.tgt()) == e) {
    if (e.nextByTgt().tgt() == e.tgt()) {
      tgtToEdge.put(e.tgt(),e.nextByTgt());
    }
 else {
      tgtToEdge.put(e.tgt(),null);
    }
  }
  return true;
}
Program: 88788
Project: 88788
Buggy source:
public void run(){
  final String[] cmdFinal=getCmd();
  final PrintStream sootOutFinal=getSootOut();
  try {
    soot.G.v().reset();
    soot.G.v().out=sootOutFinal;
    Class toRun=Class.forName(getMainClass());
    Method[] meths=toRun.getDeclaredMethods();
    Object[] args=new Object[1];
    args[0]=cmdFinal;
    for (int i=0; i < meths.length; i++) {
      if (meths[i].getName().equals("String_Node_Str")) {
        Class[] fields=meths[i].getParameterTypes();
        meths[i].invoke(toRun,args);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace(sootOutFinal);
  }
}

Fixed version (ground truth):
public void run(){
  final String[] cmdFinal=getCmd();
  final PrintStream sootOutFinal=getSootOut();
  try {
    soot.G.v().reset();
    soot.G.v().out=sootOutFinal;
    Class toRun=Class.forName(getMainClass());
    Method[] meths=toRun.getDeclaredMethods();
    Object[] args=new Object[1];
    args[0]=cmdFinal;
    for (int i=0; i < meths.length; i++) {
      if (meths[i].getName().equals("String_Node_Str")) {
        Class[] fields=meths[i].getParameterTypes();
        if (fields.length == 1) {
          meths[i].invoke(toRun,args);
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace(sootOutFinal);
  }
}
Program: 88791
Project: 88791
Buggy source:
public boolean setPhaseOption(String phase,String option){
  return PhaseOptions.v().processPhaseOptions(phase,"String_Node_Str" + option);
}

Fixed version (ground truth):
public boolean setPhaseOption(String phase,String option){
  return PhaseOptions.v().processPhaseOptions(phase,option);
}
Program: 88792
Project: 88792
Buggy source:
private SootMethod resolveNonSpecial(RefType t,InstanceInvokeExpr iie,SootMethod container,NumberedString subSig){
  if (!Scene.v().getOrMakeFastHierarchy().canStoreType(t,iie.getBase().getType())) {
    return null;
  }
  SmallNumberedMap vtbl=(SmallNumberedMap)typeToVtbl.get(t);
  if (vtbl == null) {
    typeToVtbl.put(t,vtbl=new SmallNumberedMap(Scene.v().getMethodNumberer()));
  }
  SootMethod ret=(SootMethod)vtbl.get(subSig);
  if (ret != null)   return ret;
  SootClass cls=((RefType)t).getSootClass();
  if (cls.declaresMethod(subSig)) {
    SootMethod m=cls.getMethod(subSig);
    if (m.isConcrete() || m.isNative()) {
      ret=cls.getMethod(subSig);
    }
  }
 else {
    if (cls.hasSuperclass()) {
      ret=resolveNonSpecial(cls.getSuperclass().getType(),iie,container,subSig);
    }
  }
  vtbl.put(subSig,ret);
  return ret;
}

Fixed version (ground truth):
private SootMethod resolveNonSpecial(RefType t,InstanceInvokeExpr iie,SootMethod container,NumberedString subSig){
  SmallNumberedMap vtbl=(SmallNumberedMap)typeToVtbl.get(t);
  if (vtbl == null) {
    typeToVtbl.put(t,vtbl=new SmallNumberedMap(Scene.v().getMethodNumberer()));
  }
  SootMethod ret=(SootMethod)vtbl.get(subSig);
  if (ret != null)   return ret;
  SootClass cls=((RefType)t).getSootClass();
  if (cls.declaresMethod(subSig)) {
    SootMethod m=cls.getMethod(subSig);
    if (m.isConcrete() || m.isNative()) {
      ret=cls.getMethod(subSig);
    }
  }
 else {
    if (cls.hasSuperclass()) {
      ret=resolveNonSpecial(cls.getSuperclass().getType(),iie,container,subSig);
    }
  }
  vtbl.put(subSig,ret);
  return ret;
}
Program: 88793
Project: 88793
Buggy source:
public Object next(){
  return next();
}

Fixed version (ground truth):
public Object next(){
  return next;
}
Program: 88796
Project: 88796
Buggy source:
/** 
 * @see org.eclipse.ui.IActionDelegate#run(IAction)
 */
public void run(IAction action){
  super.run(action);
  String cmd=getCmd();
  runSootAsProcess(cmd);
  runFinish();
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.ui.IActionDelegate#run(IAction)
 */
public void run(IAction action){
  super.run(action);
  if (isDoNotContinue())   return;
  String cmd=getCmd();
  runSootAsProcess(cmd);
  runFinish();
}
Program: 88797
Project: 88797
Buggy source:
public void run(IAction action){
  super.run(action);
  String cmd=getCmd();
  runSootAsProcess(cmd);
  runFinish();
}

Fixed version (ground truth):
public void run(IAction action){
  super.run(action);
  if (isDoNotContinue())   return;
  String cmd=getCmd();
  runSootAsProcess(cmd);
  runFinish();
}
Program: 88799
Project: 88799
Buggy source:
public void run(IAction action){
  super.run(action);
  setCmd();
  runSootDirectly();
  runFinish();
}

Fixed version (ground truth):
public void run(IAction action){
  super.run(action);
  if (isDoNotContinue())   return;
  setCmd();
  runSootDirectly();
  runFinish();
}
Program: 88800
Project: 88800
Buggy source:
public void run(IAction action){
  super.run(action);
  setCmd();
  runSootDirectly();
  runFinish();
}

Fixed version (ground truth):
public void run(IAction action){
  super.run(action);
  if (isDoNotContinue())   return;
  setCmd();
  runSootDirectly();
  runFinish();
}
Program: 88801
Project: 88801
Buggy source:
protected void runSootDirectly(String mainClass){
  int length=getSootCommandList().getList().size();
  String temp[]=new String[length];
  getSootCommandList().getList().toArray(temp);
  final String[] cmdAsArray=temp;
  for (int i=0; i < temp.length; i++) {
    System.out.println(temp[i]);
  }
  System.out.println("String_Node_Str");
  IRunnableWithProgress op;
  try {
    newProcessStarting();
    op=new SootRunner(temp,Display.getCurrent(),mainClass);
    ModalContext.run(op,true,new NullProgressMonitor(),Display.getCurrent());
  }
 catch (  InvocationTargetException e1) {
    System.out.println("String_Node_Str" + e1.getMessage());
  }
catch (  InterruptedException e2) {
    System.out.println("String_Node_Str" + e2.getMessage());
  }
}

Fixed version (ground truth):
protected void runSootDirectly(String mainClass){
  int length=getSootCommandList().getList().size();
  String temp[]=new String[length];
  getSootCommandList().getList().toArray(temp);
  sendSootOutputEvent(mainClass);
  sendSootOutputEvent("String_Node_Str");
  final String[] cmdAsArray=temp;
  for (int i=0; i < temp.length; i++) {
    System.out.println(temp[i]);
    sendSootOutputEvent(temp[i]);
    sendSootOutputEvent("String_Node_Str");
  }
  sendSootOutputEvent("String_Node_Str");
  System.out.println("String_Node_Str");
  IRunnableWithProgress op;
  try {
    newProcessStarting();
    op=new SootRunner(temp,Display.getCurrent(),mainClass);
    ModalContext.run(op,true,new NullProgressMonitor(),Display.getCurrent());
  }
 catch (  InvocationTargetException e1) {
    System.out.println("String_Node_Str" + e1.getMessage());
  }
catch (  InterruptedException e2) {
    System.out.println("String_Node_Str" + e2.getMessage());
  }
}
Program: 88802
Project: 88802
Buggy source:
public void run(IAction action){
  setSootSelection(new SootSelection(structured));
  getSootSelection().initialize();
  setFileHandler(new SootOutputFilesHandler(window));
  getFileHandler().resetSootOutputFolder(getSootSelection().getProject());
  System.out.println("String_Node_Str");
  setDavaHandler(new DavaHandler());
  getDavaHandler().setSootOutputFolder(getFileHandler().getSootOutputFolder());
  getDavaHandler().handleBefore();
  initPaths();
  initCommandList();
}

Fixed version (ground truth):
public void run(){
  SootPlugin.getDefault().fireSootOutputEvent(sendFinal);
}
Program: 88803
Project: 88803
Buggy source:
public void endValueBox(ValueBox u){
  endOffset=output().length() - lastNewline;
  u.addTag(new PositionTag(((Integer)startOffsets.pop()).intValue(),endOffset));
}

Fixed version (ground truth):
public void endValueBox(ValueBox u){
  endOffset=output().length() - lastNewline;
  if (hasColorTag(u)) {
    u.addTag(new PositionTag(((Integer)startOffsets.pop()).intValue(),endOffset));
  }
}
Program: 88804
Project: 88804
Buggy source:
public void endUnit(Unit u){
  int endStmtOffset=output().length() - lastNewline;
  u.addTag(new JimpleLineNumberTag(startLn,currentLn));
  u.addTag(new PositionTag(startStmtOffset,endStmtOffset));
}

Fixed version (ground truth):
public void endUnit(Unit u){
  int endStmtOffset=output().length() - lastNewline;
  if (hasTag(u)) {
    u.addTag(new JimpleLineNumberTag(startLn,currentLn));
  }
  if (hasColorTag(u)) {
    u.addTag(new PositionTag(startStmtOffset,endStmtOffset));
  }
}
Program: 88805
Project: 88805
Buggy source:
public void printAttrs(SootClass c){
  int java_ln=0;
  int jimple_ln=0;
  Iterator it=c.getMethods().iterator();
  while (it.hasNext()) {
    SootMethod sm=(SootMethod)it.next();
    if (!sm.hasActiveBody()) {
      continue;
    }
    Iterator mTags=sm.getTags().iterator();
    startPrintAttribute();
    while (mTags.hasNext()) {
      Tag t=(Tag)mTags.next();
      printAttributeTag(t);
    }
    endPrintAttribute();
    Body b=sm.getActiveBody();
    Iterator itUnits=b.getUnits().iterator();
    while (itUnits.hasNext()) {
      Unit u=(Unit)itUnits.next();
      Iterator itTags=u.getTags().iterator();
      startPrintAttribute();
      while (itTags.hasNext()) {
        Tag t=(Tag)itTags.next();
        printAttributeTag(t);
      }
      Iterator valBoxIt=u.getUseAndDefBoxes().iterator();
      while (valBoxIt.hasNext()) {
        ValueBox vb=(ValueBox)valBoxIt.next();
        startPrintValBoxAttr();
        Iterator tagsIt=vb.getTags().iterator();
        while (tagsIt.hasNext()) {
          Tag t=(Tag)tagsIt.next();
          printAttributeTag(t);
        }
        endPrintValBoxAttr();
      }
      endPrintAttribute();
    }
  }
  finishFile();
}

Fixed version (ground truth):
public void printAttrs(SootClass c){
  int java_ln=0;
  int jimple_ln=0;
  Iterator it=c.getMethods().iterator();
  while (it.hasNext()) {
    SootMethod sm=(SootMethod)it.next();
    if (!sm.hasActiveBody()) {
      continue;
    }
    if (!sm.getTags().isEmpty()) {
      Iterator mTags=sm.getTags().iterator();
      startPrintAttribute();
      while (mTags.hasNext()) {
        Tag t=(Tag)mTags.next();
        printAttributeTag(t);
      }
      endPrintAttribute();
    }
    Body b=sm.getActiveBody();
    Iterator itUnits=b.getUnits().iterator();
    while (itUnits.hasNext()) {
      Unit u=(Unit)itUnits.next();
      Iterator itTags=u.getTags().iterator();
      startPrintAttribute();
      while (itTags.hasNext()) {
        Tag t=(Tag)itTags.next();
        printAttributeTag(t);
      }
      Iterator valBoxIt=u.getUseAndDefBoxes().iterator();
      while (valBoxIt.hasNext()) {
        ValueBox vb=(ValueBox)valBoxIt.next();
        if (!vb.getTags().isEmpty()) {
          startPrintValBoxAttr();
          Iterator tagsIt=vb.getTags().iterator();
          while (tagsIt.hasNext()) {
            Tag t=(Tag)tagsIt.next();
            printAttributeTag(t);
          }
          endPrintValBoxAttr();
        }
      }
      endPrintAttribute();
    }
  }
  finishFile();
}
Program: 88806
Project: 88806
Buggy source:
/** 
 * Constructs a PatchingChain from the given Chain. 
 */
public PatchingChain(Chain aChain,Body aBody){
  innerChain=aChain;
  body=body;
}

Fixed version (ground truth):
/** 
 * Constructs a PatchingChain from the given Chain. 
 */
public PatchingChain(Chain aChain,Body aBody){
  innerChain=aChain;
  body=aBody;
}
Program: 88807
Project: 88807
Buggy source:
public void findNTRWSets(SootMethod method){
  if (methodToNTReadSet.containsKey(method) && methodToNTWriteSet.containsKey(method))   return;
  MethodRWSet read=new MethodRWSet();
  MethodRWSet write=new MethodRWSet();
  for (Iterator sIt=method.retrieveActiveBody().getUnits().iterator(); sIt.hasNext(); ) {
    final Stmt s=(Stmt)sIt.next();
    if (!s.containsInvokeExpr()) {
      read.union(readSet(method,s));
      write.union(writeSet(method,s));
    }
  }
  methodToNTReadSet.put(method,read);
  methodToNTWriteSet.put(method,write);
  SootClass c=method.getDeclaringClass();
  if (!c.isApplicationClass()) {
    method.releaseActiveBody();
  }
}

Fixed version (ground truth):
public void findNTRWSets(SootMethod method){
  if (methodToNTReadSet.containsKey(method) && methodToNTWriteSet.containsKey(method))   return;
  MethodRWSet read=new MethodRWSet();
  MethodRWSet write=new MethodRWSet();
  for (Iterator sIt=method.retrieveActiveBody().getUnits().iterator(); sIt.hasNext(); ) {
    final Stmt s=(Stmt)sIt.next();
    read.union(ntReadSet(method,s));
    write.union(ntWriteSet(method,s));
  }
  methodToNTReadSet.put(method,read);
  methodToNTWriteSet.put(method,write);
  SootClass c=method.getDeclaringClass();
  if (!c.isApplicationClass()) {
    method.releaseActiveBody();
  }
}
Program: 88808
Project: 88808
Buggy source:
public SideEffectAnalysis(PointsToAnalysis pa,CallGraph cg){
  this.pa=pa;
  this.cg=cg;
}

Fixed version (ground truth):
public SideEffectAnalysis(PointsToAnalysis pa,CallGraph cg){
  this.pa=pa;
  this.cg=cg;
  this.tt=new TransitiveTargets(cg);
}
Program: 88809
Project: 88809
Buggy source:
public RWSet writeSet(SootMethod method,Stmt stmt){
  RWSet ret=null;
  Iterator targets=new Targets(cg.targetsOf(stmt));
  while (targets.hasNext()) {
    SootMethod target=(SootMethod)targets.next();
    if (target.isNative()) {
      if (ret == null)       ret=new SiteRWSet();
      ret.setCallsNative();
    }
 else     if (target.isConcrete()) {
      if (ret == null)       ret=new SiteRWSet();
      ret.union(nonTransitiveWriteSet(target));
    }
  }
  if (stmt instanceof AssignStmt) {
    AssignStmt a=(AssignStmt)stmt;
    Value l=a.getLeftOp();
    ret=addValue(l,method,stmt);
  }
  return ret;
}

Fixed version (ground truth):
public RWSet writeSet(SootMethod method,Stmt stmt){
  RWSet ret=null;
  Iterator targets=tt.iterator(stmt);
  while (targets.hasNext()) {
    SootMethod target=(SootMethod)targets.next();
    if (target.isNative()) {
      if (ret == null)       ret=new SiteRWSet();
      ret.setCallsNative();
    }
 else     if (target.isConcrete()) {
      if (ret == null)       ret=new SiteRWSet();
      ret.union(nonTransitiveWriteSet(target));
    }
  }
  if (ret == null)   return ntWriteSet(method,stmt);
  ret.union(ntWriteSet(method,stmt));
  return ret;
}
Program: 88810
Project: 88810
Buggy source:
public RWSet readSet(SootMethod method,Stmt stmt){
  RWSet ret=null;
  Iterator targets=new Targets(cg.targetsOf(stmt));
  while (targets.hasNext()) {
    SootMethod target=(SootMethod)targets.next();
    if (target.isNative()) {
      if (ret == null)       ret=new SiteRWSet();
      ret.setCallsNative();
    }
 else     if (target.isConcrete()) {
      if (ret == null)       ret=new SiteRWSet();
      ret.union(nonTransitiveReadSet(target));
    }
  }
  if (stmt instanceof AssignStmt) {
    AssignStmt a=(AssignStmt)stmt;
    Value r=a.getRightOp();
    ret=addValue(r,method,stmt);
  }
  return ret;
}

Fixed version (ground truth):
public RWSet readSet(SootMethod method,Stmt stmt){
  RWSet ret=null;
  Iterator targets=tt.iterator(stmt);
  while (targets.hasNext()) {
    SootMethod target=(SootMethod)targets.next();
    if (target.isNative()) {
      if (ret == null)       ret=new SiteRWSet();
      ret.setCallsNative();
    }
 else     if (target.isConcrete()) {
      if (ret == null)       ret=new SiteRWSet();
      ret.union(nonTransitiveReadSet(target));
    }
  }
  if (ret == null)   return ntReadSet(method,stmt);
  ret.union(ntReadSet(method,stmt));
  return ret;
}
Program: 88811
Project: 88811
Buggy source:
public String toString(){
  String[] types={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  return types[type] + "String_Node_Str" + srcUnit+ "String_Node_Str"+ src+ "String_Node_Str"+ tgt;
}

Fixed version (ground truth):
public String toString(){
  return types[type] + "String_Node_Str" + srcUnit+ "String_Node_Str"+ src+ "String_Node_Str"+ tgt;
}
Program: 88813
Project: 88813
Buggy source:
private void processNewMethod(SootMethod m){
  if (m.isNative()) {
    return;
  }
  Body b=m.retrieveActiveBody();
  HashSet receivers=new HashSet();
  getImplicitTargets(m);
  for (Iterator sIt=b.getUnits().iterator(); sIt.hasNext(); ) {
    final Stmt s=(Stmt)sIt.next();
    if (s.containsInvokeExpr()) {
      InvokeExpr ie=(InvokeExpr)s.getInvokeExpr();
      if (ie instanceof InstanceInvokeExpr) {
        VirtualCallSite vcs=new VirtualCallSite(s,m);
        invokeExprToVCS.put(ie,vcs);
        Local receiver=(Local)((InstanceInvokeExpr)ie).getBase();
        HashSet vcss=(HashSet)localToVCS.get(receiver);
        if (vcss == null) {
          localToVCS.put(receiver,vcss=new HashSet());
        }
        vcss.add(vcs);
        receivers.add(receiver);
      }
 else {
        SootMethod tgt=((StaticInvokeExpr)ie).getMethod();
        cg.addEdge(new Edge(m,s,tgt));
      }
    }
  }
  for (Iterator receiverIt=receivers.iterator(); receiverIt.hasNext(); ) {
    final Local receiver=(Local)receiverIt.next();
    Set types=pa.reachingObjects(receiver).possibleTypes();
    HashSet vcss=(HashSet)localToVCS.get(receiver);
    for (Iterator vcsIt=vcss.iterator(); vcsIt.hasNext(); ) {
      final VirtualCallSite vcs=(VirtualCallSite)vcsIt.next();
      for (Iterator tIt=types.iterator(); tIt.hasNext(); ) {
        final Type t=(Type)tIt.next();
        VirtualCalls.v().resolve(t,vcs.getInstanceInvokeExpr(),vcs.getContainer(),targetsQueue);
      }
      while (true) {
        SootMethod target=(SootMethod)targets.next();
        if (target == null)         break;
        cg.addEdge(new Edge(vcs.getContainer(),vcs.getStmt(),target));
      }
      if (vcs.getInstanceInvokeExpr().getMethod().getNumberedSubSignature() == sigStart) {
        for (Iterator tIt=types.iterator(); tIt.hasNext(); ) {
          final Type t=(Type)tIt.next();
          VirtualCalls.v().resolve(t,vcs.getInstanceInvokeExpr(),vcs.getContainer(),targetsQueue);
        }
        while (true) {
          SootMethod target=(SootMethod)targets.next();
          if (target == null)           break;
          cg.addEdge(new Edge(vcs.getContainer(),vcs.getStmt(),target,Edge.THREAD));
        }
      }
    }
  }
}

Fixed version (ground truth):
private void processNewMethod(SootMethod m){
  if (m.isNative()) {
    return;
  }
  Body b=m.retrieveActiveBody();
  HashSet receivers=new HashSet();
  getImplicitTargets(m);
  findReceivers(m,b,receivers);
  processReceivers(receivers);
}
Program: 88814
Project: 88814
Buggy source:
/** 
 * Returns the set of objects reaching variable l before stmt in method. 
 */
public PointsToSet reachingObjects(Local l){
  return FullObjectSet.v();
}

Fixed version (ground truth):
/** 
 * Returns the set of objects reaching variable l before stmt in method. 
 */
public PointsToSet reachingObjects(Local l){
  Type t=l.getType();
  if (t instanceof RefType)   return FullObjectSet.v((RefType)t);
  return FullObjectSet.v();
}
Program: 88815
Project: 88815
Buggy source:
public FullObjectSet(Singletons.Global g){
}

Fixed version (ground truth):
private FullObjectSet(RefType declaredType){
  AnySubType type=AnySubType.v(declaredType);
  types=Collections.singleton(type);
}
Program: 88816
Project: 88816
Buggy source:
public static FullObjectSet v(){
  return G.v().FullObjectSet();
}

Fixed version (ground truth):
public static FullObjectSet v(RefType t){
  if (t.getClassName().equals("String_Node_Str")) {
    return v();
  }
  return new FullObjectSet(t);
}
Program: 88818
Project: 88818
Buggy source:
protected void pushOptions(String s){
  StringTokenizer t=new StringTokenizer(s);
  while (t.hasMoreTokens())   options.addFirst(t.nextToken());
}

Fixed version (ground truth):
protected void pushOptions(String s){
  options.addFirst(s);
}
Program: 88819
Project: 88819
Buggy source:
/** 
 * Associates a value with a key. 
 */
public boolean put(Numberable key,Object value){
  int pos=findPosition(key);
  if (array[pos] == key)   return false;
  size++;
  if (size * 3 > array.length * 2)   doubleSize();
  pos=findPosition(key);
  array[pos]=key;
  values[pos]=value;
  return true;
}

Fixed version (ground truth):
/** 
 * Associates a value with a key. 
 */
public boolean put(Numberable key,Object value){
  int pos=findPosition(key);
  if (array[pos] == key) {
    if (values[pos] == value)     return false;
    values[pos]=value;
    return true;
  }
  size++;
  if (size * 3 > array.length * 2) {
    doubleSize();
    pos=findPosition(key);
  }
  array[pos]=key;
  values[pos]=value;
  return true;
}
Program: 88821
Project: 88821
Buggy source:
public void caseLocal(final Local v){
  ((ConvertToBaf)rvalue).convertToBaf(context,out);
  Unit u=(Unit)out.get(out.size() - 1);
  Iterator it=getTags().iterator();
  while (it.hasNext()) {
    u.addTag((Tag)it.next());
  }
  u=Baf.v().newStoreInst(v.getType(),context.getBafLocalOfJimpleLocal(v));
  out.add(u);
}

Fixed version (ground truth):
public void caseLocal(final Local v){
  ((ConvertToBaf)rvalue).convertToBaf(context,out);
  Unit u=Baf.v().newStoreInst(v.getType(),context.getBafLocalOfJimpleLocal(v));
  Iterator it=getTags().iterator();
  while (it.hasNext()) {
    u.addTag((Tag)it.next());
  }
  out.add(u);
}
Program: 88822
Project: 88822
Buggy source:
private void loadNecessaryClasses(){
  Iterator it=Options.v().classes().iterator();
  while (it.hasNext()) {
    String name=(String)it.next();
    SootClass c;
    c=Scene.v().loadClassAndSupport(name);
    if (mainClass == null) {
      mainClass=c;
      Scene.v().setMainClass(c);
    }
    c.setApplicationClass();
  }
  HashSet dynClasses=new HashSet();
  dynClasses.addAll(Options.v().dynamic_classes());
  for (Iterator pathIt=Options.v().dynamic_path().iterator(); pathIt.hasNext(); ) {
    final String path=(String)pathIt.next();
    dynClasses.addAll(getClassesUnder(path));
  }
  for (Iterator pkgIt=Options.v().dynamic_package().iterator(); pkgIt.hasNext(); ) {
    final String pkg=(String)pkgIt.next();
    dynClasses.addAll(classesInDynamicPackage(pkg));
  }
  while (it.hasNext()) {
    Object o=it.next();
    Scene.v().loadClassAndSupport((String)o);
  }
  for (Iterator pathIt=Options.v().process_path().iterator(); pathIt.hasNext(); ) {
    final String path=(String)pathIt.next();
    for (Iterator clIt=getClassesUnder(path).iterator(); clIt.hasNext(); ) {
      final String cl=(String)clIt.next();
      Scene.v().loadClassAndSupport(cl).setApplicationClass();
    }
  }
}

Fixed version (ground truth):
private void loadNecessaryClasses(){
  Iterator it=Options.v().classes().iterator();
  while (it.hasNext()) {
    String name=(String)it.next();
    SootClass c;
    c=Scene.v().loadClassAndSupport(name);
    if (mainClass == null) {
      mainClass=c;
      Scene.v().setMainClass(c);
    }
    c.setApplicationClass();
  }
  HashSet dynClasses=new HashSet();
  dynClasses.addAll(Options.v().dynamic_classes());
  for (Iterator pathIt=Options.v().dynamic_path().iterator(); pathIt.hasNext(); ) {
    final String path=(String)pathIt.next();
    dynClasses.addAll(getClassesUnder(path));
  }
  for (Iterator pkgIt=Options.v().dynamic_package().iterator(); pkgIt.hasNext(); ) {
    final String pkg=(String)pkgIt.next();
    dynClasses.addAll(classesInDynamicPackage(pkg));
  }
  for (Iterator classNameIt=dynClasses.iterator(); classNameIt.hasNext(); ) {
    final String className=(String)classNameIt.next();
    Scene.v().loadClassAndSupport(className);
  }
  for (Iterator pathIt=Options.v().process_path().iterator(); pathIt.hasNext(); ) {
    final String path=(String)pathIt.next();
    for (Iterator clIt=getClassesUnder(path).iterator(); clIt.hasNext(); ) {
      final String cl=(String)clIt.next();
      Scene.v().loadClassAndSupport(cl).setApplicationClass();
    }
  }
}
Program: 88823
Project: 88823
Buggy source:
protected void internalApply(){
  for (Iterator tIt=this.iterator(); tIt.hasNext(); ) {
    final Transform t=(Transform)tIt.next();
    t.apply();
  }
  LinkedList enableds=new LinkedList();
  for (Iterator tIt=this.iterator(); tIt.hasNext(); ) {
    final Transform t=(Transform)tIt.next();
    Map opts=PackManager.v().getPhaseOptions(t);
    if (PackManager.getBoolean(opts,"String_Node_Str"))     continue;
    enableds.add(t);
  }
  if (enableds.size() == 0) {
    Transform deflt=(Transform)iterator().next();
    PackManager.v().setPhaseOption(deflt.getPhaseName(),"String_Node_Str");
    enableds.add(deflt);
  }
  if (enableds.size() > 1) {
    G.v().out.println("String_Node_Str" + getPhaseName() + "String_Node_Str");
    for (Iterator tIt=enableds.iterator(); tIt.hasNext(); ) {
      final Transform t=(Transform)tIt.next();
      G.v().out.println("String_Node_Str" + t.getPhaseName());
    }
    throw new CompilationDeathException(Main.COMPILATION_ABORTED);
  }
  for (Iterator tIt=enableds.iterator(); tIt.hasNext(); ) {
    final Transform t=(Transform)tIt.next();
    t.apply();
  }
}

Fixed version (ground truth):
protected void internalApply(){
  LinkedList enableds=new LinkedList();
  for (Iterator tIt=this.iterator(); tIt.hasNext(); ) {
    final Transform t=(Transform)tIt.next();
    Map opts=PackManager.v().getPhaseOptions(t);
    if (PackManager.getBoolean(opts,"String_Node_Str"))     continue;
    enableds.add(t);
  }
  if (enableds.size() == 0) {
    Transform deflt=(Transform)iterator().next();
    PackManager.v().setPhaseOption(deflt.getPhaseName(),"String_Node_Str");
    enableds.add(deflt);
  }
  if (enableds.size() > 1) {
    G.v().out.println("String_Node_Str" + getPhaseName() + "String_Node_Str");
    for (Iterator tIt=enableds.iterator(); tIt.hasNext(); ) {
      final Transform t=(Transform)tIt.next();
      G.v().out.println("String_Node_Str" + t.getPhaseName());
    }
    throw new CompilationDeathException(Main.COMPILATION_ABORTED);
  }
  for (Iterator tIt=enableds.iterator(); tIt.hasNext(); ) {
    final Transform t=(Transform)tIt.next();
    t.apply();
  }
}
Program: 88825
Project: 88825
Buggy source:
/** 
 * Decide whether this tag should be aggregated by this aggregator. Return the tag to be attached to this unit, or null if nothing should be attached. 
 */
public Tag wantTag(Tag t,Unit u){
  if (t instanceof DependenceTag)   return t;
  return null;
}

Fixed version (ground truth):
/** 
 * Decide whether this tag should be aggregated by this aggregator. Return the tag to be attached to this unit, or null if nothing should be attached. 
 */
public Tag wantTag(Tag t,Unit u){
  if (tags.size() > 0 && tags.getLast() == t) {
    units.removeLast();
    tags.removeLast();
  }
  if (t instanceof DependenceTag)   return t;
  return null;
}
Program: 88827
Project: 88827
Buggy source:
public int getInMachineCount(){
  return 2;
}

Fixed version (ground truth):
public int getInMachineCount(){
  return 2 * JasminClass.sizeOfType(getOpType());
}
Program: 88828
Project: 88828
Buggy source:
public int getInMachineCount(){
  return 2;
}

Fixed version (ground truth):
public int getInMachineCount(){
  return 2 * JasminClass.sizeOfType(getOpType());
}
Program: 88829
Project: 88829
Buggy source:
public int getInMachineCount(){
  return 2;
}

Fixed version (ground truth):
public int getInMachineCount(){
  return 2 * JasminClass.sizeOfType(getOpType());
}
Program: 88830
Project: 88830
Buggy source:
public int getInMachineCount(){
  return 2;
}

Fixed version (ground truth):
public int getInMachineCount(){
  return 2 * JasminClass.sizeOfType(getOpType());
}
Program: 88831
Project: 88831
Buggy source:
public int getInMachineCount(){
  return 2;
}

Fixed version (ground truth):
public int getInMachineCount(){
  return 2 * JasminClass.sizeOfType(getOpType());
}
Program: 88832
Project: 88832
Buggy source:
public int getInMachineCount(){
  return 2;
}

Fixed version (ground truth):
public int getInMachineCount(){
  return 2 * JasminClass.sizeOfType(getOpType());
}
Program: 88833
Project: 88833
Buggy source:
public MonitorConverter(Singletons.Global g){
  SootClass davaMonitor=Scene.v().loadClassAndSupport("String_Node_Str");
  v=davaMonitor.getMethodByName("String_Node_Str");
  enter=davaMonitor.getMethodByName("String_Node_Str");
  exit=davaMonitor.getMethodByName("String_Node_Str");
}

Fixed version (ground truth):
public MonitorConverter(Singletons.Global g){
  SootClass davaMonitor=new SootClass("String_Node_Str",Modifier.PUBLIC);
  davaMonitor.setSuperclass(Scene.v().loadClassAndSupport("String_Node_Str"));
  LinkedList objectSingleton=new LinkedList();
  objectSingleton.add(RefType.v("String_Node_Str"));
  v=new SootMethod("String_Node_Str",new LinkedList(),RefType.v("String_Node_Str"),Modifier.PUBLIC | Modifier.STATIC);
  enter=new SootMethod("String_Node_Str",objectSingleton,VoidType.v(),Modifier.PUBLIC | Modifier.SYNCHRONIZED);
  exit=new SootMethod("String_Node_Str",objectSingleton,VoidType.v(),Modifier.PUBLIC | Modifier.SYNCHRONIZED);
  davaMonitor.addMethod(v);
  davaMonitor.addMethod(enter);
  davaMonitor.addMethod(exit);
  Scene.v().addClass(davaMonitor);
}
Program: 88834
Project: 88834
Buggy source:
public boolean equivTo(Object o){
  if (o instanceof BafLocal) {
    return name.equals(((BafLocal)o).name) && type.equals(((BafLocal)o).type);
  }
  return false;
}

Fixed version (ground truth):
public boolean equivTo(Object o){
  return this.equals(o);
}
Program: 88835
Project: 88835
Buggy source:
/** 
 * Returns true if the given object is structurally equal to this one. 
 */
public boolean equivTo(Object o){
  if (o instanceof JimpleLocal) {
    return name.equals(((JimpleLocal)o).name) && type.equals(((JimpleLocal)o).type);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns true if the given object is structurally equal to this one. 
 */
public boolean equivTo(Object o){
  return this.equals(o);
}
Program: 88838
Project: 88838
Buggy source:
public void apply(Body b){
  throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
public final void apply(Body b){
  Map options=PackManager.v().getPhaseOptions(this);
  if (PackManager.getBoolean(options,"String_Node_Str"))   return;
  internalApply(b);
}
Program: 88840
Project: 88840
Buggy source:
/** 
 * Entry point to the soot's compilation process. Be sure to call setCmdLineArgs before invoking this method.
 * @see #setCmdLineArgs
 */
public void run(){
  start=new Date();
  try {
    processCmdLine(cmdLineArgs);
    Timers.v().totalTimer.start();
    G.v().out.println("String_Node_Str" + start);
    if (opts.soot_classpath().length() > 0) {
      Scene.v().setSootClassPath(opts.soot_classpath());
    }
    loadNecessaryClasses();
    prepareClasses();
    PackManager.v().getPack("String_Node_Str").apply();
    if (isOptimizingWhole)     PackManager.v().getPack("String_Node_Str").apply();
    PackManager.v().getPack("String_Node_Str").apply();
    preProcessDAVA();
    processClasses();
    postProcessDAVA();
    Timers.v().totalTimer.end();
    if (opts.time())     Timers.v().printProfilingInformation();
  }
 catch (  CompilationDeathException e) {
    Timers.v().totalTimer.end();
    exitCompilation(e.getStatus(),e.getMessage());
    return;
  }
  finish=new Date();
  G.v().out.println("String_Node_Str" + finish);
  long runtime=finish.getTime() - start.getTime();
  G.v().out.println("String_Node_Str" + (runtime / 60000) + "String_Node_Str"+ ((runtime % 60000) / 1000)+ "String_Node_Str");
  exitCompilation(COMPILATION_SUCCEDED);
}

Fixed version (ground truth):
/** 
 * Entry point to the soot's compilation process. Be sure to call setCmdLineArgs before invoking this method.
 * @see #setCmdLineArgs
 */
public void run(){
  start=new Date();
  try {
    Timers.v().totalTimer.start();
    processCmdLine(cmdLineArgs);
    G.v().out.println("String_Node_Str" + start);
    if (opts.soot_classpath().length() > 0) {
      Scene.v().setSootClassPath(opts.soot_classpath());
    }
    loadNecessaryClasses();
    prepareClasses();
    PackManager.v().getPack("String_Node_Str").apply();
    if (isOptimizingWhole)     PackManager.v().getPack("String_Node_Str").apply();
    PackManager.v().getPack("String_Node_Str").apply();
    preProcessDAVA();
    processClasses();
    postProcessDAVA();
    Timers.v().totalTimer.end();
    if (opts.time())     Timers.v().printProfilingInformation();
  }
 catch (  CompilationDeathException e) {
    Timers.v().totalTimer.end();
    exitCompilation(e.getStatus(),e.getMessage());
    return;
  }
  finish=new Date();
  G.v().out.println("String_Node_Str" + finish);
  long runtime=finish.getTime() - start.getTime();
  G.v().out.println("String_Node_Str" + (runtime / 60000) + "String_Node_Str"+ ((runtime % 60000) / 1000)+ "String_Node_Str");
  exitCompilation(COMPILATION_SUCCEDED);
}
Program: 88841
Project: 88841
Buggy source:
/** 
 * Starts the given timer. 
 */
public void start(){
  if (!G.v().Timer_isGarbageCollecting && Main.v().opts.subtract_gc() && ((G.v().Timer_count++ % 4) == 0)) {
    G.v().Timer_isGarbageCollecting=true;
    G.v().Timer_forcedGarbageCollectionTimer.start();
{
      Iterator timerIt=G.v().Timer_outstandingTimers.iterator();
      while (timerIt.hasNext()) {
        Timer t=(Timer)timerIt.next();
        t.end();
      }
    }
    System.gc();
{
      Iterator timerIt=G.v().Timer_outstandingTimers.iterator();
      while (timerIt.hasNext()) {
        Timer t=(Timer)timerIt.next();
        t.start();
      }
    }
    G.v().Timer_forcedGarbageCollectionTimer.end();
    G.v().Timer_isGarbageCollecting=false;
  }
  startTime=System.currentTimeMillis();
  if (hasStarted)   throw new RuntimeException("String_Node_Str" + name + "String_Node_Str");
 else   hasStarted=true;
  if (!G.v().Timer_isGarbageCollecting) {
    G.v().Timer_outstandingTimers.add(this);
  }
}

Fixed version (ground truth):
/** 
 * Starts the given timer. 
 */
public void start(){
  if (!G.v().Timer_isGarbageCollecting && Main.v().opts != null && Main.v().opts.subtract_gc() && ((G.v().Timer_count++ % 4) == 0)) {
    G.v().Timer_isGarbageCollecting=true;
    G.v().Timer_forcedGarbageCollectionTimer.start();
{
      Iterator timerIt=G.v().Timer_outstandingTimers.iterator();
      while (timerIt.hasNext()) {
        Timer t=(Timer)timerIt.next();
        t.end();
      }
    }
    System.gc();
{
      Iterator timerIt=G.v().Timer_outstandingTimers.iterator();
      while (timerIt.hasNext()) {
        Timer t=(Timer)timerIt.next();
        t.start();
      }
    }
    G.v().Timer_forcedGarbageCollectionTimer.end();
    G.v().Timer_isGarbageCollecting=false;
  }
  startTime=System.currentTimeMillis();
  if (hasStarted)   throw new RuntimeException("String_Node_Str" + name + "String_Node_Str");
 else   hasStarted=true;
  if (!G.v().Timer_isGarbageCollecting) {
    G.v().Timer_outstandingTimers.add(this);
  }
}
Program: 88842
Project: 88842
Buggy source:
private void drawAxisX(Graphics g){
  final int arrowSize=3;
  final int overlap=3;
  final int arrowOut=5;
  int x=(int)(chartRect.getMaxX() + overlap + arrowOut);
  int y=(int)chartRect.getMaxY();
  g.setColor(Color.BLACK);
  g.drawLine(x,y,(int)chartRect.getMinX(),y);
  g.drawLine(x,y,x - arrowSize,y - arrowSize);
  g.drawLine(x,y,x - arrowSize,y + arrowSize);
  x=(int)(chartRect.getMaxX() + overlap + arrowSize * 3);
  y=(int)(chartRect.getMaxY() + g.getFontMetrics().getAscent() - 1);
  g.drawString(horzDesc,x,y);
}

Fixed version (ground truth):
private void drawAxisX(Graphics g){
  final int arrowSize=3;
  final int overlap=3;
  final int arrowOut=5;
  int x=(int)(chartRect.getMaxX() + overlap + arrowOut);
  int y=(int)chartRect.getMaxY();
  g.setColor(Color.BLACK);
  g.drawLine(x,y,(int)chartRect.getMinX(),y);
  g.drawLine(x,y,x - arrowSize,y - arrowSize);
  g.drawLine(x,y,x - arrowSize,y + arrowSize);
  if (horzDesc == null)   return;
  x=(int)(chartRect.getMaxX() + overlap + arrowSize * 3);
  y=(int)(chartRect.getMaxY() + g.getFontMetrics().getAscent() - 1);
  g.drawString(horzDesc,x,y);
}
Program: 88843
Project: 88843
Buggy source:
private void drawAxisY(Graphics g){
  final int arrowSize=3;
  final int overlap=3;
  final int arrowOut=5;
  int x=(int)(chartRect.getMinX());
  int y=(int)(chartRect.getMinY() - overlap - arrowOut);
  g.setColor(Color.BLACK);
  g.drawLine(x,y,x,(int)chartRect.getMaxY());
  g.drawLine(x,y,x - arrowSize,y + arrowSize);
  g.drawLine(x,y,x + arrowSize,y + arrowSize);
  Rectangle2D descSize=g.getFontMetrics().getStringBounds(vertDesc,g);
  x=(int)(chartRect.getMinX() - descSize.getWidth() * 0.5);
  y=(int)(chartRect.getMinY() - overlap - arrowOut- 2 * arrowSize);
  g.drawString(vertDesc,x,y);
}

Fixed version (ground truth):
private void drawAxisY(Graphics g){
  final int arrowSize=3;
  final int overlap=3;
  final int arrowOut=5;
  int x=(int)(chartRect.getMinX());
  int y=(int)(chartRect.getMinY() - overlap - arrowOut);
  g.setColor(Color.BLACK);
  g.drawLine(x,y,x,(int)chartRect.getMaxY());
  g.drawLine(x,y,x - arrowSize,y + arrowSize);
  g.drawLine(x,y,x + arrowSize,y + arrowSize);
  if (vertDesc == null)   return;
  Rectangle2D descSize=g.getFontMetrics().getStringBounds(vertDesc,g);
  x=(int)(chartRect.getMinX() - descSize.getWidth() * 0.5);
  y=(int)(chartRect.getMinY() - overlap - arrowOut- 2 * arrowSize);
  g.drawString(vertDesc,x,y);
}
Program: 88844
Project: 88844
Buggy source:
/** 
 * @param pos the x position in screen pixel coordinates
 */
public void setMarker(int pos){
  markerPos=null;
  if (pos < chartRect.x)   return;
  if (pos > chartRect.x + chartRect.width)   return;
  double val=screenXToValueX(pos);
  markerPos=FindIndexOfValueX(val,0);
  repaint();
}

Fixed version (ground truth):
/** 
 * @param pos the x position in screen pixel coordinates
 */
public void setMarker(int pos){
  markerPos=-1;
  if (pos < chartRect.x)   return;
  if (pos > chartRect.x + chartRect.width)   return;
  double val=screenXToValueX(pos);
  markerPos=FindIndexOfValueX(val,0);
  repaint();
}
Program: 88845
Project: 88845
Buggy source:
private void drawMarker(Graphics g){
  if (markerPos == null)   return;
  int overlap=6;
  int yTop=(int)chartRect.getMinY() - overlap;
  int yBot=(int)chartRect.getMaxY() + overlap;
  g.setColor(Color.BLACK);
  List<Point2D> data=series.get(0);
  if (markerPos < data.size()) {
    double value=data.get(markerPos).getX();
    int x=(int)ValueXToScreenX(value);
    g.drawLine(x,yTop,x,yBot);
  }
}

Fixed version (ground truth):
private void drawMarker(Graphics g){
  if (markerPos < 0)   return;
  int overlap=6;
  int yTop=(int)chartRect.getMinY() - overlap;
  int yBot=(int)chartRect.getMaxY() + overlap;
  g.setColor(Color.BLACK);
  List<Point2D> data=series.get(0);
  if (markerPos < data.size()) {
    double value=data.get(markerPos).getX();
    int x=(int)ValueXToScreenX(value);
    g.drawLine(x,yTop,x,yBot);
  }
}
Program: 88846
Project: 88846
Buggy source:
private void drawMarker(Graphics g){
  if (markerPos == null)   return;
  int overlap=6;
  int yTop=(int)chartRect.getMinY() - overlap;
  int yBot=(int)chartRect.getMaxY() + overlap;
  g.setColor(Color.BLACK);
  double value=series.get(0).get(markerPos).getX();
  int x=(int)ValueXToScreenX(value);
  g.drawLine(x,yTop,x,yBot);
}

Fixed version (ground truth):
private void drawMarker(Graphics g){
  if (markerPos == null)   return;
  int overlap=6;
  int yTop=(int)chartRect.getMinY() - overlap;
  int yBot=(int)chartRect.getMaxY() + overlap;
  g.setColor(Color.BLACK);
  List<Point2D> data=series.get(0);
  if (markerPos < data.size()) {
    double value=data.get(markerPos).getX();
    int x=(int)ValueXToScreenX(value);
    g.drawLine(x,yTop,x,yBot);
  }
}
Program: 88847
Project: 88847
Buggy source:
private JTable createTable(final List<Track> tracks){
  TrackTableModel model=new TrackTableModel(tracks);
  JTable table=new JShadedTable(model);
  String[] labels=model.getColumnLabels();
  for (int i=0; i < model.getColumnCount(); i++) {
    table.getColumnModel().getColumn(i).setIdentifier(model.getColumnName(i));
    table.getColumnModel().getColumn(i).setHeaderValue(labels[i]);
  }
  FormatRenderer dateRenderer=new FormatRenderer(SimpleDateFormat.getDateTimeInstance(),SwingConstants.LEFT);
  FormatRenderer distanceRenderer=new FormatRenderer(new DistanceFormat());
  FormatRenderer speedRenderer=new FormatRenderer(new SpeedFormat());
  table.getColumn("String_Node_Str").setCellRenderer(dateRenderer);
  table.getColumn("String_Node_Str").setCellRenderer(distanceRenderer);
  table.getColumn("String_Node_Str").setCellRenderer(speedRenderer);
  TableRowSorter<TableModel> sorter=new TableRowSorter<TableModel>(table.getModel());
  table.setRowSorter(sorter);
  table.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  table.getSelectionModel().addListSelectionListener(new ListMultiSelectionListener(){
    @Override public void valueChanged(    List<Integer> indices){
      List<Track> selTracks=new ArrayList<Track>();
      for (      Integer idx : indices) {
        selTracks.add(tracks.get(idx));
      }
      viewer.showRoute(selTracks);
      trackChart.setTracks(selTracks);
    }
  }
);
  return table;
}

Fixed version (ground truth):
private JTable createTable(final List<Track> tracks){
  TrackTableModel model=new TrackTableModel(tracks);
  final JTable table=new JShadedTable(model);
  String[] labels=model.getColumnLabels();
  for (int i=0; i < model.getColumnCount(); i++) {
    table.getColumnModel().getColumn(i).setIdentifier(model.getColumnName(i));
    table.getColumnModel().getColumn(i).setHeaderValue(labels[i]);
  }
  FormatRenderer dateRenderer=new FormatRenderer(SimpleDateFormat.getDateTimeInstance(),SwingConstants.LEFT);
  FormatRenderer distanceRenderer=new FormatRenderer(new DistanceFormat());
  FormatRenderer timeRenderer=new FormatRenderer(new TimeFormat());
  FormatRenderer speedRenderer=new FormatRenderer(new SpeedFormat());
  table.getColumn("String_Node_Str").setCellRenderer(dateRenderer);
  table.getColumn("String_Node_Str").setCellRenderer(distanceRenderer);
  table.getColumn("String_Node_Str").setCellRenderer(timeRenderer);
  table.getColumn("String_Node_Str").setCellRenderer(speedRenderer);
  TableRowSorter<TableModel> sorter=new TableRowSorter<TableModel>(table.getModel());
  table.setRowSorter(sorter);
  table.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  table.getSelectionModel().addListSelectionListener(new ListMultiSelectionListener(){
    @Override public void valueChanged(    List<Integer> indices){
      List<Track> selTracks=new ArrayList<Track>();
      for (      Integer idx : indices) {
        idx=table.convertRowIndexToModel(idx);
        selTracks.add(tracks.get(idx));
      }
      viewer.showRoute(selTracks);
      trackChart.setTracks(selTracks);
    }
  }
);
  return table;
}
Program: 88848
Project: 88848
Buggy source:
@Override public void valueChanged(List<Integer> indices){
  List<Track> selTracks=new ArrayList<Track>();
  for (  Integer idx : indices) {
    selTracks.add(tracks.get(idx));
  }
  viewer.showRoute(selTracks);
  trackChart.setTracks(selTracks);
}

Fixed version (ground truth):
@Override public void valueChanged(List<Integer> indices){
  List<Track> selTracks=new ArrayList<Track>();
  for (  Integer idx : indices) {
    idx=table.convertRowIndexToModel(idx);
    selTracks.add(tracks.get(idx));
  }
  viewer.showRoute(selTracks);
  trackChart.setTracks(selTracks);
}
Program: 88849
Project: 88849
Buggy source:
private List<Track> readTracks(File folder){
  List<Track> tracks=new ArrayList<Track>();
  String[] files=folder.list(new FilenameFilter(){
    @Override public boolean accept(    File dir,    String name){
      return name.endsWith("String_Node_Str");
    }
  }
);
  TcxAdapter tcxAdapter=null;
  try {
    tcxAdapter=new TcxAdapter();
  }
 catch (  JAXBException e) {
    JOptionPane.showMessageDialog(null,e);
    return tracks;
  }
  for (  String fname : files) {
    FileInputStream fis=null;
    try {
      fis=new FileInputStream(new File(folder,fname));
      List<Track> read=tcxAdapter.read(fis);
      tracks.addAll(read);
      System.out.println("String_Node_Str" + fname);
    }
 catch (    IOException e) {
      JOptionPane.showMessageDialog(null,e);
    }
 finally {
      try {
        if (fis != null)         fis.close();
      }
 catch (      Exception e) {
      }
    }
  }
  for (  Track track : tracks) {
    TrackComputer.repairTrackData(track);
  }
  return tracks;
}

Fixed version (ground truth):
private List<Track> readTracks(File folder){
  List<Track> tracks=new ArrayList<Track>();
  String[] files=folder.list(new FilenameFilter(){
    @Override public boolean accept(    File dir,    String name){
      return name.endsWith("String_Node_Str");
    }
  }
);
  TcxAdapter tcxAdapter=null;
  try {
    tcxAdapter=new TcxAdapter();
  }
 catch (  JAXBException e) {
    JOptionPane.showMessageDialog(null,e);
    return tracks;
  }
  for (  String fname : files) {
    FileInputStream fis=null;
    try {
      fis=new FileInputStream(new File(folder,fname));
      List<Track> read=tcxAdapter.read(fis);
      for (      Track t : read) {
        if (!t.getPoints().isEmpty()) {
          tracks.add(t);
        }
      }
      System.out.println("String_Node_Str" + fname);
    }
 catch (    IOException e) {
      JOptionPane.showMessageDialog(null,e);
    }
 finally {
      try {
        if (fis != null)         fis.close();
      }
 catch (      Exception e) {
      }
    }
  }
  for (  Track track : tracks) {
    TrackComputer.repairTrackData(track);
  }
  return tracks;
}