nus-yam/ex-repair huggingface dataset:
Program: 9460
Project: 9460
Buggy source:
protected Test exposeStateForVar(Var var,TypePattern type,ExposedState state,World world){
  if (type instanceof BindingTypePattern) {
    BindingTypePattern b=(BindingTypePattern)type;
    if (state.get(b.getFormalIndex()) != null) {
      world.getMessageHandler().handleMessage(MessageUtil.error("String_Node_Str" + type.getExactType().toString() + "String_Node_Str",getSourceLocation()));
    }
 else {
      state.set(b.getFormalIndex(),var);
    }
  }
  TypeX myType=type.getExactType();
  return Test.makeInstanceof(var,myType.resolve(world));
}

Fixed version (ground truth):
protected Test exposeStateForVar(Var var,TypePattern type,ExposedState state,World world){
  if (type instanceof BindingTypePattern) {
    BindingTypePattern b=(BindingTypePattern)type;
    state.set(b.getFormalIndex(),var);
  }
  TypeX myType=type.getExactType();
  return Test.makeInstanceof(var,myType.resolve(world));
}
Program: 9461
Project: 9461
Buggy source:
protected Test exposeStateForVar(Var var,TypePattern type,ExposedState state,World world){
  if (type instanceof BindingTypePattern) {
    BindingTypePattern b=(BindingTypePattern)type;
    state.set(b.getFormalIndex(),var);
  }
  TypeX myType=type.getExactType();
  return Test.makeInstanceof(var,myType.resolve(world));
}

Fixed version (ground truth):
protected Test exposeStateForVar(Var var,TypePattern type,ExposedState state,World world){
  if (type instanceof BindingTypePattern) {
    BindingTypePattern b=(BindingTypePattern)type;
    if (state.get(b.getFormalIndex()) != null) {
      world.getMessageHandler().handleMessage(MessageUtil.error("String_Node_Str" + type.getExactType().toString() + "String_Node_Str",getSourceLocation()));
    }
 else {
      state.set(b.getFormalIndex(),var);
    }
  }
  TypeX myType=type.getExactType();
  return Test.makeInstanceof(var,myType.resolve(world));
}
Program: 9464
Project: 9464
Buggy source:
public EclipseTypeMunger build(ClassScope classScope){
  EclipseFactory world=EclipseFactory.fromScopeLookupEnvironment(classScope);
  resolveOnType(classScope);
  if (ignoreFurtherInvestigation)   return null;
  binding=classScope.referenceContext.binding.resolveTypesFor(binding);
  if (binding == null) {
    throw new AbortCompilation();
  }
  ResolvedMember sig=new ResolvedMember(Member.METHOD,EclipseFactory.fromBinding(onTypeBinding),declaredModifiers,EclipseFactory.fromBinding(binding.returnType),new String(declaredSelector),EclipseFactory.fromBindings(binding.parameters),world.fromEclipse(binding.thrownExceptions));
  NewMethodTypeMunger myMunger=new NewMethodTypeMunger(sig,null);
  setMunger(myMunger);
  ResolvedTypeX aspectType=world.fromEclipse(classScope.referenceContext.binding);
  ResolvedMember me=myMunger.getDispatchMethod(aspectType);
  this.selector=binding.selector=me.getName().toCharArray();
  return new EclipseTypeMunger(world,myMunger,aspectType,this);
}

Fixed version (ground truth):
public EclipseTypeMunger build(ClassScope classScope){
  EclipseFactory world=EclipseFactory.fromScopeLookupEnvironment(classScope);
  resolveOnType(classScope);
  if (ignoreFurtherInvestigation)   return null;
  binding=classScope.referenceContext.binding.resolveTypesFor(binding);
  if (binding == null) {
    throw new AbortCompilation(compilationResult);
  }
  ResolvedMember sig=new ResolvedMember(Member.METHOD,EclipseFactory.fromBinding(onTypeBinding),declaredModifiers,EclipseFactory.fromBinding(binding.returnType),new String(declaredSelector),EclipseFactory.fromBindings(binding.parameters),world.fromEclipse(binding.thrownExceptions));
  NewMethodTypeMunger myMunger=new NewMethodTypeMunger(sig,null);
  setMunger(myMunger);
  ResolvedTypeX aspectType=world.fromEclipse(classScope.referenceContext.binding);
  ResolvedMember me=myMunger.getDispatchMethod(aspectType);
  this.selector=binding.selector=me.getName().toCharArray();
  return new EclipseTypeMunger(world,myMunger,aspectType,this);
}
Program: 9465
Project: 9465
Buggy source:
public ISourceLocation getSourceLocation(){
  int sourceLine=getSourceLine();
  if (sourceLine == 0) {
    return getEnclosingClass().getType().getSourceLocation();
  }
 else {
    return getEnclosingClass().getType().getSourceContext().makeSourceLocation(sourceLine);
  }
}

Fixed version (ground truth):
public ISourceLocation getSourceLocation(){
  int sourceLine=getSourceLine();
  if (sourceLine == 0 || sourceLine == -1) {
    return getEnclosingClass().getType().getSourceLocation();
  }
 else {
    return getEnclosingClass().getType().getSourceContext().makeSourceLocation(sourceLine);
  }
}
Program: 9466
Project: 9466
Buggy source:
private List getBinarySourcesFrom(Map binarySourceEntries){
  List ret=new ArrayList();
  for (Iterator binIter=binarySourceEntries.keySet().iterator(); binIter.hasNext(); ) {
    String sourceFileName=(String)binIter.next();
    List unwovenClassFiles=(List)binarySourceEntries.get(sourceFileName);
    CompilationResult result=new CompilationResult(sourceFileName.toCharArray(),0,0,compiler.options.maxProblemsPerUnit);
    result.noSourceAvailable();
    InterimCompilationResult binarySource=new InterimCompilationResult(result,unwovenClassFiles);
    ret.add(binarySource);
  }
  return ret;
}

Fixed version (ground truth):
private List getBinarySourcesFrom(Map binarySourceEntries){
  List ret=new ArrayList();
  for (Iterator binIter=binarySourceEntries.keySet().iterator(); binIter.hasNext(); ) {
    String sourceFileName=(String)binIter.next();
    List unwovenClassFiles=(List)binarySourceEntries.get(sourceFileName);
    CompilationResult result=new CompilationResult(sourceFileName.toCharArray(),0,0,Integer.MAX_VALUE);
    result.noSourceAvailable();
    InterimCompilationResult binarySource=new InterimCompilationResult(result,unwovenClassFiles);
    ret.add(binarySource);
  }
  return ret;
}
Program: 9468
Project: 9468
Buggy source:
private void generateMethod(ClassFile classFile,MethodBinding methodBinding,BodyGenerator gen){
  classFile.generateMethodInfoHeader(methodBinding);
  int methodAttributeOffset=classFile.contentsOffset;
  int attributeNumber=classFile.generateMethodInfoAttribute(methodBinding,AstUtil.getAjSyntheticAttribute());
  int codeAttributeOffset=classFile.contentsOffset;
  classFile.generateCodeAttributeHeader();
  CodeStream codeStream=classFile.codeStream;
  codeStream.init(classFile);
  codeStream.initializeMaxLocals(methodBinding);
  gen.generate(codeStream);
  classFile.completeCodeAttribute(codeAttributeOffset);
  attributeNumber++;
  classFile.completeMethodInfo(methodAttributeOffset,attributeNumber);
}

Fixed version (ground truth):
private void generateMethod(ClassFile classFile,MethodBinding methodBinding,BodyGenerator gen){
  classFile.generateMethodInfoHeader(methodBinding);
  int methodAttributeOffset=classFile.contentsOffset;
  int attributeNumber=classFile.generateMethodInfoAttribute(methodBinding,AstUtil.getAjSyntheticAttribute());
  int codeAttributeOffset=classFile.contentsOffset;
  classFile.generateCodeAttributeHeader();
  CodeStream codeStream=classFile.codeStream;
  MethodDeclaration md=AstUtil.makeMethodDeclaration(methodBinding);
  md.scope=initializerScope;
  codeStream.reset(md,classFile);
  gen.generate(codeStream);
  classFile.completeCodeAttribute(codeAttributeOffset);
  attributeNumber++;
  classFile.completeMethodInfo(methodAttributeOffset,attributeNumber);
}
Program: 9469
Project: 9469
Buggy source:
Collection getModifiedFiles(long lastBuildTime){
  List ret=new ArrayList();
  for (Iterator i=buildConfig.getFiles().iterator(); i.hasNext(); ) {
    File file=(File)i.next();
    if (!file.exists())     continue;
    long modTime=file.lastModified();
    if (modTime >= lastBuildTime) {
      ret.add(file);
    }
  }
  return ret;
}

Fixed version (ground truth):
Collection getModifiedFiles(long lastBuildTime){
  List ret=new ArrayList();
  for (Iterator i=buildConfig.getFiles().iterator(); i.hasNext(); ) {
    File file=(File)i.next();
    if (!file.exists())     continue;
    long modTime=file.lastModified();
    if (modTime + 1000 >= lastBuildTime) {
      ret.add(file);
    }
  }
  return ret;
}
Program: 9470
Project: 9470
Buggy source:
Collection getModifiedBinaryFiles(long lastBuildTime){
  List ret=new ArrayList();
  for (Iterator i=buildConfig.getBinaryFiles().iterator(); i.hasNext(); ) {
    AjBuildConfig.BinarySourceFile bsfile=(AjBuildConfig.BinarySourceFile)i.next();
    File file=bsfile.binSrc;
    if (!file.exists())     continue;
    long modTime=file.lastModified();
    if (modTime >= lastBuildTime) {
      ret.add(bsfile);
    }
  }
  return ret;
}

Fixed version (ground truth):
Collection getModifiedBinaryFiles(long lastBuildTime){
  List ret=new ArrayList();
  for (Iterator i=buildConfig.getBinaryFiles().iterator(); i.hasNext(); ) {
    AjBuildConfig.BinarySourceFile bsfile=(AjBuildConfig.BinarySourceFile)i.next();
    File file=bsfile.binSrc;
    if (!file.exists())     continue;
    long modTime=file.lastModified();
    if (modTime + 1000 >= lastBuildTime) {
      ret.add(bsfile);
    }
  }
  return ret;
}
Program: 9471
Project: 9471
Buggy source:
private List getBinarySourcesFrom(Map binarySourceEntries){
  List ret=new ArrayList();
  for (Iterator binIter=binarySourceEntries.keySet().iterator(); binIter.hasNext(); ) {
    String sourceFileName=(String)binIter.next();
    List unwovenClassFiles=(List)binarySourceEntries.get(sourceFileName);
    CompilationResult result=new CompilationResult(sourceFileName.toCharArray(),0,0,20);
    result.noSourceAvailable();
    InterimCompilationResult binarySource=new InterimCompilationResult(result,unwovenClassFiles);
    ret.add(binarySource);
  }
  return ret;
}

Fixed version (ground truth):
private List getBinarySourcesFrom(Map binarySourceEntries){
  List ret=new ArrayList();
  for (Iterator binIter=binarySourceEntries.keySet().iterator(); binIter.hasNext(); ) {
    String sourceFileName=(String)binIter.next();
    List unwovenClassFiles=(List)binarySourceEntries.get(sourceFileName);
    CompilationResult result=new CompilationResult(sourceFileName.toCharArray(),0,0,compiler.options.maxProblemsPerUnit);
    result.noSourceAvailable();
    InterimCompilationResult binarySource=new InterimCompilationResult(result,unwovenClassFiles);
    ret.add(binarySource);
  }
  return ret;
}
Program: 9472
Project: 9472
Buggy source:
private static String findHandlerParamName(InstructionHandle startOfHandler){
  if (startOfHandler.getInstruction() instanceof StoreInstruction && startOfHandler.getNext() != null) {
    int slot=((StoreInstruction)startOfHandler.getInstruction()).getIndex();
    InstructionTargeter[] targeters=startOfHandler.getNext().getTargeters();
    for (int i=targeters.length - 1; i >= 0; i--) {
      if (targeters[i] instanceof LocalVariableTag) {
        LocalVariableTag t=(LocalVariableTag)targeters[i];
        if (t.getSlot() == slot) {
          return t.getName();
        }
      }
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private static String findHandlerParamName(InstructionHandle startOfHandler){
  if (startOfHandler.getInstruction() instanceof StoreInstruction && startOfHandler.getNext() != null) {
    int slot=((StoreInstruction)startOfHandler.getInstruction()).getIndex();
    InstructionTargeter[] targeters=startOfHandler.getNext().getTargeters();
    if (targeters != null) {
      for (int i=targeters.length - 1; i >= 0; i--) {
        if (targeters[i] instanceof LocalVariableTag) {
          LocalVariableTag t=(LocalVariableTag)targeters[i];
          if (t.getSlot() == slot) {
            return t.getName();
          }
        }
      }
    }
  }
  return "String_Node_Str";
}
Program: 9473
Project: 9473
Buggy source:
public void afterCompiling(){
  try {
    if (isXNoWeave || reportedErrors) {
      notifyRequestor();
    }
 else {
      weave();
    }
  }
 catch (  IOException ex) {
    AbortCompilation ac=new AbortCompilation(null,ex);
    throw ac;
  }
}

Fixed version (ground truth):
public void afterCompiling(){
  try {
    if (isXNoWeave || reportedErrors) {
      notifyRequestor();
    }
 else {
      weave();
    }
  }
 catch (  IOException ex) {
    AbortCompilation ac=new AbortCompilation(null,ex);
    throw ac;
  }
catch (  RuntimeException rEx) {
    if (rEx instanceof AbortCompilation)     throw rEx;
    throw new AbortCompilation(true,rEx);
  }
}
Program: 9474
Project: 9474
Buggy source:
public BcelSourceContext(BcelObjectType inObject){
  this.inObject=inObject;
  sourceFileName=inObject.getJavaClass().getSourceFileName();
  String pname=inObject.getResolvedTypeX().getPackageName();
  if (pname != null) {
    sourceFileName=pname.replace('.','/') + '/' + sourceFileName;
  }
}

Fixed version (ground truth):
public BcelSourceContext(BcelObjectType inObject){
  this.inObject=inObject;
  sourceFileName=inObject.getJavaClass().getSourceFileName();
  if (sourceFileName != null && sourceFileName.equals("String_Node_Str")) {
    sourceFileName="String_Node_Str" + inObject.getResolvedTypeX().getName() + "String_Node_Str";
  }
 else {
    String pname=inObject.getResolvedTypeX().getPackageName();
    if (pname != null) {
      sourceFileName=pname.replace('.','/') + '/' + sourceFileName;
    }
  }
}
Program: 9475
Project: 9475
Buggy source:
public FieldBinding getField(SourceTypeBinding sourceTypeBinding,char[] fieldName,InvocationSite site,Scope scope){
  FieldBinding retField=sourceTypeBinding.getFieldBase(fieldName,false);
  if (interTypeFields.isEmpty())   return retField;
  int fieldLength=fieldName.length;
  for (int i=0, len=interTypeFields.size(); i < len; i++) {
    FieldBinding field=(FieldBinding)interTypeFields.get(i);
    if (field.name.length == fieldLength && CharOperation.prefixEquals(field.name,fieldName)) {
      retField=resolveConflicts(sourceTypeBinding,retField,field,site,scope);
    }
  }
  return retField;
}

Fixed version (ground truth):
public FieldBinding getField(SourceTypeBinding sourceTypeBinding,char[] fieldName,InvocationSite site,Scope scope){
  FieldBinding retField=sourceTypeBinding.getFieldBase(fieldName,true);
  if (interTypeFields.isEmpty())   return retField;
  int fieldLength=fieldName.length;
  for (int i=0, len=interTypeFields.size(); i < len; i++) {
    FieldBinding field=(FieldBinding)interTypeFields.get(i);
    if (field.name.length == fieldLength && CharOperation.prefixEquals(field.name,fieldName)) {
      retField=resolveConflicts(sourceTypeBinding,retField,field,site,scope);
    }
  }
  return retField;
}
Program: 9476
Project: 9476
Buggy source:
public static void makeTestJars() throws IOException {
  List args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
}

Fixed version (ground truth):
public static void makeTestJars() throws IOException {
  List args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
}
Program: 9478
Project: 9478
Buggy source:
/** 
 * Returns false if a batch build is needed.
 */
boolean prepareForNextBuild(AjBuildConfig newBuildConfig){
  currentBuildTime=System.currentTimeMillis();
  addedClassFiles=new ArrayList();
  if (lastSuccessfulBuildTime == -1 || buildConfig == null) {
    return false;
  }
  simpleStrings=new ArrayList();
  qualifiedStrings=new ArrayList();
  Set oldFiles=new HashSet(buildConfig.getFiles());
  Set newFiles=new HashSet(newBuildConfig.getFiles());
  addedFiles=new HashSet(newFiles);
  addedFiles.removeAll(oldFiles);
  deletedFiles=new HashSet(oldFiles);
  deletedFiles.removeAll(newFiles);
  this.newBuildConfig=newBuildConfig;
  return true;
}

Fixed version (ground truth):
/** 
 * Returns false if a batch build is needed.
 */
boolean prepareForNextBuild(AjBuildConfig newBuildConfig){
  currentBuildTime=System.currentTimeMillis();
  addedClassFiles=new ArrayList();
  if (lastSuccessfulBuildTime == -1 || buildConfig == null) {
    return false;
  }
  if (newBuildConfig.getOutputJar() != null)   return false;
  simpleStrings=new ArrayList();
  qualifiedStrings=new ArrayList();
  Set oldFiles=new HashSet(buildConfig.getFiles());
  Set newFiles=new HashSet(newBuildConfig.getFiles());
  addedFiles=new HashSet(newFiles);
  addedFiles.removeAll(oldFiles);
  deletedFiles=new HashSet(oldFiles);
  deletedFiles.removeAll(newFiles);
  this.newBuildConfig=newBuildConfig;
  return true;
}
Program: 9479
Project: 9479
Buggy source:
private void copyResourcesToDestination() throws IOException {
  if (buildConfig.getOutputJar() != null) {
    bcelWeaver.dumpResourcesToOutJar(zos);
  }
 else {
    bcelWeaver.dumpResourcesToOutPath();
  }
}

Fixed version (ground truth):
private void copyResourcesToDestination() throws IOException {
  for (Iterator i=buildConfig.getInJars().iterator(); i.hasNext(); ) {
    File inJar=(File)i.next();
    copyResourcesFromJarFile(inJar);
  }
  for (Iterator i=buildConfig.getInpath().iterator(); i.hasNext(); ) {
    File inPathElement=(File)i.next();
    if (inPathElement.isDirectory()) {
      copyResourcesFromDirectory(inPathElement);
    }
 else {
      copyResourcesFromJarFile(inPathElement);
    }
  }
  if (buildConfig.getSourcePathResources() != null) {
    for (Iterator i=buildConfig.getSourcePathResources().keySet().iterator(); i.hasNext(); ) {
      String resource=(String)i.next();
      copyResourcesFromFile((File)buildConfig.getSourcePathResources().get(resource),resource);
    }
  }
}
Program: 9480
Project: 9480
Buggy source:
private void closeOutputStream(){
  try {
    if (zos != null)     zos.close();
  }
 catch (  IOException ex) {
    IMessage message=new Message("String_Node_Str" + buildConfig.getOutputJar().getPath() + "String_Node_Str"+ ex.getMessage()+ "String_Node_Str",new SourceLocation(buildConfig.getOutputJar(),0),true);
    handler.handleMessage(message);
  }
}

Fixed version (ground truth):
private void closeOutputStream(){
  try {
    if (zos != null)     zos.close();
    zos=null;
  }
 catch (  IOException ex) {
    IMessage message=new Message("String_Node_Str" + buildConfig.getOutputJar().getPath() + "String_Node_Str"+ ex.getMessage()+ "String_Node_Str",new SourceLocation(buildConfig.getOutputJar(),0),true);
    handler.handleMessage(message);
  }
}
Program: 9482
Project: 9482
Buggy source:
public List getFilesToCompile(boolean firstPass){
  List thisTime=new ArrayList();
  if (firstPass) {
    compiledSourceFiles=new ArrayList();
    Collection modifiedFiles=getModifiedFiles();
    thisTime.addAll(modifiedFiles);
    thisTime.addAll(addedFiles);
    deleteClassFiles();
    addAffectedSourceFiles(thisTime,thisTime);
  }
 else {
    addAffectedSourceFiles(thisTime,compiledSourceFiles);
  }
  compiledSourceFiles=thisTime;
  return thisTime;
}

Fixed version (ground truth):
public List getFilesToCompile(boolean firstPass){
  List thisTime=new ArrayList();
  if (firstPass) {
    compiledSourceFiles=new ArrayList();
    Collection modifiedFiles=getModifiedFiles();
    thisTime.addAll(modifiedFiles);
    thisTime.addAll(addedFiles);
    deleteClassFiles();
    deleteResources();
    addAffectedSourceFiles(thisTime,thisTime);
  }
 else {
    addAffectedSourceFiles(thisTime,compiledSourceFiles);
  }
  compiledSourceFiles=thisTime;
  return thisTime;
}
Program: 9484
Project: 9484
Buggy source:
public EclipseTypeMunger build(ClassScope classScope){
  EclipseFactory world=EclipseFactory.fromScopeLookupEnvironment(classScope);
  resolveOnType(classScope);
  if (ignoreFurtherInvestigation)   return null;
  binding=classScope.referenceContext.binding.resolveTypesFor(binding);
  ResolvedMember sig=new ResolvedMember(Member.METHOD,EclipseFactory.fromBinding(onTypeBinding),declaredModifiers,EclipseFactory.fromBinding(binding.returnType),new String(declaredSelector),EclipseFactory.fromBindings(binding.parameters),world.fromEclipse(binding.thrownExceptions));
  NewMethodTypeMunger myMunger=new NewMethodTypeMunger(sig,null);
  setMunger(myMunger);
  ResolvedTypeX aspectType=world.fromEclipse(classScope.referenceContext.binding);
  ResolvedMember me=myMunger.getDispatchMethod(aspectType);
  this.selector=binding.selector=me.getName().toCharArray();
  return new EclipseTypeMunger(world,myMunger,aspectType,this);
}

Fixed version (ground truth):
public EclipseTypeMunger build(ClassScope classScope){
  EclipseFactory world=EclipseFactory.fromScopeLookupEnvironment(classScope);
  resolveOnType(classScope);
  if (ignoreFurtherInvestigation)   return null;
  binding=classScope.referenceContext.binding.resolveTypesFor(binding);
  if (binding == null) {
    throw new AbortCompilation();
  }
  ResolvedMember sig=new ResolvedMember(Member.METHOD,EclipseFactory.fromBinding(onTypeBinding),declaredModifiers,EclipseFactory.fromBinding(binding.returnType),new String(declaredSelector),EclipseFactory.fromBindings(binding.parameters),world.fromEclipse(binding.thrownExceptions));
  NewMethodTypeMunger myMunger=new NewMethodTypeMunger(sig,null);
  setMunger(myMunger);
  ResolvedTypeX aspectType=world.fromEclipse(classScope.referenceContext.binding);
  ResolvedMember me=myMunger.getDispatchMethod(aspectType);
  this.selector=binding.selector=me.getName().toCharArray();
  return new EclipseTypeMunger(world,myMunger,aspectType,this);
}
Program: 9488
Project: 9488
Buggy source:
private void weave() throws IOException {
  for (Iterator iter=resultsPendingWeave.iterator(); iter.hasNext(); ) {
    InterimCompilationResult iresult=(InterimCompilationResult)iter.next();
    for (int i=0; i < iresult.unwovenClassFiles().length; i++) {
      weaver.addClassFile(iresult.unwovenClassFiles()[i]);
    }
  }
  weaver.prepareForWeave();
  if (isBatchCompile) {
    resultsPendingWeave.addAll(binarySources);
  }
 else   if (weaver.needToReweaveWorld()) {
    addAllKnownClassesToWeaveList();
  }
  weaver.weave(new WeaverAdapter(this,weaverMessageHandler,progressListener));
}

Fixed version (ground truth):
private void weave() throws IOException {
  for (Iterator iter=resultsPendingWeave.iterator(); iter.hasNext(); ) {
    InterimCompilationResult iresult=(InterimCompilationResult)iter.next();
    for (int i=0; i < iresult.unwovenClassFiles().length; i++) {
      weaver.addClassFile(iresult.unwovenClassFiles()[i]);
    }
  }
  weaver.prepareForWeave();
  if (weaver.needToReweaveWorld()) {
    if (!isBatchCompile)     addAllKnownClassesToWeaveList();
    resultsPendingWeave.addAll(getBinarySourcesFrom(binarySourceSetForFullWeave));
  }
 else {
    Map binarySourcesToAdd=binarySourceProvider.getBinarySourcesForThisWeave();
    resultsPendingWeave.addAll(getBinarySourcesFrom(binarySourcesToAdd));
  }
  weaver.weave(new WeaverAdapter(this,weaverMessageHandler,progressListener));
}
Program: 9489
Project: 9489
Buggy source:
public void setInPath(List dirsOrJars){
  inPath=dirsOrJars;
}

Fixed version (ground truth):
public void setInPath(List dirsOrJars){
  inPath=dirsOrJars;
  binaryFiles=new ArrayList();
  FileFilter filter=new FileFilter(){
    public boolean accept(    File pathname){
      return pathname.getPath().endsWith("String_Node_Str");
    }
  }
;
  for (Iterator iter=dirsOrJars.iterator(); iter.hasNext(); ) {
    File inpathElement=(File)iter.next();
    if (inpathElement.isDirectory()) {
      File[] files=FileUtil.listFiles(inpathElement,filter);
      for (int i=0; i < files.length; i++) {
        binaryFiles.add(new BinarySourceFile(inpathElement,files[i]));
      }
    }
  }
}
Program: 9491
Project: 9491
Buggy source:
public ICompilerAdapter getAdapter(org.eclipse.jdt.internal.compiler.Compiler forCompiler){
  AjProblemReporter pr=new AjProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),forCompiler.options,getProblemFactory());
  forCompiler.problemReporter=pr;
  AjLookupEnvironment le=new AjLookupEnvironment(forCompiler,forCompiler.options,pr,environment);
  EclipseFactory factory=new EclipseFactory(le);
  le.factory=factory;
  pr.factory=factory;
  le.factory.buildManager=this;
  forCompiler.lookupEnvironment=le;
  forCompiler.parser=new Parser(pr,forCompiler.options.parseLiteralExpressionsAsConstants);
  return new AjCompilerAdapter(forCompiler,batchCompile,bcelWorld,bcelWeaver,factory,getInterimResultRequestor(),progressListener,this,state.binarySourceFiles,state.resultsFromFile.values(),buildConfig.isNoWeave());
}

Fixed version (ground truth):
public ICompilerAdapter getAdapter(org.eclipse.jdt.internal.compiler.Compiler forCompiler){
  AjProblemReporter pr=new AjProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),forCompiler.options,getProblemFactory());
  forCompiler.problemReporter=pr;
  AjLookupEnvironment le=new AjLookupEnvironment(forCompiler,forCompiler.options,pr,environment);
  EclipseFactory factory=new EclipseFactory(le);
  le.factory=factory;
  pr.factory=factory;
  le.factory.buildManager=this;
  forCompiler.lookupEnvironment=le;
  forCompiler.parser=new Parser(pr,forCompiler.options.parseLiteralExpressionsAsConstants);
  return new AjCompilerAdapter(forCompiler,batchCompile,bcelWorld,bcelWeaver,factory,getInterimResultRequestor(),progressListener,this,this,state.binarySourceFiles,state.resultsFromFile.values(),buildConfig.isNoWeave());
}
Program: 9493
Project: 9493
Buggy source:
public List getFilesToCompile(boolean firstPass){
  List sourceFiles=new ArrayList();
  if (firstPass) {
    Collection modifiedFiles=getModifiedFiles();
    sourceFiles.addAll(modifiedFiles);
    sourceFiles.addAll(addedFiles);
    deleteClassFiles();
    addAffectedSourceFiles(sourceFiles);
  }
 else {
    addAffectedSourceFiles(sourceFiles);
  }
  return sourceFiles;
}

Fixed version (ground truth):
public List getFilesToCompile(boolean firstPass){
  List thisTime=new ArrayList();
  if (firstPass) {
    compiledSourceFiles=new ArrayList();
    Collection modifiedFiles=getModifiedFiles();
    thisTime.addAll(modifiedFiles);
    thisTime.addAll(addedFiles);
    deleteClassFiles();
    addAffectedSourceFiles(thisTime,thisTime);
  }
 else {
    addAffectedSourceFiles(thisTime,compiledSourceFiles);
  }
  compiledSourceFiles=thisTime;
  return thisTime;
}
Program: 9494
Project: 9494
Buggy source:
protected void addAffectedSourceFiles(List sourceFiles){
  if (qualifiedStrings.isEmpty() && simpleStrings.isEmpty())   return;
  char[][][] qualifiedNames=ReferenceCollection.internQualifiedNames(makeStringSet(qualifiedStrings));
  if (qualifiedNames.length < qualifiedStrings.size())   qualifiedNames=null;
  char[][] simpleNames=ReferenceCollection.internSimpleNames(makeStringSet(simpleStrings));
  if (simpleNames.length < simpleStrings.size())   simpleNames=null;
  for (Iterator i=references.entrySet().iterator(); i.hasNext(); ) {
    Map.Entry entry=(Map.Entry)i.next();
    ReferenceCollection refs=(ReferenceCollection)entry.getValue();
    if (refs != null && refs.includes(qualifiedNames,simpleNames)) {
      File file=(File)entry.getKey();
      if (file.exists()) {
        if (!sourceFiles.contains(file)) {
          sourceFiles.add(file);
        }
      }
    }
  }
  qualifiedStrings.clear();
  simpleStrings.clear();
}

Fixed version (ground truth):
protected void addAffectedSourceFiles(List addTo,List lastTimeSources){
  if (qualifiedStrings.isEmpty() && simpleStrings.isEmpty())   return;
  char[][][] qualifiedNames=ReferenceCollection.internQualifiedNames(makeStringSet(qualifiedStrings));
  if (qualifiedNames.length < qualifiedStrings.size())   qualifiedNames=null;
  char[][] simpleNames=ReferenceCollection.internSimpleNames(makeStringSet(simpleStrings));
  if (simpleNames.length < simpleStrings.size())   simpleNames=null;
  for (Iterator i=references.entrySet().iterator(); i.hasNext(); ) {
    Map.Entry entry=(Map.Entry)i.next();
    ReferenceCollection refs=(ReferenceCollection)entry.getValue();
    if (refs != null && refs.includes(qualifiedNames,simpleNames)) {
      File file=(File)entry.getKey();
      if (file.exists()) {
        if (!lastTimeSources.contains(file)) {
          addTo.add(file);
        }
      }
    }
  }
  qualifiedStrings.clear();
  simpleStrings.clear();
}
Program: 9495
Project: 9495
Buggy source:
private void addParent(SourceTypeBinding sourceType,ResolvedTypeX parent){
  ReferenceBinding parentBinding=(ReferenceBinding)factory.makeTypeBinding(parent);
  if (parentBinding.isClass()) {
    sourceType.superclass=parentBinding;
  }
 else {
    ReferenceBinding[] oldI=sourceType.superInterfaces;
    ReferenceBinding[] newI;
    if (oldI == null) {
      newI=new ReferenceBinding[1];
      newI[0]=parentBinding;
    }
 else {
      int n=oldI.length;
      newI=new ReferenceBinding[n + 1];
      System.arraycopy(oldI,0,newI,0,n);
      newI[n]=parentBinding;
    }
    sourceType.superInterfaces=newI;
  }
}

Fixed version (ground truth):
private void addParent(SourceTypeBinding sourceType,ResolvedTypeX parent){
  ReferenceBinding parentBinding=(ReferenceBinding)factory.makeTypeBinding(parent);
  if (parentBinding.isClass()) {
    sourceType.superclass=parentBinding;
  }
 else {
    ReferenceBinding[] oldI=sourceType.superInterfaces;
    ReferenceBinding[] newI;
    if (oldI == null) {
      newI=new ReferenceBinding[1];
      newI[0]=parentBinding;
    }
 else {
      int n=oldI.length;
      newI=new ReferenceBinding[n + 1];
      System.arraycopy(oldI,0,newI,0,n);
      newI[n]=parentBinding;
    }
    sourceType.superInterfaces=newI;
    warnOnAddedInterface(factory.fromEclipse(sourceType),parent);
  }
}
Program: 9496
Project: 9496
Buggy source:
public static void makeTestJars() throws IOException {
  List args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
}

Fixed version (ground truth):
public static void makeTestJars() throws IOException {
  List args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
  args=new ArrayList();
  args.add("String_Node_Str");
  args.add("String_Node_Str" + File.pathSeparator + System.getProperty("String_Node_Str"));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  CommandTestCase.runCompiler(args,CommandTestCase.NO_ERRORS);
}
Program: 9497
Project: 9497
Buggy source:
String toString(StringMaker sm){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append(sm.makeModifiersString(getModifiers()));
  if (sm.includeArgs)   buf.append(sm.makeTypeName(getReturnType()));
  if (sm.includeArgs)   buf.append("String_Node_Str");
  buf.append(sm.makePrimaryTypeName(getDeclaringType()));
  buf.append("String_Node_Str");
  buf.append(getName());
  sm.addSignature(buf,getParameterTypes());
  sm.addThrows(buf,getExceptionTypes());
  return buf.toString();
}

Fixed version (ground truth):
String toString(StringMaker sm){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append(sm.makeModifiersString(getModifiers()));
  if (sm.includeArgs)   buf.append(sm.makeTypeName(getReturnType()));
  if (sm.includeArgs)   buf.append("String_Node_Str");
  buf.append(sm.makePrimaryTypeName(getDeclaringType(),getDeclaringTypeName()));
  buf.append("String_Node_Str");
  buf.append(getName());
  sm.addSignature(buf,getParameterTypes());
  sm.addThrows(buf,getExceptionTypes());
  return buf.toString();
}
Program: 9498
Project: 9498
Buggy source:
String toString(StringMaker sm){
  StringBuffer buf=new StringBuffer();
  buf.append(sm.makeModifiersString(getModifiers()));
  buf.append(sm.makePrimaryTypeName(getDeclaringType()));
  sm.addSignature(buf,getParameterTypes());
  sm.addThrows(buf,getExceptionTypes());
  return buf.toString();
}

Fixed version (ground truth):
String toString(StringMaker sm){
  StringBuffer buf=new StringBuffer();
  buf.append(sm.makeModifiersString(getModifiers()));
  buf.append(sm.makePrimaryTypeName(getDeclaringType(),getDeclaringTypeName()));
  sm.addSignature(buf,getParameterTypes());
  sm.addThrows(buf,getExceptionTypes());
  return buf.toString();
}
Program: 9499
Project: 9499
Buggy source:
String toString(StringMaker sm){
  StringBuffer buf=new StringBuffer();
  buf.append(sm.makeModifiersString(getModifiers()));
  if (sm.includeArgs)   buf.append(sm.makeTypeName(getFieldType()));
  if (sm.includeArgs)   buf.append("String_Node_Str");
  buf.append(sm.makePrimaryTypeName(getDeclaringType()));
  buf.append("String_Node_Str");
  buf.append(getName());
  return buf.toString();
}

Fixed version (ground truth):
String toString(StringMaker sm){
  StringBuffer buf=new StringBuffer();
  buf.append(sm.makeModifiersString(getModifiers()));
  if (sm.includeArgs)   buf.append(sm.makeTypeName(getFieldType()));
  if (sm.includeArgs)   buf.append("String_Node_Str");
  buf.append(sm.makePrimaryTypeName(getDeclaringType(),getDeclaringTypeName()));
  buf.append("String_Node_Str");
  buf.append(getName());
  return buf.toString();
}
Program: 9500
Project: 9500
Buggy source:
String toString(StringMaker sm){
  StringBuffer buf=new StringBuffer();
  buf.append(sm.makeModifiersString(getModifiers()));
  buf.append(sm.makePrimaryTypeName(getDeclaringType()));
  buf.append("String_Node_Str");
  buf.append(getName());
  return buf.toString();
}

Fixed version (ground truth):
String toString(StringMaker sm){
  StringBuffer buf=new StringBuffer();
  buf.append(sm.makeModifiersString(getModifiers()));
  buf.append(sm.makePrimaryTypeName(getDeclaringType(),getDeclaringTypeName()));
  buf.append("String_Node_Str");
  buf.append(getName());
  return buf.toString();
}
Program: 9501
Project: 9501
Buggy source:
String toString(StringMaker sm){
  StringBuffer buf=new StringBuffer();
  buf.append(sm.makeModifiersString(getModifiers()));
  if (sm.includeArgs)   buf.append(sm.makeTypeName(getReturnType()));
  if (sm.includeArgs)   buf.append("String_Node_Str");
  buf.append(sm.makePrimaryTypeName(getDeclaringType()));
  buf.append("String_Node_Str");
  buf.append(getName());
  sm.addSignature(buf,getParameterTypes());
  sm.addThrows(buf,getExceptionTypes());
  return buf.toString();
}

Fixed version (ground truth):
String toString(StringMaker sm){
  StringBuffer buf=new StringBuffer();
  buf.append(sm.makeModifiersString(getModifiers()));
  if (sm.includeArgs)   buf.append(sm.makeTypeName(getReturnType()));
  if (sm.includeArgs)   buf.append("String_Node_Str");
  buf.append(sm.makePrimaryTypeName(getDeclaringType(),getDeclaringTypeName()));
  buf.append("String_Node_Str");
  buf.append(getName());
  sm.addSignature(buf,getParameterTypes());
  sm.addThrows(buf,getExceptionTypes());
  return buf.toString();
}
Program: 9502
Project: 9502
Buggy source:
public String makeTypeName(Class type){
  return makeTypeName(type,shortTypeNames);
}

Fixed version (ground truth):
public String makeTypeName(Class type){
  return makeTypeName(type,type.getName(),shortTypeNames);
}
Program: 9503
Project: 9503
Buggy source:
public String makePrimaryTypeName(Class type){
  return makeTypeName(type,shortPrimaryTypeNames);
}

Fixed version (ground truth):
public String makePrimaryTypeName(Class type,String typeName){
  return makeTypeName(type,typeName,shortPrimaryTypeNames);
}
Program: 9504
Project: 9504
Buggy source:
public static TestSuite suite(){
  TestSuite suite=new TestSuite(RuntimeModuleTests.class.getName());
  suite.addTestSuite(RuntimeModuleTests.class);
  return suite;
}

Fixed version (ground truth):
public static TestSuite suite(){
  TestSuite suite=new TestSuite(RuntimeModuleTests.class.getName());
  suite.addTestSuite(RuntimeModuleTests.class);
  suite.addTestSuite(SignatureTest.class);
  return suite;
}
Program: 9505
Project: 9505
Buggy source:
/** 
 * Returns false if a batch build is needed.
 */
boolean prepareForNextBuild(AjBuildConfig newBuildConfig){
  currentBuildTime=System.currentTimeMillis();
  addedClassFiles=new ArrayList();
  if (lastSuccessfulBuildTime == -1 || buildConfig == null) {
    return false;
  }
  if (newBuildConfig.getOutputJar() != null)   return false;
  simpleStrings=new ArrayList();
  qualifiedStrings=new ArrayList();
  Set oldFiles=new HashSet(buildConfig.getFiles());
  Set newFiles=new HashSet(newBuildConfig.getFiles());
  addedFiles=new HashSet(newFiles);
  addedFiles.removeAll(oldFiles);
  deletedFiles=new HashSet(oldFiles);
  deletedFiles.removeAll(newFiles);
  this.newBuildConfig=newBuildConfig;
  return true;
}

Fixed version (ground truth):
/** 
 * Returns false if a batch build is needed.
 */
boolean prepareForNextBuild(AjBuildConfig newBuildConfig){
  currentBuildTime=System.currentTimeMillis();
  addedClassFiles=new ArrayList();
  if (lastSuccessfulBuildTime == -1 || buildConfig == null) {
    return false;
  }
  if (newBuildConfig.getOutputJar() != null)   return false;
  if (pathChange(buildConfig,newBuildConfig))   return false;
  simpleStrings=new ArrayList();
  qualifiedStrings=new ArrayList();
  Set oldFiles=new HashSet(buildConfig.getFiles());
  Set newFiles=new HashSet(newBuildConfig.getFiles());
  addedFiles=new HashSet(newFiles);
  addedFiles.removeAll(oldFiles);
  deletedFiles=new HashSet(oldFiles);
  deletedFiles.removeAll(newFiles);
  this.newBuildConfig=newBuildConfig;
  return true;
}
Program: 9509
Project: 9509
Buggy source:
protected void initClone(Spec spec) throws CloneNotSupportedException {
  super.initClone(spec);
  spec.argfiles=copy(argfiles);
  spec.aspectpath=copy(aspectpath);
  spec.classpath=copy(classpath);
  spec.compiler=compiler;
  spec.includeClassesDir=includeClassesDir;
  spec.reuseCompiler=reuseCompiler;
  spec.permitAnyCompiler=permitAnyCompiler;
  spec.sourceroots=copy(sourceroots);
  spec.extdirs=copy(extdirs);
  spec.testSetup=null;
  if (null != testSetup) {
    spec.testSetup=(TestSetup)testSetup.clone();
  }
  spec.testSrcDirOffset=testSrcDirOffset;
}

Fixed version (ground truth):
protected void initClone(Spec spec) throws CloneNotSupportedException {
  super.initClone(spec);
  spec.argfiles=copy(argfiles);
  spec.aspectpath=copy(aspectpath);
  spec.classpath=copy(classpath);
  spec.compiler=compiler;
  spec.includeClassesDir=includeClassesDir;
  spec.reuseCompiler=reuseCompiler;
  spec.permitAnyCompiler=permitAnyCompiler;
  spec.sourceroots=copy(sourceroots);
  spec.extdirs=copy(extdirs);
  spec.outjar=outjar;
  spec.testSetup=null;
  if (null != testSetup) {
    spec.testSetup=(TestSetup)testSetup.clone();
  }
  spec.testSrcDirOffset=testSrcDirOffset;
}
Program: 9511
Project: 9511
Buggy source:
/** 
 * Get expected bean properties for introspection tests.  This should return an expected property for every attribute in DOCTYPE, using any mapped-to names from setupDigester.
 */
static BProps[] expectedProperties(){
  return new BProps[]{new BProps(AjcTest.Suite.Spec.class,new String[]{"String_Node_Str"}),new BProps(AjcTest.Spec.class,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}),new BProps(CompilerRun.Spec.class,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}),new BProps(IncCompilerRun.Spec.class,new String[]{"String_Node_Str"}),new BProps(JavaRun.Spec.class,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}),new BProps(DirChanges.Spec.class,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}),new BProps(AbstractRunSpec.WrapFile.class,new String[]{"String_Node_Str"}),new BProps(SoftMessage.class,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"})};
}

Fixed version (ground truth):
/** 
 * Get expected bean properties for introspection tests.  This should return an expected property for every attribute in DOCTYPE, using any mapped-to names from setupDigester.
 */
static BProps[] expectedProperties(){
  return new BProps[]{new BProps(AjcTest.Suite.Spec.class,new String[]{"String_Node_Str"}),new BProps(AjcTest.Spec.class,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}),new BProps(CompilerRun.Spec.class,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}),new BProps(IncCompilerRun.Spec.class,new String[]{"String_Node_Str"}),new BProps(JavaRun.Spec.class,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}),new BProps(DirChanges.Spec.class,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}),new BProps(AbstractRunSpec.WrapFile.class,new String[]{"String_Node_Str"}),new BProps(SoftMessage.class,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"})};
}
Program: 9512
Project: 9512
Buggy source:
private void copyResourcesToDestination() throws IOException {
  for (Iterator i=buildConfig.getInJars().iterator(); i.hasNext(); ) {
    File inJar=(File)i.next();
    copyResourcesFromJarFile(inJar);
  }
  for (Iterator i=buildConfig.getInpath().iterator(); i.hasNext(); ) {
    File inPathElement=(File)i.next();
    if (inPathElement.isDirectory()) {
      copyResourcesFromDirectory(inPathElement);
    }
 else {
      copyResourcesFromJarFile(inPathElement);
    }
  }
  if (buildConfig.getSourcePathResources() != null) {
    for (Iterator i=buildConfig.getSourcePathResources().keySet().iterator(); i.hasNext(); ) {
      String resource=(String)i.next();
      copyResourcesFromFile((File)buildConfig.getSourcePathResources().get(resource),resource);
    }
  }
}

Fixed version (ground truth):
private void copyResourcesToDestination() throws IOException {
  for (Iterator i=buildConfig.getInJars().iterator(); i.hasNext(); ) {
    File inJar=(File)i.next();
    copyResourcesFromJarFile(inJar);
  }
  for (Iterator i=buildConfig.getInpath().iterator(); i.hasNext(); ) {
    File inPathElement=(File)i.next();
    if (inPathElement.isDirectory()) {
      copyResourcesFromDirectory(inPathElement);
    }
 else {
      copyResourcesFromJarFile(inPathElement);
    }
  }
  if (buildConfig.getSourcePathResources() != null) {
    for (Iterator i=buildConfig.getSourcePathResources().keySet().iterator(); i.hasNext(); ) {
      String resource=(String)i.next();
      File from=(File)buildConfig.getSourcePathResources().get(resource);
      copyResourcesFromFile(from,resource,from);
    }
  }
}
Program: 9513
Project: 9513
Buggy source:
private void copyResourcesFromJarFile(File jarFile) throws IOException {
  ZipInputStream inStream=null;
  try {
    inStream=new ZipInputStream(new FileInputStream(jarFile));
    while (true) {
      ZipEntry entry=inStream.getNextEntry();
      if (entry == null)       break;
      String filename=entry.getName();
      if (!entry.isDirectory() && acceptResource(filename)) {
        byte[] bytes=FileUtil.readAsByteArray(inStream);
        writeResource(filename,bytes);
      }
      inStream.closeEntry();
    }
  }
  finally {
    if (inStream != null)     inStream.close();
  }
}

Fixed version (ground truth):
private void copyResourcesFromJarFile(File jarFile) throws IOException {
  ZipInputStream inStream=null;
  try {
    inStream=new ZipInputStream(new FileInputStream(jarFile));
    while (true) {
      ZipEntry entry=inStream.getNextEntry();
      if (entry == null)       break;
      String filename=entry.getName();
      if (!entry.isDirectory() && acceptResource(filename)) {
        byte[] bytes=FileUtil.readAsByteArray(inStream);
        writeResource(filename,bytes,jarFile);
      }
      inStream.closeEntry();
    }
  }
  finally {
    if (inStream != null)     inStream.close();
  }
}