nus-yam/ex-repair huggingface dataset:
Program: 38356
Project: 38356
Buggy source:
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,final InstanceKey[] receiver){
  Context baseContext=base.getCalleeTarget(caller,site,callee,receiver);
  String calleeFullName=callee.getDeclaringClass().getName().toString();
  String calleeShortName=calleeFullName.substring(calleeFullName.lastIndexOf('/') + 1);
  if (USE_NAME_TO_SELECT_CONTEXT) {
    if (calleeShortName.contains(HACK_METHOD_STR) && receiver.length > index) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
  }
 else   if (receiver.length > index) {
    Frequency f=usesFirstArgAsPropertyName(callee);
    if (f == Frequency.ALWAYS) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
 else     if (receiver[index] != null && (f == Frequency.SOMETIMES || forInOnFirstArg(callee))) {
      return new ForInContext(baseContext,receiver[index]);
    }
  }
  if (USE_CPA_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    return new SelectiveCPAContext(baseContext,receiver);
  }
 else   if (USE_1LEVEL_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    if (!identifyDependentParameters(caller,site).isEmpty()) {
      return oneLevel.getCalleeTarget(caller,site,callee,receiver);
    }
 else {
      return baseContext;
    }
  }
  return baseContext;
}

Fixed version (ground truth):
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,final InstanceKey[] receiver){
  Context baseContext=base.getCalleeTarget(caller,site,callee,receiver);
  String calleeFullName=callee.getDeclaringClass().getName().toString();
  String calleeShortName=calleeFullName.substring(calleeFullName.lastIndexOf('/') + 1);
  if (USE_NAME_TO_SELECT_CONTEXT) {
    if (calleeShortName.contains(HACK_METHOD_STR) && receiver.length > index) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
  }
 else   if (receiver.length > index) {
    Frequency f=usesFirstArgAsPropertyName(callee);
    if (f == Frequency.ALWAYS) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
 else     if (f == Frequency.SOMETIMES || forInOnFirstArg(callee)) {
      if (receiver[index] == null) {
        IClass undef=caller.getClassHierarchy().lookupClass(JavaScriptTypes.Undefined);
        return new ForInContext(baseContext,new ConcreteTypeKey(undef));
      }
 else {
        return new ForInContext(baseContext,receiver[index]);
      }
    }
  }
  if (USE_CPA_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    return new SelectiveCPAContext(baseContext,receiver);
  }
 else   if (USE_1LEVEL_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    if (!identifyDependentParameters(caller,site).isEmpty()) {
      return oneLevel.getCalleeTarget(caller,site,callee,receiver);
    }
 else {
      return baseContext;
    }
  }
  return baseContext;
}
Program: 38358
Project: 38358
Buggy source:
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 * @param node the AST node representing the read
 * @param context
 * @param name
 * @return
 */
protected int doLexicallyScopedRead(CAstNode node,WalkContext context,String name){
  Symbol S=context.currentScope().lookup(name);
  CAstEntity E=S.getDefiningScope().getEntity();
  addExposedName(E,E,name,S.getDefiningScope().lookup(name).valueNumber(),false);
  int vn=S.valueNumber();
  if (useLocalValuesForLexicalVars()) {
    Access A=new Access(name,getEntityName(E),vn);
    addExposedName(context.top(),E,name,vn,false);
    addAccess(context.top(),A);
    return vn;
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,getEntityName(E),result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    return result;
  }
}

Fixed version (ground truth):
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 * @param node the AST node representing the read
 * @param context
 * @param name
 * @return
 */
protected int doLexicallyScopedRead(CAstNode node,WalkContext context,final String name){
  if (name.equals("String_Node_Str")) {
    System.err.println("String_Node_Str");
  }
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),false);
  String entityName=getEntityName(E);
  if (useLocalValuesForLexicalVars()) {
    Scope curScope=context.currentScope();
    while (!curScope.equals(definingScope)) {
      Symbol curSymbol=curScope.lookup(name);
      final int vn=curSymbol.valueNumber();
      Access A=new Access(name,entityName,vn);
      CAstEntity entity=curScope.getEntity();
      addExposedName(entity,E,name,vn,false);
      addAccess(entity,A);
      curScope=curScope.getParent();
    }
    return S.valueNumber();
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,entityName,result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    return result;
  }
}
Program: 38359
Project: 38359
Buggy source:
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,final InstanceKey[] receiver){
  Context baseContext=base.getCalleeTarget(caller,site,callee,receiver);
  if (useForInContext(callee,receiver)) {
    InstanceKey loopVar=receiver[2];
    IClass stringClass=caller.getClassHierarchy().lookupClass(JavaScriptTypes.String);
    if (loopVar instanceof ConstantKey) {
      Object value=((ConstantKey)loopVar).getValue();
      if (value instanceof String) {
        return new ForInContext(baseContext,loopVar);
      }
 else       if (value instanceof Number) {
        Integer ival=((Number)value).intValue();
        return new ForInContext(baseContext,new ConstantKey<String>(ival.toString(),stringClass));
      }
 else       if (value instanceof Boolean) {
        Boolean bval=(Boolean)value;
        return new ForInContext(baseContext,new ConstantKey<String>(bval.toString(),stringClass));
      }
 else       if (value == null) {
        return new ForInContext(baseContext,new ConstantKey<String>("String_Node_Str",stringClass));
      }
    }
    ConcreteTypeKey stringKey=new ConcreteTypeKey(stringClass);
    return new ForInContext(baseContext,stringKey);
  }
 else   if (USE_CPA_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    return new SelectiveCPAContext(baseContext,receiver);
  }
 else   if (USE_1LEVEL_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    if (!identifyDependentParameters(caller,site).isEmpty()) {
      return oneLevel.getCalleeTarget(caller,site,callee,receiver);
    }
 else {
      return baseContext;
    }
  }
 else {
    return baseContext;
  }
}

Fixed version (ground truth):
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,final InstanceKey[] receiver){
  Context baseContext=base.getCalleeTarget(caller,site,callee,receiver);
  String calleeFullName=callee.getDeclaringClass().getName().toString();
  String calleeShortName=calleeFullName.substring(calleeFullName.lastIndexOf('/') + 1);
  if (USE_NAME_TO_SELECT_CONTEXT) {
    if (calleeShortName.contains(HACK_METHOD_STR)) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[2]));
    }
  }
 else   if (receiver.length > 2 && receiver[2] != null) {
    Frequency f=usesFirstArgAsPropertyName(callee);
    if (f == Frequency.ALWAYS) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[2]));
    }
 else     if (f == Frequency.SOMETIMES || forInOnFirstArg(callee)) {
      return new ForInContext(baseContext,receiver[2]);
    }
  }
  if (USE_CPA_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    return new SelectiveCPAContext(baseContext,receiver);
  }
 else   if (USE_1LEVEL_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    if (!identifyDependentParameters(caller,site).isEmpty()) {
      return oneLevel.getCalleeTarget(caller,site,callee,receiver);
    }
 else {
      return baseContext;
    }
  }
  return baseContext;
}
Program: 38360
Project: 38360
Buggy source:
private boolean usesFirstArgAsPropertyName(IMethod method){
  if (method.getNumberOfParameters() < 2)   return false;
  Boolean b=usesFirstArgAsPropertyName_cache.get(method);
  if (b != null)   return b;
  DefUse du=getDefUse(method);
  for (  SSAInstruction use : Iterator2Iterable.make(du.getUses(3))) {
    if (use instanceof ReflectiveMemberAccess) {
      ReflectiveMemberAccess rma=(ReflectiveMemberAccess)use;
      if (rma.getMemberRef() == 3) {
        usesFirstArgAsPropertyName_cache.put(method,true);
        return true;
      }
    }
  }
  usesFirstArgAsPropertyName_cache.put(method,false);
  return false;
}

Fixed version (ground truth):
private Frequency usesFirstArgAsPropertyName(IMethod method){
  if (method.getNumberOfParameters() < 2)   return Frequency.NEVER;
  Frequency f=usesFirstArgAsPropertyName_cache.get(method);
  if (f != null)   return f;
  boolean usedAsPropertyName=false, usedAsSomethingElse=false;
  DefUse du=getDefUse(method);
  for (  SSAInstruction use : Iterator2Iterable.make(du.getUses(3))) {
    if (use instanceof ReflectiveMemberAccess) {
      ReflectiveMemberAccess rma=(ReflectiveMemberAccess)use;
      if (rma.getMemberRef() == 3) {
        usedAsPropertyName=true;
        continue;
      }
    }
    usedAsSomethingElse=true;
  }
  if (!usedAsPropertyName)   f=Frequency.NEVER;
 else   if (usedAsSomethingElse)   f=Frequency.SOMETIMES;
 else   f=Frequency.ALWAYS;
  usesFirstArgAsPropertyName_cache.put(method,f);
  return f;
}
Program: 38361
Project: 38361
Buggy source:
/** 
 * get the CGNode representing the lexical parent of   {@link #creator} withname definer
 * @param definer
 * @return
 */
Iterator<CGNode> getFunargNodes(Pair<String,String> name){
  Iterator<CGNode> result=EmptyIterator.instance();
  LexicalScopingResolver r=(LexicalScopingResolver)creator.getContext().get(LexicalScopingResolverContexts.RESOLVER);
  if (r != null) {
    CGNode def=r.getOriginalDefiner(name);
    if (def != null) {
      result=new NonNullSingletonIterator<CGNode>(def);
    }
  }
  PointerKey funcKey=builder.getPointerKeyForLocal(creator,1);
  OrdinalSet<InstanceKey> funcPtrs=builder.getPointerAnalysis().getPointsToSet(funcKey);
  for (  InstanceKey x : funcPtrs) {
    if (x instanceof ScopeMappingInstanceKey) {
      result=new CompoundIterator<CGNode>(result,((ScopeMappingInstanceKey)x).getFunargNodes(name));
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * get the CGNode representing the lexical parent of   {@link #creator} withname definer
 * @param definer
 * @return
 */
Iterator<CGNode> getFunargNodes(Pair<String,String> name){
  Iterator<CGNode> result=EmptyIterator.instance();
  LexicalScopingResolver r=(LexicalScopingResolver)creator.getContext().get(LexicalScopingResolverContexts.RESOLVER);
  if (r != null) {
    CGNode def=r.getOriginalDefiner(name);
    if (def != null) {
      result=new NonNullSingletonIterator<CGNode>(def);
    }
  }
  ContextItem nested=creator.getContext().get(ScopeMappingKeysContextSelector.scopeKey);
  if (nested != null) {
    result=new CompoundIterator<CGNode>(result,((ScopeMappingInstanceKey)nested).getFunargNodes(name));
  }
  PointerKey funcKey=builder.getPointerKeyForLocal(creator,1);
  OrdinalSet<InstanceKey> funcPtrs=builder.getPointerAnalysis().getPointsToSet(funcKey);
  for (  InstanceKey x : funcPtrs) {
    if (x instanceof ScopeMappingInstanceKey) {
      result=new CompoundIterator<CGNode>(result,((ScopeMappingInstanceKey)x).getFunargNodes(name));
    }
  }
  return result;
}
Program: 38362
Project: 38362
Buggy source:
/** 
 * compute the   {@link CGNode} correspond to each specified{@link LexicalParent} of {@link #base}, populating   {@link #scopeMap}
 */
private ScopeMappingInstanceKey(CGNode creator,InstanceKey base){
  this.creator=creator;
  this.base=base;
}

Fixed version (ground truth):
private ScopeMappingInstanceKey(CGNode creator,InstanceKey base){
  this.creator=creator;
  this.base=base;
}
Program: 38363
Project: 38363
Buggy source:
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 * @param node the AST node representing the read
 * @param context
 * @param name
 * @return
 */
protected int doLexicallyScopedRead(CAstNode node,WalkContext context,final String name){
  if (name.equals("String_Node_Str")) {
    System.err.println("String_Node_Str");
  }
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),false);
  String entityName=getEntityName(E);
  if (useLocalValuesForLexicalVars()) {
    Scope curScope=context.currentScope();
    while (!curScope.equals(definingScope)) {
      Symbol curSymbol=curScope.lookup(name);
      final int vn=curSymbol.valueNumber();
      Access A=new Access(name,entityName,vn);
      CAstEntity entity=curScope.getEntity();
      addExposedName(entity,E,name,vn,false);
      addAccess(entity,A);
      curScope=curScope.getParent();
    }
    return S.valueNumber();
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,entityName,result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    return result;
  }
}

Fixed version (ground truth):
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 * @param node the AST node representing the read
 * @param context
 * @param name
 * @return
 */
protected int doLexicallyScopedRead(CAstNode node,WalkContext context,final String name){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),false);
  final String entityName=getEntityName(E);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,entityName,false);
    return S.valueNumber();
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,entityName,result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    return result;
  }
}
Program: 38364
Project: 38364
Buggy source:
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 */
protected void doLexicallyScopedWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  CAstEntity E=S.getDefiningScope().getEntity();
  addExposedName(E,E,name,S.getDefiningScope().lookup(name).valueNumber(),true);
  if (useLocalValuesForLexicalVars()) {
    int vn=S.valueNumber();
    Access A=new Access(name,getEntityName(E),vn);
    addExposedName(context.top(),E,name,vn,true);
    addAccess(context.top(),A);
    context.cfg().addInstruction(new AssignInstruction(vn,rval));
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
 else {
    Access A=new Access(name,getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
}

Fixed version (ground truth):
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 */
protected void doLexicallyScopedWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),true);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,getEntityName(E),true);
    int vn=S.valueNumber();
    Access A=new Access(name,getEntityName(E),vn);
    context.cfg().addInstruction(new AssignInstruction(vn,rval));
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
 else {
    Access A=new Access(name,getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
}
Program: 38365
Project: 38365
Buggy source:
public void setLexicallyMutatedIR(IR ir){
  lexicalScopingChanges=true;
  cachedIR=ir;
  cachedDU=new DefUse(ir);
}

Fixed version (ground truth):
public void setLexicallyMutatedIR(IR ir){
  lexicalScopingChanges=true;
  cachedIR=ir;
  cachedDU=null;
}
Program: 38366
Project: 38366
Buggy source:
public DefUse getLexicallyMutatedDU(){
  if (lexicalScopingChanges) {
    return cachedDU;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public DefUse getLexicallyMutatedDU(){
  if (lexicalScopingChanges) {
    if (cachedDU == null) {
      cachedDU=new DefUse(cachedIR);
    }
    return cachedDU;
  }
 else {
    return null;
  }
}
Program: 38368
Project: 38368
Buggy source:
public boolean inRead(){
  return false;
}

Fixed version (ground truth):
public boolean inRead(){
  return true;
}
Program: 38369
Project: 38369
Buggy source:
public void setAssign(CAstNode receiverTemp,CAstNode elementTemp){
  Assertions.UNREACHABLE();
}

Fixed version (ground truth):
/** 
 * store the CAstNodes used to represent the loop variable for the prototype-chain traversal (receiverTemp) and the desired property (elementTemp)
 */
public void setAssign(CAstNode receiverTemp,CAstNode elementTemp){
  this.receiverTemp=receiverTemp;
  this.elementTemp=elementTemp;
}
Program: 38370
Project: 38370
Buggy source:
/** 
 * @return the indices i s.t. x[i] == y, or null if none found.
 */
private int[] extractIndices(int[] x,int y){
  int count=0;
  for (int i=0; i < x.length; i++) {
    if (x[i] == y) {
      count++;
    }
  }
  if (count == 0) {
    return null;
  }
 else {
    int[] result=new int[count];
    int j=0;
    for (int i=0; i < x.length; i++) {
      if (x[i] == y) {
        result[j++]=i;
      }
    }
    return result;
  }
}

Fixed version (ground truth):
/** 
 * @return the indices i s.t. x[i] == y, or null if none found.
 */
private int[] extractIndices(int[] x,int y){
}
Program: 38371
Project: 38371
Buggy source:
/** 
 * @param pc a program counter (index into ShrikeBT instruction array)
 * @param vn a value number
 * @return if we know that immediately after the given program counter, v_vn corresponds to some set of locals, then return anarray of the local numbers. else return null.
 */
private int[] findLocalsForValueNumber(int pc,int vn){
  IBasicBlock bb=shrikeCFG.getBlockForInstruction(pc);
  int firstInstruction=bb.getFirstInstructionIndex();
  int[] locals=block2LocalState[bb.getNumber()];
  for (int i=firstInstruction; i <= pc; i++) {
    if (localStoreMap[i] != null) {
      IntPair p=localStoreMap[i];
      setLocal(locals,p.getY(),p.getX());
    }
  }
  return extractIndices(locals,vn);
}

Fixed version (ground truth):
/** 
 * @param pc a program counter (index into ShrikeBT instruction array)
 * @param vn a value number
 * @return if we know that immediately after the given program counter, v_vn corresponds to some set of locals, then return anarray of the local numbers. else return null.
 */
private int[] findLocalsForValueNumber(int pc,int vn){
  if (vn < 0) {
    return null;
  }
  IBasicBlock bb=shrikeCFG.getBlockForInstruction(pc);
  int firstInstruction=bb.getFirstInstructionIndex();
  int[] locals=block2LocalState[bb.getNumber()];
  for (int i=firstInstruction; i <= pc; i++) {
    if (localStoreMap[i] != null) {
      IntPair p=localStoreMap[i];
      locals=setLocal(locals,p.getY(),p.getX());
    }
  }
  return locals == null ? null : extractIndices(locals,vn);
}
Program: 38372
Project: 38372
Buggy source:
private static String composeString(Collection<String> s){
  StringBuffer result=new StringBuffer();
  Iterator<String> it=s.iterator();
  for (int i=0; i < s.size() - 1; i++) {
    result.append(it.next());
    result.append(';');
  }
  if (it.hasNext()) {
    result.append(it.next());
  }
  return result.toString();
}

Fixed version (ground truth):
private static String composeString(Collection<String> s){
  StringBuffer result=new StringBuffer();
  Iterator<String> it=s.iterator();
  for (int i=0; i < s.size() - 1; i++) {
    result.append(it.next());
    result.append(File.pathSeparator);
  }
  if (it.hasNext()) {
    result.append(it.next());
  }
  return result.toString();
}
Program: 38373
Project: 38373
Buggy source:
public void copyState(IVariable v){
  MachineState other=(MachineState)v;
  if (other.stack == null) {
    stack=null;
  }
 else {
    stack=new int[other.stack.length];
    System.arraycopy(other.stack,0,stack,0,other.stack.length);
  }
  if (other.locals == null) {
    locals=null;
  }
 else {
    locals=new int[other.locals.length];
    System.arraycopy(other.locals,0,locals,0,other.locals.length);
  }
  stackHeight=other.stackHeight;
}

Fixed version (ground truth):
public void copyState(MachineState other){
  if (other.stack == null) {
    stack=null;
  }
 else {
    stack=new int[other.stack.length];
    System.arraycopy(other.stack,0,stack,0,other.stack.length);
  }
  if (other.locals == null) {
    locals=null;
  }
 else {
    locals=new int[other.locals.length];
    System.arraycopy(other.locals,0,locals,0,other.locals.length);
  }
  stackHeight=other.stackHeight;
}
Program: 38374
Project: 38374
Buggy source:
/** 
 * @return the state at the entry to a given block
 */
public MachineState getIn(ShrikeCFG.BasicBlock bb){
  return (MachineState)solver.getIn(bb);
}

Fixed version (ground truth):
/** 
 * @return the state at the entry to a given block
 */
public MachineState getIn(ShrikeCFG.BasicBlock bb){
  return solver.getIn(bb);
}
Program: 38375
Project: 38375
Buggy source:
public MachineState getEntryState(){
  return (MachineState)solver.getIn(cfg.entry());
}

Fixed version (ground truth):
public MachineState getEntryState(){
  return solver.getIn(cfg.entry());
}
Program: 38376
Project: 38376
Buggy source:
public nCFABuilder(int n,IClassHierarchy cha,AnalysisOptions options,AnalysisCache cache,ContextSelector appContextSelector,SSAContextInterpreter appContextInterpreter){
  super(cha,options,cache,new DefaultPointerKeyFactory());
  if (options == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  setInstanceKeys(new ClassBasedInstanceKeys(options,cha));
  ContextSelector def=new DefaultContextSelector(options,cha);
  ContextSelector contextSelector=new DelegatingContextSelector(appContextSelector,def);
  contextSelector=new nCFAContextSelector(n,contextSelector);
  setContextSelector(contextSelector);
  SSAContextInterpreter defI=new DefaultSSAInterpreter(options,cache);
  defI=new DelegatingSSAContextInterpreter(ReflectionContextInterpreter.createReflectionContextInterpreter(cha,options,getAnalysisCache()),defI);
  SSAContextInterpreter contextInterpreter=new DelegatingSSAContextInterpreter(appContextInterpreter,defI);
  setContextInterpreter(contextInterpreter);
}

Fixed version (ground truth):
public nCFABuilder(int n,IClassHierarchy cha,AnalysisOptions options,AnalysisCache cache,ContextSelector appContextSelector,SSAContextInterpreter appContextInterpreter){
  super(cha,options,cache,new DefaultPointerKeyFactory());
  if (options == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  setInstanceKeys(new ClassBasedInstanceKeys(options,cha));
  ContextSelector def=new DefaultContextSelector(options,cha);
  ContextSelector contextSelector=appContextSelector == null ? def : new DelegatingContextSelector(appContextSelector,def);
  contextSelector=new nCFAContextSelector(n,contextSelector);
  setContextSelector(contextSelector);
  SSAContextInterpreter defI=new DefaultSSAInterpreter(options,cache);
  defI=new DelegatingSSAContextInterpreter(ReflectionContextInterpreter.createReflectionContextInterpreter(cha,options,getAnalysisCache()),defI);
  SSAContextInterpreter contextInterpreter=appContextInterpreter == null ? defI : new DelegatingSSAContextInterpreter(appContextInterpreter,defI);
  setContextInterpreter(contextInterpreter);
}
Program: 38380
Project: 38380
Buggy source:
protected void visitInvokeInternal(final SSAAbstractInvokeInstruction instruction){
  super.visitInvokeInternal(instruction);
  if (instruction instanceof AbstractLexicalInvoke) {
    AbstractLexicalInvoke I=(AbstractLexicalInvoke)instruction;
    for (int wi=0; wi < I.getNumberOfDefs(); wi++) {
      if (I.isLexicalDef(wi)) {
        Access w=I.getLexicalDef(wi);
        for (int ri=0; ri < I.getNumberOfUses(); ri++) {
          if (I.isLexicalUse(ri)) {
            Access r=I.getLexicalUse(ri);
            if (w.variableName.equals(r.variableName)) {
              if (w.variableDefiner == null ? r.variableDefiner == null : w.variableDefiner.equals(r.variableDefiner)) {
                PointerKey rk=getBuilder().getPointerKeyForLocal(node,r.valueNumber);
                PointerKey wk=getBuilder().getPointerKeyForLocal(node,w.valueNumber);
                system.newConstraint(wk,assignOperator,rk);
              }
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void visitInvokeInternal(final SSAAbstractInvokeInstruction instruction){
  super.visitInvokeInternal(instruction);
  if (instruction instanceof AbstractLexicalInvoke) {
    AbstractLexicalInvoke I=(AbstractLexicalInvoke)instruction;
    for (int wi=0; wi < I.getNumberOfDefs(); wi++) {
      if (I.isLexicalDef(wi)) {
        Access w=I.getLexicalDef(wi);
        for (int ri=0; ri < I.getNumberOfUses(); ri++) {
          if (I.isLexicalUse(ri)) {
            Access r=I.getLexicalUse(ri);
            if (w.variableName.equals(r.variableName)) {
              if (w.variableDefiner == null ? r.variableDefiner == null : w.variableDefiner.equals(r.variableDefiner)) {
                PointerKey rk=getBuilder().getPointerKeyForLocal(node,r.valueNumber);
                PointerKey wk=getBuilder().getPointerKeyForLocal(node,w.valueNumber);
                if (contentsAreInvariant(symbolTable,du,r.valueNumber)) {
                  system.recordImplicitPointsToSet(rk);
                  for (                  InstanceKey ik : getInvariantContents(r.valueNumber)) {
                    system.newConstraint(wk,ik);
                  }
                }
 else {
                  system.newConstraint(wk,assignOperator,rk);
                }
              }
            }
          }
        }
      }
    }
  }
}
Program: 38381
Project: 38381
Buggy source:
private static void getMethodInClassOrSuperclass(IMethodBinding met,ITypeBinding klass,boolean superclassonly,HashMap<ITypeBinding,IMethodBinding> overridden){
  if (!superclassonly) {
    for (    IMethodBinding ourmet : klass.getDeclaredMethods())     if (met.isSubsignature(ourmet) && (met.getModifiers() & Modifier.PRIVATE) == 0) {
      overridden.put(ourmet.getMethodDeclaration().getReturnType(),ourmet.getMethodDeclaration());
      break;
    }
  }
  for (  ITypeBinding iface : klass.getInterfaces())   getMethodInClassOrSuperclass(met,iface,false,overridden);
  ITypeBinding superclass=klass.getSuperclass();
  if (superclass != null)   getMethodInClassOrSuperclass(met,superclass,false,overridden);
}

Fixed version (ground truth):
private static void getMethodInClassOrSuperclass(IMethodBinding met,ITypeBinding klass,boolean superclassonly,HashMap<ITypeBinding,IMethodBinding> overridden){
  if (!superclassonly) {
    for (    IMethodBinding ourmet : klass.getDeclaredMethods())     if (met.overrides(ourmet)) {
      overridden.put(ourmet.getMethodDeclaration().getReturnType(),ourmet.getMethodDeclaration());
      break;
    }
  }
  for (  ITypeBinding iface : klass.getInterfaces())   getMethodInClassOrSuperclass(met,iface,false,overridden);
  ITypeBinding superclass=klass.getSuperclass();
  if (superclass != null)   getMethodInClassOrSuperclass(met,superclass,false,overridden);
}
Program: 38384
Project: 38384
Buggy source:
/** 
 * @param fileName
 * @return the jar file packaged with this plug-in of the given name, or null if not found.
 */
private static JarFileModule getFromPlugin(Plugin p,String fileName) throws IOException {
  URL url=getFileURLFromPlugin(p,fileName);
  return (url == null) ? null : new JarFileModule(new JarFile(filePathFromURL(url)));
}

Fixed version (ground truth):
/** 
 * @param fileName
 * @return the jar file packaged with this plug-in of the given name, or nullif not found.
 */
private static JarFileModule getFromPlugin(Plugin p,String fileName) throws IOException {
  URL url=getFileURLFromPlugin(p,fileName);
  return (url == null) ? null : new JarFileModule(new JarFile(filePathFromURL(url)));
}
Program: 38385
Project: 38385
Buggy source:
/** 
 * Properly creates the String file name of a   {@link URL}. This works around a bug in the Sun implementation of  {@link URL#getFile()}, which doesn't properly handle file paths with spaces (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=1565842&group_id=176742&atid=878458">bug report</a>). For now, fails with an assertion if the url is malformed.
 * @param url
 * @return the path name for the url
 * @throws IllegalArgumentException if url is null
 */
public static String filePathFromURL(URL url){
  if (url == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  URI uri=null;
  try {
    uri=new URI(url.toString());
  }
 catch (  URISyntaxException e) {
    Assertions.UNREACHABLE();
  }
  String filePath=uri.getPath();
  return filePath;
}

Fixed version (ground truth):
/** 
 * Properly creates the String file name of a   {@link URL}. This works around a bug in the Sun implementation of   {@link URL#getFile()}, which doesn't properly handle file paths with spaces (see <a href= "http://sourceforge.net/tracker/index.php?func=detail&aid=1565842&group_id=176742&atid=878458" >bug report</a>). For now, fails with an assertion if the url is malformed.
 * @param url
 * @return the path name for the url
 * @throws IllegalArgumentException if url is null
 */
public static String filePathFromURL(URL url){
  if (url == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  URI uri=new File(url.getPath()).toURI();
  String filePath=uri.getPath();
  return filePath;
}
Program: 38386
Project: 38386
Buggy source:
/** 
 * @param fileName
 * @return the jar file packaged with this plug-in of the given name, or null if not found.
 * @throws IllegalArgumentException if p is null
 */
public static File getFileFromPlugin(Plugin p,String fileName) throws IOException {
  if (p == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  URL url=getFileURLFromPlugin(p,fileName);
  if (url == null) {
    throw new FileNotFoundException(fileName);
  }
  return new File(filePathFromURL(url));
}

Fixed version (ground truth):
/** 
 * @param fileName
 * @return the jar file packaged with this plug-in of the given name, or nullif not found.
 * @throws IllegalArgumentException if p is null
 */
public static File getFileFromPlugin(Plugin p,String fileName) throws IOException {
  if (p == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  URL url=getFileURLFromPlugin(p,fileName);
  if (url == null) {
    throw new FileNotFoundException(fileName);
  }
  return new File(filePathFromURL(url));
}
Program: 38387
Project: 38387
Buggy source:
/** 
 * escape spaces in a URL, primarily to work around a bug in   {@link File#toURL()}
 * @param url
 * @return an escaped version of the URL
 */
private static URL fixupFileURLSpaces(URL url){
  String urlString=url.toExternalForm();
  StringBuffer fixedUpUrl=new StringBuffer();
  int lastIndex=0;
  while (true) {
    int spaceIndex=urlString.indexOf(' ',lastIndex);
    if (spaceIndex < 0) {
      fixedUpUrl.append(urlString.substring(lastIndex));
      break;
    }
    fixedUpUrl.append(urlString.substring(lastIndex,spaceIndex));
    fixedUpUrl.append("String_Node_Str");
    lastIndex=spaceIndex + 1;
  }
  try {
    return new URL(fixedUpUrl.toString());
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
    Assertions.UNREACHABLE();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * escape spaces in a URL, primarily to work around a bug in  {@link File#toURL()}
 * @param url
 * @return an escaped version of the URL
 */
private static URL fixupFileURLSpaces(URL url){
  String urlString=url.toExternalForm();
  StringBuffer fixedUpUrl=new StringBuffer();
  int lastIndex=0;
  while (true) {
    int spaceIndex=urlString.indexOf(' ',lastIndex);
    if (spaceIndex < 0) {
      fixedUpUrl.append(urlString.substring(lastIndex));
      break;
    }
    fixedUpUrl.append(urlString.substring(lastIndex,spaceIndex));
    fixedUpUrl.append("String_Node_Str");
    lastIndex=spaceIndex + 1;
  }
  try {
    return new URL(fixedUpUrl.toString());
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
    Assertions.UNREACHABLE();
  }
  return null;
}
Program: 38388
Project: 38388
Buggy source:
/** 
 * @return the jar file packaged with this plug-in of the given name, or null if not found: wrapped as a JarFileModule or aNestedJarFileModule
 * @throws IOException
 */
public static Module getJarFileFromClassLoader(String fileName,ClassLoader loader) throws IOException {
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (loader == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  URL url=loader.getResource(fileName);
  if (DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + url + "String_Node_Str"+ fileName);
  }
  if (url == null) {
    try {
      return new JarFileModule(new JarFile(fileName,false));
    }
 catch (    ZipException e) {
      throw new IOException("String_Node_Str" + fileName);
    }
  }
  if (url.getProtocol().equals("String_Node_Str")) {
    JarURLConnection jc=(JarURLConnection)url.openConnection();
    JarFile f=jc.getJarFile();
    JarEntry entry=jc.getJarEntry();
    JarFileModule parent=new JarFileModule(f);
    return new NestedJarFileModule(parent,entry);
  }
 else {
    String filePath=filePathFromURL(url);
    return new JarFileModule(new JarFile(filePath,false));
  }
}

Fixed version (ground truth):
/** 
 * @return the jar file packaged with this plug-in of the given name, or nullif not found: wrapped as a JarFileModule or a NestedJarFileModule
 * @throws IOException
 */
public static Module getJarFileFromClassLoader(String fileName,ClassLoader loader) throws IOException {
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (loader == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  URL url=loader.getResource(fileName);
  if (DEBUG_LEVEL > 0) {
    System.err.println("String_Node_Str" + url + "String_Node_Str"+ fileName);
  }
  if (url == null) {
    try {
      return new JarFileModule(new JarFile(fileName,false));
    }
 catch (    ZipException e) {
      throw new IOException("String_Node_Str" + fileName);
    }
  }
  if (url.getProtocol().equals("String_Node_Str")) {
    JarURLConnection jc=(JarURLConnection)url.openConnection();
    JarFile f=jc.getJarFile();
    JarEntry entry=jc.getJarEntry();
    JarFileModule parent=new JarFileModule(f);
    return new NestedJarFileModule(parent,entry);
  }
 else {
    String filePath=filePathFromURL(url);
    return new JarFileModule(new JarFile(filePath,false));
  }
}
Program: 38389
Project: 38389
Buggy source:
@Override protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors){
  JavaSourceAnalysisEngine engine=new JDTJavaSourceAnalysisEngine(){
    protected Iterable<Entrypoint> makeDefaultEntrypoints(    AnalysisScope scope,    IClassHierarchy cha){
      return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE,cha,mainClassDescriptors);
    }
  }
;
  try {
    engine.setExclusionsFile(FileProvider.getFileFromPlugin(CoreTestsPlugin.getDefault(),CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
  }
 catch (  IOException e) {
    Assert.assertFalse("String_Node_Str",true);
  }
  return engine;
}

Fixed version (ground truth):
@Override protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors){
  JavaSourceAnalysisEngine engine=new JDTJavaSourceAnalysisEngine(JDTJavaIRTests.PROJECT_NAME){
    @Override protected Iterable<Entrypoint> makeDefaultEntrypoints(    AnalysisScope scope,    IClassHierarchy cha){
      return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE,cha,mainClassDescriptors);
    }
  }
;
  try {
    engine.setExclusionsFile(FileProvider.getFileFromPlugin(CoreTestsPlugin.getDefault(),CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
  }
 catch (  IOException e) {
    Assert.assertFalse("String_Node_Str",true);
  }
  return engine;
}
Program: 38390
Project: 38390
Buggy source:
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope,IClassHierarchy cha){
  return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE,cha,mainClassDescriptors);
}

Fixed version (ground truth):
@Override protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope,IClassHierarchy cha){
  return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE,cha,mainClassDescriptors);
}
Program: 38391
Project: 38391
Buggy source:
protected void populateScope(JavaSourceAnalysisEngine engine,Collection<String> sources,List<String> libs) throws IOException {
  IDEIRTestUtil.populateScope(projectName,engine,sources,libs);
}

Fixed version (ground truth):
@Override protected void populateScope(JavaSourceAnalysisEngine engine,Collection<String> sources,List<String> libs) throws IOException {
  IDEIRTestUtil.populateScope(projectName,(JDTJavaSourceAnalysisEngine)engine,sources,libs);
}
Program: 38392
Project: 38392
Buggy source:
@Override protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors){
  JavaSourceAnalysisEngine engine=new JDTJavaSourceAnalysisEngine(){
    protected Iterable<Entrypoint> makeDefaultEntrypoints(    AnalysisScope scope,    IClassHierarchy cha){
      return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE,cha,mainClassDescriptors);
    }
  }
;
  try {
    engine.setExclusionsFile(FileProvider.getFileFromPlugin(CoreTestsPlugin.getDefault(),CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
  }
 catch (  IOException e) {
    Assert.assertFalse("String_Node_Str",true);
  }
  return engine;
}

Fixed version (ground truth):
@Override protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors){
  JavaSourceAnalysisEngine engine=new JDTJavaSourceAnalysisEngine(PROJECT_NAME){
    @Override protected Iterable<Entrypoint> makeDefaultEntrypoints(    AnalysisScope scope,    IClassHierarchy cha){
      return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE,cha,mainClassDescriptors);
    }
  }
;
  try {
    engine.setExclusionsFile(FileProvider.getFileFromPlugin(CoreTestsPlugin.getDefault(),CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
  }
 catch (  IOException e) {
    Assert.assertFalse("String_Node_Str",true);
  }
  return engine;
}
Program: 38393
Project: 38393
Buggy source:
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope,IClassHierarchy cha){
  return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE,cha,mainClassDescriptors);
}

Fixed version (ground truth):
@Override protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope,IClassHierarchy cha){
  return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE,cha,mainClassDescriptors);
}
Program: 38394
Project: 38394
Buggy source:
protected void populateScope(JavaSourceAnalysisEngine engine,Collection<String> sources,List<String> libs) throws IOException {
  IDEIRTestUtil.populateScope(projectName,engine,sources,libs);
}

Fixed version (ground truth):
@Override protected void populateScope(JavaSourceAnalysisEngine engine,Collection<String> sources,List<String> libs) throws IOException {
  IDEIRTestUtil.populateScope(projectName,(JDTJavaSourceAnalysisEngine)engine,sources,libs);
}
Program: 38395
Project: 38395
Buggy source:
public static void populateScope(String projectName,JavaSourceAnalysisEngine engine,Collection<String> sources,List<String> libs) throws IOException {
}

Fixed version (ground truth):
public static void populateScope(String projectName,JDTJavaSourceAnalysisEngine engine,Collection<String> sources,List<String> libs) throws IOException {
}
Program: 38396
Project: 38396
Buggy source:
protected IClassLoader makeNewClassLoader(ClassLoaderReference classLoaderReference,IClassHierarchy cha,IClassLoader parent,AnalysisScope scope) throws IOException {
  if (classLoaderReference.equals(JavaSourceAnalysisScope.SOURCE)) {
    ClassLoaderImpl cl=new JDTSourceLoaderImpl(classLoaderReference,parent,getExclusions(),cha);
    cl.init(scope.getModules(classLoaderReference));
    return cl;
  }
 else {
    return super.makeNewClassLoader(classLoaderReference,cha,parent,scope);
  }
}

Fixed version (ground truth):
protected IClassLoader makeNewClassLoader(ClassLoaderReference classLoaderReference,IClassHierarchy cha,IClassLoader parent,AnalysisScope scope) throws IOException {
  if (classLoaderReference.equals(JavaSourceAnalysisScope.SOURCE)) {
    ClassLoaderImpl cl=makeSourceLoader(classLoaderReference,cha,parent);
    cl.init(scope.getModules(classLoaderReference));
    return cl;
  }
 else {
    return super.makeNewClassLoader(classLoaderReference,cha,parent,scope);
  }
}
Program: 38397
Project: 38397
Buggy source:
@SuppressWarnings("String_Node_Str") public void loadAllSources(Set modules){
}

Fixed version (ground truth):
public void loadAllSources(Set modules){
}
Program: 38398
Project: 38398
Buggy source:
protected void loadAllSources(Set<ModuleEntry> modules){
  getTranslator().loadAllSources(modules);
  fTypeMap=null;
}

Fixed version (ground truth):
protected void loadAllSources(Set<ModuleEntry> modules){
  getTranslator().loadAllSources(modules);
}
Program: 38400
Project: 38400
Buggy source:
/** 
 * Build an IR, then check integrity on two flavors of CFG
 */
private void doMethod(String methodSig){
  try {
    AnalysisScope scope=AnalysisScopeReader.makePrimordialScope(FileProvider.getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
    ClassHierarchy cha=ClassHierarchy.make(scope);
    MethodReference mr=StringStuff.makeMethodReference(Language.JAVA,methodSig);
    IMethod m=cha.resolveMethod(mr);
    if (m == null) {
      Assertions.UNREACHABLE("String_Node_Str" + mr);
    }
    AnalysisOptions options=new AnalysisOptions();
    AnalysisCache cache=new AnalysisCache();
    options.getSSAOptions().setPiNodePolicy(SSAOptions.getAllBuiltInPiNodes());
    IR ir=cache.getSSACache().findOrCreateIR(m,Everywhere.EVERYWHERE,options.getSSAOptions());
    ControlFlowGraph<SSAInstruction,ISSABasicBlock> cfg=ir.getControlFlowGraph();
    try {
      GraphIntegrity.check(cfg);
    }
 catch (    UnsoundGraphException e) {
      e.printStackTrace();
      System.err.println(ir);
      Assert.assertTrue("String_Node_Str" + methodSig,false);
    }
    try {
      GraphIntegrity.check(cfg);
    }
 catch (    UnsoundGraphException e) {
      e.printStackTrace();
      System.err.println(ir);
      System.err.println(cfg);
      Assert.assertTrue("String_Node_Str" + methodSig,false);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assertions.UNREACHABLE();
  }
}

Fixed version (ground truth):
/** 
 * Build an IR, then check integrity on two flavors of CFG
 */
private void doMethod(String methodSig){
  try {
    MethodReference mr=StringStuff.makeMethodReference(Language.JAVA,methodSig);
    IMethod m=cha.resolveMethod(mr);
    if (m == null) {
      Assertions.UNREACHABLE("String_Node_Str" + mr);
    }
    AnalysisOptions options=new AnalysisOptions();
    AnalysisCache cache=new AnalysisCache();
    options.getSSAOptions().setPiNodePolicy(SSAOptions.getAllBuiltInPiNodes());
    IR ir=cache.getSSACache().findOrCreateIR(m,Everywhere.EVERYWHERE,options.getSSAOptions());
    ControlFlowGraph<SSAInstruction,ISSABasicBlock> cfg=ir.getControlFlowGraph();
    try {
      GraphIntegrity.check(cfg);
    }
 catch (    UnsoundGraphException e) {
      e.printStackTrace();
      System.err.println(ir);
      Assert.assertTrue("String_Node_Str" + methodSig,false);
    }
    try {
      GraphIntegrity.check(cfg);
    }
 catch (    UnsoundGraphException e) {
      e.printStackTrace();
      System.err.println(ir);
      System.err.println(cfg);
      Assert.assertTrue("String_Node_Str" + methodSig,false);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assertions.UNREACHABLE();
  }
}
Program: 38403
Project: 38403
Buggy source:
/** 
 * Initialize internal data structures
 * @throws IllegalArgumentException if modules is null
 */
public void init(List<Module> modules) throws IOException {
  if (modules == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Set<ModuleEntry> classModuleEntries=HashSetFactory.make();
  Set<ModuleEntry> sourceModuleEntries=HashSetFactory.make();
  for (Iterator<Module> it=modules.iterator(); it.hasNext(); ) {
    Module archive=it.next();
    Set<ModuleEntry> classFiles=getClassFiles(archive);
    if (DEBUG_LEVEL > 0) {
      System.err.println("String_Node_Str" + archive);
    }
    removeClassFiles(classFiles,classModuleEntries);
    for (Iterator<ModuleEntry> it2=classFiles.iterator(); it2.hasNext(); ) {
      ModuleEntry file=it2.next();
      classModuleEntries.add(file);
    }
    Set<ModuleEntry> sourceFiles=getSourceFiles(archive);
    for (Iterator<ModuleEntry> it2=sourceFiles.iterator(); it2.hasNext(); ) {
      ModuleEntry file=it2.next();
      sourceModuleEntries.add(file);
    }
  }
  loadAllClasses(classModuleEntries);
  loadAllSources(sourceModuleEntries);
}

Fixed version (ground truth):
/** 
 * Initialize internal data structures
 * @throws IllegalArgumentException if modules is null
 */
public void init(List<Module> modules) throws IOException {
  if (modules == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Set<ModuleEntry> classModuleEntries=HashSetFactory.make();
  Set<ModuleEntry> sourceModuleEntries=HashSetFactory.make();
  for (Iterator<Module> it=modules.iterator(); it.hasNext(); ) {
    Module archive=it.next();
    if (DEBUG_LEVEL > 0) {
      System.err.println("String_Node_Str" + archive);
    }
    if (OPTIMIZE_JAR_FILE_IO && archive instanceof JarFileModule) {
      getJarFileContents((JarFileModule)archive);
    }
    Set<ModuleEntry> classFiles=getClassFiles(archive);
    removeClassFiles(classFiles,classModuleEntries);
    Set<ModuleEntry> sourceFiles=getSourceFiles(archive);
    Map<String,Object> allClassAndSourceFileContents=null;
    if (OPTIMIZE_JAR_FILE_IO) {
    }
    loadAllClasses(classFiles,allClassAndSourceFileContents);
    loadAllSources(sourceFiles);
    for (Iterator<ModuleEntry> it2=classFiles.iterator(); it2.hasNext(); ) {
      ModuleEntry file=it2.next();
      classModuleEntries.add(file);
    }
    for (Iterator<ModuleEntry> it2=sourceFiles.iterator(); it2.hasNext(); ) {
      ModuleEntry file=it2.next();
      sourceModuleEntries.add(file);
    }
  }
}