nus-yam/ex-repair huggingface dataset:
Program: 84982
Project: 84982
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  for (int i=0; i < this.valueCount; i++) {
    this.values[i].checkTypes(markers,context);
  }
  if (this.tupleType instanceof TupleType) {
    return;
  }
  IMethod m=IContext.resolveMethod(markers,this.getType(),null,Name.apply,this.arguments=new ArgumentList(this.values,this.valueCount));
  if (m == null) {
    StringBuilder builder=new StringBuilder();
    if (this.valueCount > 0) {
      this.values[0].getType().toString("String_Node_Str",builder);
      for (int i=1; i < this.valueCount; i++) {
        builder.append("String_Node_Str");
        this.values[i].getType().toString("String_Node_Str",builder);
      }
    }
    markers.add(this.position,"String_Node_Str",builder.toString(),this.tupleType.toString());
  }
 else {
    this.method=m;
    m.checkArguments(markers,null,this.arguments,null);
  }
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  if (this.tupleType instanceof TupleType) {
    ITypeList typeList=(ITypeList)this.tupleType;
    for (int i=0; i < this.valueCount; i++) {
      IValue v1=this.values[i].withType(typeList.getType(i));
      if (v1 != null) {
        this.values[i]=v1;
      }
 else {
      }
      this.values[i].checkTypes(markers,context);
    }
    return;
  }
  IMethod m=IContext.resolveMethod(markers,this.getType(),null,Name.apply,this.arguments=new ArgumentList(this.values,this.valueCount));
  if (m == null) {
    StringBuilder builder=new StringBuilder();
    if (this.valueCount > 0) {
      this.values[0].getType().toString("String_Node_Str",builder);
      for (int i=1; i < this.valueCount; i++) {
        builder.append("String_Node_Str");
        this.values[i].getType().toString("String_Node_Str",builder);
      }
    }
    markers.add(this.position,"String_Node_Str",builder.toString(),this.tupleType.toString());
  }
 else {
    this.method=m;
    m.checkArguments(markers,null,this.arguments,null);
  }
}
Program: 84983
Project: 84983
Buggy source:
@Override public void resolveTypes(MarkerList markers,IContext context){
  TupleType type=new TupleType();
  for (int i=0; i < this.valueCount; i++) {
    IValue v=this.values[i];
    v.resolveTypes(markers,context);
    type.addType(v.getType());
  }
  type.getTheClass();
  this.tupleType=type;
}

Fixed version (ground truth):
@Override public void resolveTypes(MarkerList markers,IContext context){
  TupleType tupleType=new TupleType();
  for (int i=0; i < this.valueCount; i++) {
    IValue v=this.values[i];
    v.resolveTypes(markers,context);
    IType t=v.getType();
    if (t.isPrimitive()) {
      tupleType.addType(t.getReferenceType());
    }
 else {
      tupleType.addType(t);
    }
  }
  this.tupleType=tupleType;
}
Program: 84984
Project: 84984
Buggy source:
@Override public IClass resolveClass(String name){
  for (  IClass iclass : this.classes) {
    if (name.equals(iclass.getName().qualified)) {
      return iclass;
    }
  }
  return this.loadClass(name);
}

Fixed version (ground truth):
@Override public synchronized IClass resolveClass(String name){
  for (  IClass iclass : this.classes) {
    if (name.equals(iclass.getName().qualified)) {
      return iclass;
    }
  }
  return this.loadClass(name);
}
Program: 84985
Project: 84985
Buggy source:
private IClass loadClass(String name){
synchronized (this) {
    InputStream is=this.library.getInputStream(this.internalName + name + "String_Node_Str");
    if (is != null) {
      ExternalClass bclass=new ExternalClass(Name.getQualified(name));
      this.classes.add(bclass);
      return ClassReader.loadClass(bclass,is,false);
    }
  }
  return null;
}

Fixed version (ground truth):
private IClass loadClass(String name,Library library){
  InputStream is=library.getInputStream(this.internalName + name + "String_Node_Str");
  if (is != null) {
    ExternalClass bclass=new ExternalClass(Name.getQualified(name));
    this.classes.add(bclass);
    return ClassReader.loadClass(bclass,is,false);
  }
  return null;
}
Program: 84986
Project: 84986
Buggy source:
@Override public Package resolvePackage(String name){
  Package pack=super.resolvePackage(name);
  if (pack != null) {
    return pack;
  }
  String name1=this.internalName + name;
  pack=this.library.resolvePackage(name1);
  if (pack != null) {
    this.addSubPackage(pack);
    return pack;
  }
  return null;
}

Fixed version (ground truth):
@Override public Package resolvePackage(String name){
  Package pack=super.resolvePackage(name);
  if (pack != null) {
    return pack;
  }
  String name1=this.internalName + name;
  pack=this.library.resolvePackage(name1);
  if (pack != null) {
    this.addSubPackage(pack);
    return pack;
  }
  for (  Library lib : DyvilCompiler.config.libraries) {
    if (lib == this.library) {
      continue;
    }
    pack=lib.resolvePackage(name1);
    if (pack != null) {
      this.addSubPackage(pack);
    }
  }
  return null;
}
Program: 84987
Project: 84987
Buggy source:
@Override public IClass getTheClass(){
  IClass iclass=tupleClasses[this.typeCount];
  if (iclass != null) {
    return iclass;
  }
  iclass=Package.dyvilTuple.resolveClass("String_Node_Str" + this.typeCount);
  tupleClasses[this.typeCount]=iclass;
  return iclass;
}

Fixed version (ground truth):
@Override public IClass getTheClass(){
  return getTupleClass(this.typeCount);
}
Program: 84988
Project: 84988
Buggy source:
@Override public IField resolveField(Name name){
  IField field=this.body.getProperty(name);
  if (field != null) {
    return field;
  }
  field=this.body.getField(name);
  if (field != null) {
    return field;
  }
  if (!this.superTypesResolved) {
    this.resolveSuperTypes();
  }
  if (this.superType != null) {
    IField match=this.superType.resolveField(name);
    if (match != null) {
      return match;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public IField resolveField(Name name){
  if (!this.genericsResolved) {
    this.resolveGenerics();
  }
  IField field=this.body.getProperty(name);
  if (field != null) {
    return field;
  }
  field=this.body.getField(name);
  if (field != null) {
    return field;
  }
  if (!this.superTypesResolved) {
    this.resolveSuperTypes();
  }
  if (this.superType != null) {
    IField match=this.superType.resolveField(name);
    if (match != null) {
      return match;
    }
  }
  return null;
}
Program: 84989
Project: 84989
Buggy source:
@Override public void getMethodMatches(List<MethodMatch> list,IValue instance,Name name,IArguments arguments){
  this.body.getMethodMatches(list,instance,name,arguments);
  if (!list.isEmpty()) {
    return;
  }
  if (!this.superTypesResolved) {
    this.resolveSuperTypes();
  }
  if (this.superType != null) {
    this.superType.getMethodMatches(list,instance,name,arguments);
  }
  if (!list.isEmpty()) {
    return;
  }
  for (int i=0; i < this.interfaceCount; i++) {
    this.interfaces[i].getMethodMatches(list,instance,name,arguments);
  }
}

Fixed version (ground truth):
@Override public void getMethodMatches(List<MethodMatch> list,IValue instance,Name name,IArguments arguments){
  if (!this.genericsResolved) {
    this.resolveGenerics();
  }
  this.body.getMethodMatches(list,instance,name,arguments);
  if (!list.isEmpty()) {
    return;
  }
  if (!this.superTypesResolved) {
    this.resolveSuperTypes();
  }
  if (this.superType != null) {
    this.superType.getMethodMatches(list,instance,name,arguments);
  }
  if (!list.isEmpty()) {
    return;
  }
  for (int i=0; i < this.interfaceCount; i++) {
    this.interfaces[i].getMethodMatches(list,instance,name,arguments);
  }
}
Program: 84990
Project: 84990
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  if (this.type == Types.VOID) {
    markers.add(this.position,"String_Node_Str");
    this.value.checkTypes(markers,context);
    return;
  }
  if (!this.typeHint && this.type.isSuperTypeOf(this.value.getType())) {
    markers.add(this.position,"String_Node_Str");
    this.typeHint=true;
  }
  IValue value1=this.value.withType(this.type);
  if (value1 != null && value1 != this.value) {
    this.value=value1;
    this.typeHint=true;
  }
  this.value.checkTypes(markers,context);
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  if (this.type == Types.VOID) {
    markers.add(this.position,"String_Node_Str");
    this.value.checkTypes(markers,context);
    return;
  }
  if (!this.typeHint && this.type.isSuperTypeOf(this.value.getType())) {
    markers.add(this.position,"String_Node_Str");
    this.typeHint=true;
  }
  if (this.type.isResolved()) {
    IValue value1=this.value.withType(this.type);
    if (value1 != null && value1 != this.value) {
      this.value=value1;
      this.typeHint=true;
    }
    this.value.checkTypes(markers,context);
  }
}
Program: 84991
Project: 84991
Buggy source:
@Override public String toString(){
  if (this.size == 0) {
    return "String_Node_Str";
  }
  StringBuilder buf=new StringBuilder("String_Node_Str");
  buf.append(this.elements[0]);
  for (int i=1; i < this.size; i++) {
    buf.append("String_Node_Str");
    buf.append(this.elements[i]);
  }
  buf.append("String_Node_Str");
  return buf.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  if (this.size == 0) {
    return "String_Node_Str";
  }
  StringBuilder buf=new StringBuilder(this.size * 10).append('[');
  buf.append(this.elements[0]);
  for (int i=1; i < this.size; i++) {
    buf.append("String_Node_Str");
    buf.append(this.elements[i]);
  }
  buf.append(']');
  return buf.toString();
}
Program: 84992
Project: 84992
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + this.element + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return new StringBuilder('[').append(this.element).append(']').toString();
}
Program: 84993
Project: 84993
Buggy source:
@Override public void $plus$plus$eq(Collection<? extends E> collection){
  int len=collection.size();
  this.ensureCapacity(this.size + len);
  Object[] array=collection.toArray();
  System.arraycopy(array,0,this.elements,this.size,len);
}

Fixed version (ground truth):
@Override public void $plus$plus$eq(Collection<? extends E> collection){
  int len=collection.size();
  this.ensureCapacity(this.size + len);
  Object[] array=collection.toArray();
  System.arraycopy(array,0,this.elements,this.size,len);
  this.size+=len;
}
Program: 84994
Project: 84994
Buggy source:
@Override public String toString(){
  if (this.size == 0) {
    return "String_Node_Str";
  }
  StringBuilder buf=new StringBuilder("String_Node_Str");
  buf.append(this.elements[0]);
  for (int i=1; i < this.size; i++) {
    buf.append("String_Node_Str");
    buf.append(this.elements[i]);
  }
  buf.append("String_Node_Str");
  return buf.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  if (this.size == 0) {
    return "String_Node_Str";
  }
  StringBuilder buf=new StringBuilder(this.size * 10).append('[');
  buf.append(this.elements[0]);
  for (int i=1; i < this.size; i++) {
    buf.append("String_Node_Str");
    buf.append(this.elements[i]);
  }
  buf.append(']');
  return buf.toString();
}
Program: 84995
Project: 84995
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  IMethod match=IContext.resolveMethod(markers,this.type,null,Name.apply,this.argument);
  if (match == null) {
    IValue value=this.argument.getFirstValue();
    markers.add(value.getPosition(),"String_Node_Str",value.getType().toString(),this.type.toString());
  }
 else {
    this.method=match;
  }
  match.checkArguments(markers,null,this.argument,null);
  this.argument.checkTypes(markers,context);
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  IMethod match=IContext.resolveMethod(markers,this.type,null,Name.apply,this.argument);
  if (match == null) {
    IValue value=this.argument.getFirstValue();
    markers.add(value.getPosition(),"String_Node_Str",value.getType().toString(),this.type.toString());
  }
 else {
    this.method=match;
    match.checkArguments(markers,null,this.argument,null);
  }
  this.argument.checkTypes(markers,context);
}
Program: 84996
Project: 84996
Buggy source:
@Override public void writeExpression(MethodWriter writer){
  this.value.writeExpression(writer);
  if (this.type.isPrimitive()) {
    writePrimitiveCast(this.value.getType(),(PrimitiveType)this.type,writer);
  }
 else {
    writer.writeTypeInsn(Opcodes.CHECKCAST,this.type.getInternalName());
  }
}

Fixed version (ground truth):
@Override public void writeExpression(MethodWriter writer){
  this.value.writeExpression(writer);
  if (this.typeHint) {
    return;
  }
  if (this.type.isPrimitive()) {
    writePrimitiveCast(this.value.getType(),(PrimitiveType)this.type,writer);
  }
 else {
    writer.writeTypeInsn(Opcodes.CHECKCAST,this.type.getInternalName());
  }
}
Program: 84997
Project: 84997
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  if (this.type.isSuperTypeOf(this.value.getType())) {
    markers.add(this.position,"String_Node_Str");
  }
  IValue value1=this.value.withType(this.type);
  if (value1 != null && value1 != this.value) {
    this.value=value1;
  }
  this.value.checkTypes(markers,context);
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  if (this.type.isSuperTypeOf(this.value.getType())) {
    markers.add(this.position,"String_Node_Str");
    this.typeHint=true;
  }
  IValue value1=this.value.withType(this.type);
  if (value1 != null && value1 != this.value) {
    this.value=value1;
    this.typeHint=true;
  }
  this.value.checkTypes(markers,context);
}
Program: 84998
Project: 84998
Buggy source:
@Override public void reset(){
  this.mode=NAME;
  this.boundMode=0;
  this.type=null;
  this.arrayDimensions=0;
  this.arrayDimensions2=0;
}

Fixed version (ground truth):
@Override public void reset(){
  this.mode=NAME;
  this.boundMode=0;
  this.type=null;
}
Program: 84999
Project: 84999
Buggy source:
public void end(){
  if (this.type != null && this.arrayDimensions > 0) {
    this.type=ArrayType.getArrayType(this.type,this.arrayDimensions);
  }
  this.typed.setType(this.type);
}

Fixed version (ground truth):
public void end(){
  this.typed.setType(this.type);
}
Program: 85001
Project: 85001
Buggy source:
@Override public int getTypeMatch(IType type){
  if (!type.isArrayType()) {
    return type.getTheClass().getAnnotation(ARRAY_CONVERTIBLE) != null ? 2 : 0;
  }
  if (this.valueCount == 0) {
    return 3;
  }
  IType type1=type.getElementType();
  int total=0;
  for (int i=0; i < this.valueCount; i++) {
    int m=this.values[i].getTypeMatch(type1);
    if (m == 0) {
      return 0;
    }
    total+=m;
  }
  return total / this.valueCount;
}

Fixed version (ground truth):
@Override public int getTypeMatch(IType type){
  if (!type.isArrayType()) {
    IClass iclass=type.getTheClass();
    return iclass == Types.OBJECT_CLASS || iclass.getAnnotation(ARRAY_CONVERTIBLE) != null ? 2 : 0;
  }
  if (this.valueCount == 0) {
    return 3;
  }
  IType type1=type.getElementType();
  int total=0;
  for (int i=0; i < this.valueCount; i++) {
    int m=this.values[i].getTypeMatch(type1);
    if (m == 0) {
      return 0;
    }
    total+=m;
  }
  return total / this.valueCount;
}
Program: 85002
Project: 85002
Buggy source:
@Override public IValue withType(IType type){
  if (!type.isArrayType()) {
    if (type.getTheClass().getAnnotation(ARRAY_CONVERTIBLE) != null) {
      return new LiteralExpression(type,this);
    }
    return null;
  }
  IType type1=type.getElementType();
  for (int i=0; i < this.valueCount; i++) {
    if (!this.values[i].isType(type1)) {
      return null;
    }
  }
  this.elementType=type1;
  this.requiredType=type;
  return this;
}

Fixed version (ground truth):
@Override public IValue withType(IType type){
  if (!type.isArrayType()) {
    IClass iclass=type.getTheClass();
    if (iclass == Types.OBJECT_CLASS) {
      return this;
    }
    if (iclass.getAnnotation(ARRAY_CONVERTIBLE) != null) {
      return new LiteralExpression(type,this);
    }
    return null;
  }
  IType type1=type.getElementType();
  for (int i=0; i < this.valueCount; i++) {
    if (!this.values[i].isType(type1)) {
      return null;
    }
  }
  this.elementType=type1;
  this.requiredType=type;
  return this;
}
Program: 85003
Project: 85003
Buggy source:
@Override public boolean isType(IType type){
  if (!type.isArrayType()) {
    return type.getTheClass().getAnnotation(ARRAY_CONVERTIBLE) != null;
  }
  if (this.valueCount == 0) {
    return true;
  }
  IType type1=type.getElementType();
  for (int i=0; i < this.valueCount; i++) {
    if (!this.values[i].isType(type1)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isType(IType type){
  if (!type.isArrayType()) {
    IClass iclass=type.getTheClass();
    return iclass == Types.OBJECT_CLASS || iclass.getAnnotation(ARRAY_CONVERTIBLE) != null;
  }
  if (this.valueCount == 0) {
    return true;
  }
  IType type1=type.getElementType();
  for (int i=0; i < this.valueCount; i++) {
    if (!this.values[i].isType(type1)) {
      return false;
    }
  }
  return true;
}
Program: 85004
Project: 85004
Buggy source:
@Override public boolean isSuperTypeOf(IType type){
  int arrayDims=type.getArrayDimensions();
  if (arrayDims == 0) {
    return false;
  }
  int thisDims=this.getArrayDimensions();
  if (arrayDims > thisDims) {
    return this.type.getTheClass() == Types.OBJECT_CLASS;
  }
  return this.type.isSuperTypeOf(type);
}

Fixed version (ground truth):
@Override public boolean isSuperTypeOf(IType type){
  int arrayDims=type.getArrayDimensions();
  if (arrayDims == 0) {
    return false;
  }
  int thisDims=this.getArrayDimensions();
  if (arrayDims > thisDims) {
    return this.type.getTheClass() == Types.OBJECT_CLASS;
  }
  return this.type.isSuperTypeOf(type.getElementType());
}
Program: 85005
Project: 85005
Buggy source:
@Override public void addStaticImport(HeaderComponent component){
  int index=this.staticImportCount++;
  if (index >= this.staticImports.length) {
    HeaderComponent[] temp=new HeaderComponent[index];
    System.arraycopy(this.staticImports,0,temp,0,this.staticImports.length);
    this.staticImports=temp;
  }
  this.staticImports[index]=component;
}

Fixed version (ground truth):
@Override public void addStaticImport(HeaderComponent component){
  int index=this.staticImportCount++;
  if (index >= this.staticImports.length) {
    HeaderComponent[] temp=new HeaderComponent[index + 1];
    System.arraycopy(this.staticImports,0,temp,0,this.staticImports.length);
    this.staticImports=temp;
  }
  this.staticImports[index]=component;
}
Program: 85006
Project: 85006
Buggy source:
@Override public void addImport(HeaderComponent component){
  int index=this.importCount++;
  if (index >= this.imports.length) {
    HeaderComponent[] temp=new HeaderComponent[index];
    System.arraycopy(this.imports,0,temp,0,this.imports.length);
    this.imports=temp;
  }
  this.imports[index]=component;
}

Fixed version (ground truth):
@Override public void addImport(HeaderComponent component){
  int index=this.importCount++;
  if (index >= this.imports.length) {
    HeaderComponent[] temp=new HeaderComponent[index + 1];
    System.arraycopy(this.imports,0,temp,0,this.imports.length);
    this.imports=temp;
  }
  this.imports[index]=component;
}
Program: 85007
Project: 85007
Buggy source:
@Override public void writeExpression(MethodWriter writer){
  if (this.type.isArrayType()) {
    int len=this.arguments.size();
    if (len == 1) {
      this.arguments.getFirstValue().writeExpression(writer);
      this.type.setArrayDimensions(0);
      writer.writeTypeInsn(Opcodes.ANEWARRAY,this.type.getInternalName());
      this.type.setArrayDimensions(1);
      return;
    }
    ArgumentList paramList=(ArgumentList)this.arguments;
    for (int i=0; i < len; i++) {
      paramList.getValue(i).writeExpression(writer);
    }
    writer.writeNewArray(this.type,len);
    return;
  }
  this.constructor.writeCall(writer,this.arguments,null);
}

Fixed version (ground truth):
@Override public void writeExpression(MethodWriter writer){
  if (this.type.isArrayType()) {
    int len=this.arguments.size();
    if (len == 1) {
      this.arguments.getFirstValue().writeExpression(writer);
      writer.writeNewArray(this.type,1);
      return;
    }
    ArgumentList paramList=(ArgumentList)this.arguments;
    for (int i=0; i < len; i++) {
      paramList.getValue(i).writeExpression(writer);
    }
    writer.writeNewArray(this.type,len);
    return;
  }
  this.constructor.writeCall(writer,this.arguments,null);
}
Program: 85008
Project: 85008
Buggy source:
@Override public void write(ClassWriter writer){
  boolean instance=this.thisClass != null;
  int modifiers=instance ? Modifiers.PRIVATE | Modifiers.SYNTHETIC : Modifiers.PRIVATE | Modifiers.STATIC | Modifiers.SYNTHETIC;
  MethodWriter mw=new MethodWriterImpl(writer,writer.visitMethod(modifiers,this.getName(),this.getLambdaDescriptor(),null,null));
  if (instance) {
    mw.setInstanceMethod();
  }
  int index=0;
  for (int i=0; i < this.capturedFieldCount; i++) {
    CaptureVariable capture=this.capturedFields[i];
    capture.index=index;
    index=mw.registerParameter(index,capture.variable.getName().qualified,capture.variable.getType(),0);
  }
  index=0;
  for (int i=0; i < this.parameterCount; i++) {
    IParameter param=this.parameters[i];
    index=mw.registerParameter(index,param.getName().qualified,param.getType(),0);
    param.setIndex(index);
  }
  mw.begin();
  this.value.writeExpression(mw);
  mw.end(this.returnType);
}

Fixed version (ground truth):
@Override public void write(ClassWriter writer){
  boolean instance=this.thisClass != null;
  int modifiers=instance ? Modifiers.PRIVATE | Modifiers.SYNTHETIC : Modifiers.PRIVATE | Modifiers.STATIC | Modifiers.SYNTHETIC;
  MethodWriter mw=new MethodWriterImpl(writer,writer.visitMethod(modifiers,this.getName(),this.getLambdaDescriptor(),null,null));
  if (instance) {
    mw.setInstanceMethod();
  }
  int index=0;
  for (int i=0; i < this.capturedFieldCount; i++) {
    CaptureVariable capture=this.capturedFields[i];
    capture.index=index;
    index=mw.registerParameter(index,capture.variable.getName().qualified,capture.variable.getType(),0);
  }
  for (int i=0; i < this.parameterCount; i++) {
    IParameter param=this.parameters[i];
    param.setIndex(index);
    index=mw.registerParameter(index,param.getName().qualified,param.getType(),0);
  }
  mw.begin();
  this.value.writeExpression(mw);
  mw.end(this.returnType);
}
Program: 85010
Project: 85010
Buggy source:
@Override public IMethod getFunctionalMethod(){
  IMethod m;
  if (this.body != null) {
    m=this.body.getFunctionalMethod();
    if (m != null) {
      return m;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public IMethod getFunctionalMethod(){
  if ((this.modifiers & Modifiers.ABSTRACT | Modifiers.INTERFACE_CLASS) == 0) {
    return null;
  }
  IMethod m;
  if (this.body != null) {
    m=this.body.getFunctionalMethod();
    if (m != null) {
      return m;
    }
  }
  if (this.superType != null) {
    m=this.superType.getFunctionalMethod();
    if (m != null) {
      return m;
    }
  }
  for (int i=0; i < this.interfaceCount; i++) {
    m=this.interfaces[i].getFunctionalMethod();
    if (m != null) {
      return m;
    }
  }
  return null;
}
Program: 85011
Project: 85011
Buggy source:
@Override public IValue withType(IType type){
  return this.isType(type) ? this : null;
}

Fixed version (ground truth):
@Override public IValue withType(IType type){
  if (this.isType(type)) {
    this.type=type;
    return this;
  }
  return null;
}
Program: 85012
Project: 85012
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  this.context=context;
  if (this.method != null) {
    if (this.method.hasTypeVariables()) {
      for (int i=0; i < this.parameterCount; i++) {
        IParameter param=this.parameters[i];
        param.setType(param.getType().getConcreteType(this.type));
      }
      this.returnType=this.method.getType().getConcreteType(this.type);
    }
 else {
      this.returnType=this.method.getType();
    }
    this.value=this.value.resolve(markers,this);
    IValue value1=this.value.withType(this.returnType);
    if (value1 == null) {
      Marker marker=markers.create(this.value.getPosition(),"String_Node_Str");
      marker.addInfo("String_Node_Str" + this.returnType);
      marker.addInfo("String_Node_Str" + this.value.getType());
    }
 else {
      this.value=value1;
    }
  }
 else {
    markers.add(this.position,"String_Node_Str");
  }
  this.value.checkTypes(markers,this);
  this.context=null;
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  this.context=context;
  if (this.method != null) {
    if (this.method.hasTypeVariables()) {
      for (int i=0; i < this.parameterCount; i++) {
        IParameter param=this.parameters[i];
        IType type=param.getType();
        if (type == null) {
          type=this.method.getParameter(i).getType();
        }
        param.setType(type.getConcreteType(this.type));
      }
      this.returnType=this.method.getType().getConcreteType(this.type);
    }
 else {
      this.returnType=this.method.getType();
    }
    this.value=this.value.resolve(markers,this);
    IValue value1=this.value.withType(this.returnType);
    if (value1 == null) {
      Marker marker=markers.create(this.value.getPosition(),"String_Node_Str");
      marker.addInfo("String_Node_Str" + this.returnType);
      marker.addInfo("String_Node_Str" + this.value.getType());
    }
 else {
      this.value=value1;
    }
  }
 else {
    markers.add(this.position,"String_Node_Str");
  }
  this.value.checkTypes(markers,this);
  this.context=null;
}
Program: 85013
Project: 85013
Buggy source:
@Override public boolean isType(IType type){
  IClass iclass=type.getTheClass();
  if (iclass == null) {
    return false;
  }
  IMethod method=iclass.getFunctionalMethod();
  if (method == null) {
    return false;
  }
  if (this.parameterCount != method.parameterCount()) {
    return false;
  }
  for (int i=0; i < this.parameterCount; i++) {
    IParameter lambdaParam=this.parameters[i];
    IParameter param=method.getParameter(i);
    IType paramType=lambdaParam.getType();
    if (paramType == null) {
      lambdaParam.setType(param.getType());
      continue;
    }
    if (!param.getType().equals(paramType)) {
      return false;
    }
  }
  this.type=type;
  this.method=method;
  return true;
}

Fixed version (ground truth):
@Override public boolean isType(IType type){
  if (this.type != null && type.isSuperTypeOf(this.type)) {
    return true;
  }
  IClass iclass=type.getTheClass();
  if (iclass == null) {
    return false;
  }
  IMethod method=iclass.getFunctionalMethod();
  if (method == null) {
    return false;
  }
  if (this.parameterCount != method.parameterCount()) {
    return false;
  }
  for (int i=0; i < this.parameterCount; i++) {
    IParameter lambdaParam=this.parameters[i];
    IParameter param=method.getParameter(i);
    IType paramType=lambdaParam.getType();
    if (paramType == null) {
      continue;
    }
    if (!param.getType().equals(paramType)) {
      return false;
    }
  }
  this.type=type;
  this.method=method;
  return true;
}
Program: 85014
Project: 85014
Buggy source:
private void resolveSuperTypes(){
  this.superTypesResolved=true;
  if (this.superType != null) {
    this.superType=this.superType.resolve(null,Package.rootPackage);
  }
  for (int i=0; i < this.interfaceCount; i++) {
    this.interfaces[i]=this.interfaces[i].resolve(null,Package.rootPackage);
  }
  if (this.metadata == null) {
    this.metadata=IClass.getClassMetadata(this,this.modifiers);
  }
  this.metadata.resolve(null,Package.rootPackage);
}

Fixed version (ground truth):
private void resolveSuperTypes(){
  this.superTypesResolved=true;
  if (this.superType != null) {
    this.superType=this.superType.resolve(null,this);
  }
  for (int i=0; i < this.interfaceCount; i++) {
    this.interfaces[i]=this.interfaces[i].resolve(null,this);
  }
  if (this.metadata == null) {
    this.metadata=IClass.getClassMetadata(this,this.modifiers);
  }
  this.metadata.resolve(null,Package.rootPackage);
}
Program: 85015
Project: 85015
Buggy source:
private static IType readType(String desc,int start,int end){
  int array=0;
  while (desc.charAt(start) == '[') {
    array++;
    start++;
  }
switch (desc.charAt(start)) {
case 'V':
    return Types.VOID.getArrayType(array);
case 'Z':
  return Types.BOOLEAN.getArrayType(array);
case 'B':
return Types.BYTE.getArrayType(array);
case 'S':
return Types.SHORT.getArrayType(array);
case 'C':
return Types.CHAR.getArrayType(array);
case 'I':
return Types.INT.getArrayType(array);
case 'J':
return Types.LONG.getArrayType(array);
case 'F':
return Types.FLOAT.getArrayType(array);
case 'D':
return Types.DOUBLE.getArrayType(array);
case 'T':
{
String s=desc.substring(start + 1,end - 1);
return new Type(s,Name.getQualified(s));
}
case 'L':
return readReferenceType(desc,start + 1,end - 1);
}
return null;
}

Fixed version (ground truth):
private static IType readType(String desc,int start,int end){
  int array=0;
  while (desc.charAt(start) == '[') {
    array++;
    start++;
  }
switch (desc.charAt(start)) {
case 'V':
    return Types.VOID.getArrayType(array);
case 'Z':
  return Types.BOOLEAN.getArrayType(array);
case 'B':
return Types.BYTE.getArrayType(array);
case 'S':
return Types.SHORT.getArrayType(array);
case 'C':
return Types.CHAR.getArrayType(array);
case 'I':
return Types.INT.getArrayType(array);
case 'J':
return Types.LONG.getArrayType(array);
case 'F':
return Types.FLOAT.getArrayType(array);
case 'D':
return Types.DOUBLE.getArrayType(array);
case 'T':
{
String s=desc.substring(start + 1,end);
return new Type(s,Name.getQualified(s));
}
case 'L':
return readReferenceType(desc,start + 1,end);
}
return null;
}
Program: 85018
Project: 85018
Buggy source:
@Override public IMethod getFunctionalMethod(){
  IMethod m;
  if (this.body != null) {
    m=this.body.getFunctionalMethod();
    if (m != null) {
      return m;
    }
  }
  m=this.superType.getFunctionalMethod();
  if (m != null) {
    return m;
  }
  for (int i=0; i < this.interfaceCount; i++) {
    m=this.interfaces[i].getFunctionalMethod();
    if (m != null) {
      return m;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public IMethod getFunctionalMethod(){
  IMethod m;
  if (this.body != null) {
    m=this.body.getFunctionalMethod();
    if (m != null) {
      return m;
    }
  }
  return null;
}
Program: 85019
Project: 85019
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  IMethod match=IContext.resolveMethod(markers,this.type,null,Name.apply,this.argument);
  if (match == null) {
    IValue value=this.argument.getFirstValue();
    markers.add(value.getPosition(),"String_Node_Str",value.getType().toString(),this.type.toString());
  }
 else {
    this.method=match;
  }
  this.argument.checkTypes(markers,context);
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  IMethod match=IContext.resolveMethod(markers,this.type,null,Name.apply,this.argument);
  if (match == null) {
    IValue value=this.argument.getFirstValue();
    markers.add(value.getPosition(),"String_Node_Str",value.getType().toString(),this.type.toString());
  }
 else {
    this.method=match;
  }
  match.checkArguments(markers,null,this.argument,null);
  this.argument.checkTypes(markers,context);
}
Program: 85020
Project: 85020
Buggy source:
@Override public void addType(IType type){
  int index=this.upperBoundCount++;
  if (index >= this.upperBounds.length) {
    IType[] temp=new IType[this.upperBoundCount];
    System.arraycopy(this.upperBounds,0,temp,0,this.upperBounds.length);
    this.upperBounds=temp;
  }
  this.upperBounds[index]=type;
}

Fixed version (ground truth):
@Override public void addType(IType type){
  int index=this.upperBoundCount++;
  if (index >= this.upperBounds.length) {
    IType[] temp=new IType[this.upperBoundCount];
    System.arraycopy(this.upperBounds,0,temp,0,index);
    this.upperBounds=temp;
  }
  this.upperBounds[index]=type;
}
Program: 85021
Project: 85021
Buggy source:
@Override public void addUpperBound(IType bound){
  int index=this.upperBoundCount++;
  if (index >= this.upperBounds.length) {
    IType[] temp=new IType[this.upperBoundCount];
    System.arraycopy(this.upperBounds,0,temp,0,this.upperBounds.length);
    this.upperBounds=temp;
  }
  this.upperBounds[index]=bound;
}

Fixed version (ground truth):
@Override public void addUpperBound(IType bound){
  int index=this.upperBoundCount++;
  if (index >= this.upperBounds.length) {
    IType[] temp=new IType[this.upperBoundCount];
    System.arraycopy(this.upperBounds,0,temp,0,index);
    this.upperBounds=temp;
  }
  this.upperBounds[index]=bound;
}
Program: 85022
Project: 85022
Buggy source:
@Override public IType getSuperType(){
  return null;
}

Fixed version (ground truth):
@Override public IType getSuperType(){
  return this.arrayDimensions > 0 ? Types.OBJECT : null;
}
Program: 85023
Project: 85023
Buggy source:
@Override public IType getConcreteType(ITypeContext context){
  IType t=context.resolveType(this.typeVar);
  if (t != null) {
    if (this.arrayDimensions > 0) {
      return t.getArrayType(this.arrayDimensions);
    }
    if (t.isPrimitive()) {
      return t.getReferenceType();
    }
    return t;
  }
  return this;
}

Fixed version (ground truth):
@Override public IType getConcreteType(ITypeContext context){
  if (context == null) {
    return this;
  }
  IType t=context.resolveType(this.typeVar);
  if (t != null) {
    if (this.arrayDimensions > 0) {
      return t.getArrayType(this.arrayDimensions);
    }
    if (t.isPrimitive()) {
      return t.getReferenceType();
    }
    return t;
  }
  return this;
}
Program: 85024
Project: 85024
Buggy source:
public TypeVariableType(ITypeVariable typeVar){
  this.typeVar=typeVar;
}

Fixed version (ground truth):
public TypeVariableType(ITypeVariable typeVar,int arrayDimensions){
  this.typeVar=typeVar;
  this.arrayDimensions=arrayDimensions;
}
Program: 85025
Project: 85025
Buggy source:
@Override public int getArrayDimensions(){
  return 0;
}

Fixed version (ground truth):
@Override public int getArrayDimensions(){
  return this.arrayDimensions;
}
Program: 85026
Project: 85026
Buggy source:
@Override public void setArrayDimensions(int dimensions){
}

Fixed version (ground truth):
@Override public void setArrayDimensions(int dimensions){
  this.arrayDimensions=dimensions;
}
Program: 85027
Project: 85027
Buggy source:
@Override public boolean isArrayType(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isArrayType(){
  return this.arrayDimensions > 0;
}
Program: 85028
Project: 85028
Buggy source:
@Override public void toString(String prefix,StringBuilder buffer){
  buffer.append(this.typeVar.getName());
}

Fixed version (ground truth):
@Override public void toString(String prefix,StringBuilder buffer){
  for (int i=0; i < this.arrayDimensions; i++) {
    buffer.append('[');
  }
  buffer.append(this.typeVar.getName());
  for (int i=0; i < this.arrayDimensions; i++) {
    buffer.append(']');
  }
}
Program: 85029
Project: 85029
Buggy source:
public default int getArrayStoreOpcode(){
  return Opcodes.ASTORE;
}

Fixed version (ground truth):
public default int getArrayStoreOpcode(){
  return Opcodes.AASTORE;
}
Program: 85030
Project: 85030
Buggy source:
@Override public IType resolve(MarkerList markers,IContext context){
  if (this.theClass != null) {
    return this;
  }
  IClass iclass;
  IType t=resolvePrimitive(this.name);
  if (t != null) {
    if (this.arrayDimensions == 0) {
      return t;
    }
    return t.getArrayType(this.arrayDimensions);
  }
 else   if (this.internalName != null) {
    iclass=Package.rootPackage.resolveInternalClass(this.internalName);
  }
 else {
    ITypeVariable typeVar=context.resolveTypeVariable(this.name);
    if (typeVar != null) {
      return new TypeVariableType(typeVar);
    }
    iclass=context.resolveClass(this.name);
  }
  if (iclass != null) {
    this.theClass=iclass;
    this.internalName=iclass.getInternalName();
    return this;
  }
  if (markers != null) {
    markers.add(this.position,"String_Node_Str",this.toString());
  }
  return this;
}

Fixed version (ground truth):
@Override public IType resolve(MarkerList markers,IContext context){
  if (this.theClass != null) {
    return this;
  }
  IClass iclass;
  IType t=resolvePrimitive(this.name);
  if (t != null) {
    if (this.arrayDimensions == 0) {
      return t;
    }
    return t.getArrayType(this.arrayDimensions);
  }
 else   if (this.internalName != null) {
    iclass=Package.rootPackage.resolveInternalClass(this.internalName);
  }
 else {
    ITypeVariable typeVar=context.resolveTypeVariable(this.name);
    if (typeVar != null) {
      return new TypeVariableType(typeVar,this.arrayDimensions);
    }
    iclass=context.resolveClass(this.name);
  }
  if (iclass != null) {
    this.theClass=iclass;
    this.internalName=iclass.getInternalName();
    return this;
  }
  if (markers != null) {
    markers.add(this.position,"String_Node_Str",this.toString());
  }
  return this;
}
Program: 85031
Project: 85031
Buggy source:
private static IType readType(String desc,int start,int end){
  int array=0;
  while (desc.charAt(start) == '[') {
    array++;
    start++;
  }
switch (desc.charAt(start)) {
case 'V':
    return Types.VOID.getArrayType(array);
case 'Z':
  return Types.BOOLEAN.getArrayType(array);
case 'B':
return Types.BYTE.getArrayType(array);
case 'S':
return Types.SHORT.getArrayType(array);
case 'C':
return Types.CHAR.getArrayType(array);
case 'I':
return Types.INT.getArrayType(array);
case 'J':
return Types.LONG.getArrayType(array);
case 'F':
return Types.FLOAT.getArrayType(array);
case 'D':
return Types.DOUBLE.getArrayType(array);
case 'L':
return readReferenceType(desc,start + 1,end - 1);
}
return null;
}

Fixed version (ground truth):
private static IType readType(String desc,int start,int end){
  int array=0;
  while (desc.charAt(start) == '[') {
    array++;
    start++;
  }
switch (desc.charAt(start)) {
case 'V':
    return Types.VOID.getArrayType(array);
case 'Z':
  return Types.BOOLEAN.getArrayType(array);
case 'B':
return Types.BYTE.getArrayType(array);
case 'S':
return Types.SHORT.getArrayType(array);
case 'C':
return Types.CHAR.getArrayType(array);
case 'I':
return Types.INT.getArrayType(array);
case 'J':
return Types.LONG.getArrayType(array);
case 'F':
return Types.FLOAT.getArrayType(array);
case 'D':
return Types.DOUBLE.getArrayType(array);
case 'T':
{
String s=desc.substring(start + 1,end - 1);
return new Type(s,Name.getQualified(s));
}
case 'L':
return readReferenceType(desc,start + 1,end - 1);
}
return null;
}
Program: 85032
Project: 85032
Buggy source:
@Override public IType resolve(MarkerList markers,IContext context){
  if (this.theClass != null) {
    return this;
  }
  IClass iclass;
  IType t=resolvePrimitive(this.name);
  if (t != null) {
    if (this.arrayDimensions == 0) {
      return t;
    }
    return t.getArrayType(this.arrayDimensions);
  }
 else   if (this.internalName != null) {
    iclass=Package.rootPackage.resolveInternalClass(this.internalName);
  }
 else {
    ITypeVariable typeVar=context.resolveTypeVariable(this.name);
    if (typeVar != null) {
      return new TypeVariableType(typeVar,this.arrayDimensions);
    }
    iclass=context.resolveClass(this.name);
  }
  if (iclass != null) {
    this.theClass=iclass;
    this.internalName=iclass.getInternalName();
    return this;
  }
  if (markers != null) {
    markers.add(this.position,"String_Node_Str",this.toString());
  }
  return this;
}

Fixed version (ground truth):
@Override public IType resolve(MarkerList markers,IContext context){
  if (this.theClass != null) {
    return this;
  }
  IClass iclass;
  IType t=resolvePrimitive(this.name);
  if (t != null) {
    if (this.arrayDimensions == 0) {
      return t;
    }
    return t.getArrayType(this.arrayDimensions);
  }
  if (this.internalName != null) {
    iclass=Package.rootPackage.resolveInternalClass(this.internalName);
  }
 else {
    ITypeVariable typeVar=context.resolveTypeVariable(this.name);
    if (typeVar != null) {
      return new TypeVariableType(typeVar,this.arrayDimensions);
    }
    iclass=context.resolveClass(this.name);
  }
  if (iclass != null) {
    this.theClass=iclass;
    this.internalName=iclass.getInternalName();
    return this;
  }
  if (markers != null) {
    markers.add(this.position,"String_Node_Str",this.toString());
  }
  return this;
}
Program: 85033
Project: 85033
Buggy source:
private static IType readType(String desc,int start,int end){
  int array=0;
  while (desc.charAt(start) == '[') {
    array++;
    start++;
  }
switch (desc.charAt(start)) {
case 'V':
    return Types.VOID.getArrayType(array);
case 'Z':
  return Types.BOOLEAN.getArrayType(array);
case 'B':
return Types.BYTE.getArrayType(array);
case 'S':
return Types.SHORT.getArrayType(array);
case 'C':
return Types.CHAR.getArrayType(array);
case 'I':
return Types.INT.getArrayType(array);
case 'J':
return Types.LONG.getArrayType(array);
case 'F':
return Types.FLOAT.getArrayType(array);
case 'D':
return Types.DOUBLE.getArrayType(array);
case 'T':
{
String s=desc.substring(start + 1,end);
return new Type(s,Name.getQualified(s));
}
case 'L':
return readReferenceType(desc,start + 1,end);
}
return null;
}

Fixed version (ground truth):
private static IType readType(String desc,int start,int end){
  int array=0;
  while (desc.charAt(start) == '[') {
    array++;
    start++;
  }
switch (desc.charAt(start)) {
case 'V':
    return Types.VOID.getArrayType(array);
case 'Z':
  return Types.BOOLEAN.getArrayType(array);
case 'B':
return Types.BYTE.getArrayType(array);
case 'S':
return Types.SHORT.getArrayType(array);
case 'C':
return Types.CHAR.getArrayType(array);
case 'I':
return Types.INT.getArrayType(array);
case 'J':
return Types.LONG.getArrayType(array);
case 'F':
return Types.FLOAT.getArrayType(array);
case 'D':
return Types.DOUBLE.getArrayType(array);
case 'T':
{
String s=desc.substring(start + 1,end);
return new Type(Name.getQualified(s));
}
case 'L':
return readReferenceType(desc,start + 1,end);
}
return null;
}
Program: 85034
Project: 85034
Buggy source:
@Override public ImmutableMap<K,V> $plus$plus(Map<? extends K,? extends V> map){
  return ((ImmutableMap<K,V>)map.immutable()).$plus(this.key,this.value);
}

Fixed version (ground truth):
@Override public ImmutableMap<K,V> $plus$plus(Map<? extends K,? extends V> map){
  int index=1;
  Tuple2<? extends K,? extends V>[] tuples=new Tuple2[1 + map.size()];
  tuples[0]=new Tuple2(this.key,this.value);
  for (  Tuple2<? extends K,? extends V> entry : map) {
    tuples[index++]=entry;
  }
  return new TupleMap(tuples,index);
}
Program: 85035
Project: 85035
Buggy source:
public HeaderComponent(ICodePosition position,boolean isStatic){
  this.position=position;
}

Fixed version (ground truth):
public HeaderComponent(ICodePosition position,boolean isStatic){
  this.position=position;
  this.isStatic=isStatic;
}
Program: 85036
Project: 85036
Buggy source:
@Override public void resolveTypes(MarkerList markers,IContext context,boolean using){
  if (using) {
    if (!(context instanceof IClass)) {
      markers.add(this.position,"String_Node_Str");
      return;
    }
    this.theClass=(CodeClass)context;
    return;
  }
  this.thePackage=(Package)context;
}

Fixed version (ground truth):
@Override public void resolveTypes(MarkerList markers,IContext context,boolean using){
  if (using) {
    if (!(context instanceof IClass)) {
      markers.add(this.position,"String_Node_Str");
      return;
    }
    this.theClass=(CodeClass)context;
    return;
  }
  if (!(context instanceof Package)) {
    markers.add(this.position,"String_Node_Str");
    return;
  }
  this.thePackage=(Package)context;
}
Program: 85037
Project: 85037
Buggy source:
@Override public void writeStatement(MethodWriter writer){
  this.write(writer,false);
}

Fixed version (ground truth):
@Override public void writeStatement(MethodWriter writer){
  org.objectweb.asm.Label tryStart=new org.objectweb.asm.Label();
  org.objectweb.asm.Label tryEnd=new org.objectweb.asm.Label();
  org.objectweb.asm.Label endLabel=new org.objectweb.asm.Label();
  writer.writeLabel(tryStart);
  if (this.action != null) {
    this.action.writeStatement(writer);
    writer.writeJumpInsn(Opcodes.GOTO,endLabel);
  }
  writer.writeLabel(tryEnd);
  for (int i=0; i < this.catchBlockCount; i++) {
    CatchBlock block=this.catchBlocks[i];
    org.objectweb.asm.Label handlerLabel=new org.objectweb.asm.Label();
    if (block.variable != null) {
      int localCount=writer.registerLocal();
      writer.writeLabel(handlerLabel);
      writer.writeVarInsn(Opcodes.ASTORE,localCount);
      block.variable.index=localCount;
      block.action.writeStatement(writer);
      writer.resetLocals(localCount);
    }
 else {
      writer.writeLabel(handlerLabel);
      writer.writeInsn(Opcodes.POP);
      block.action.writeStatement(writer);
    }
    writer.writeTryCatchBlock(tryStart,tryEnd,handlerLabel,block.type.getInternalName());
    writer.writeJumpInsn(Opcodes.GOTO,endLabel);
  }
  if (this.finallyBlock != null) {
    org.objectweb.asm.Label finallyLabel=new org.objectweb.asm.Label();
    writer.writeLabel(finallyLabel);
    writer.writeInsn(Opcodes.POP);
    writer.writeLabel(endLabel);
    this.finallyBlock.writeStatement(writer);
    writer.writeFinallyBlock(tryStart,tryEnd,finallyLabel);
  }
 else {
    writer.writeLabel(endLabel);
  }
}
Program: 85038
Project: 85038
Buggy source:
@Override public void writeExpression(MethodWriter writer){
  if (this.finallyBlock == null) {
    IType type1=this.action.getType();
    for (int i=0; i < this.catchBlockCount; i++) {
      writer.getClassWriter().addCommonType(type1,this.catchBlocks[i].action.getType(),this.commonType);
    }
  }
  this.write(writer,true);
}

Fixed version (ground truth):
@Override public void writeExpression(MethodWriter writer){
  this.commonType.writeDefaultValue(writer);
}
Program: 85039
Project: 85039
Buggy source:
private static void findUnits(File source,File output,Package pack){
  if (source.isDirectory()) {
    String name=source.getName();
    for (    String s : source.list()) {
      findUnits(new CodeFile(source,s),new File(output,s),pack == null ? Package.rootPackage : pack.createSubPackage(name));
    }
    return;
  }
  String fileName=source.getPath();
  if (!config.compileFile(fileName)) {
    return;
  }
  if (fileName.endsWith("String_Node_Str") || fileName.endsWith("String_Node_Str")) {
    return;
  }
  files.add(output);
  if (fileName.endsWith("String_Node_Str")) {
    DWTFile dwt=new DWTFile(pack,(CodeFile)source,output);
    units.add(dwt);
    return;
  }
  if (fileName.endsWith("String_Node_Str")) {
    DyvilUnit unit=new DyvilUnit(pack,(CodeFile)source,output);
    pack.addCompilationUnit(unit);
    units.add(unit);
    return;
  }
  if (fileName.endsWith("String_Node_Str")) {
    DyvilHeader header=new DyvilHeader(pack,(CodeFile)source,output);
    pack.addCompilationUnit(header);
    units.add(0,header);
    return;
  }
}

Fixed version (ground truth):
private static void findUnits(File source,File output,Package pack){
  if (source.isDirectory()) {
    String name=source.getName();
    for (    String s : source.list()) {
      findUnits(new CodeFile(source,s),new File(output,s),pack == null ? Package.rootPackage : pack.createSubPackage(name));
    }
    return;
  }
  String fileName=source.getPath();
  if (!config.compileFile(fileName)) {
    return;
  }
  if (fileName.endsWith("String_Node_Str") || fileName.endsWith("String_Node_Str")) {
    return;
  }
  files.add(output);
  if (fileName.endsWith("String_Node_Str")) {
    DWTFile dwt=new DWTFile(pack,(CodeFile)source,output);
    units.add(dwt);
    return;
  }
  if (fileName.endsWith("String_Node_Str") || fileName.endsWith("String_Node_Str")) {
    DyvilUnit unit=new DyvilUnit(pack,(CodeFile)source,output);
    pack.addCompilationUnit(unit);
    units.add(unit);
    return;
  }
  if (fileName.endsWith("String_Node_Str")) {
    DyvilHeader header=new DyvilHeader(pack,(CodeFile)source,output);
    pack.addCompilationUnit(header);
    units.add(0,header);
    return;
  }
}