nus-yam/ex-repair huggingface dataset:
Program: 82838
Project: 82838
Buggy source:
@Override public void resolveTypes(MarkerList markers,IContext context){
  if (context.isStatic()) {
    markers.add(Markers.semantic(this.position,"String_Node_Str"));
    return;
  }
  if (this.type != Types.UNKNOWN) {
    this.type=this.type.resolveType(markers,context);
    return;
  }
  final IClass enclosingClass=context.getThisClass();
  final IType superType=enclosingClass.getSuperType();
  if (superType == null) {
    final Marker marker=Markers.semantic(this.position,"String_Node_Str");
    marker.addInfo(Markers.getSemantic("String_Node_Str",enclosingClass.getClassType()));
    markers.add(marker);
    return;
  }
  this.type=superType;
}

Fixed version (ground truth):
@Override public void resolveTypes(MarkerList markers,IContext context){
  if (context.isStatic()) {
    markers.add(Markers.semantic(this.position,"String_Node_Str"));
    return;
  }
  if (this.type != Types.UNKNOWN) {
    this.type=this.type.resolveType(markers,context);
    if (this.type.isResolved()) {
      this.checkSuperType(markers,context);
    }
    return;
  }
  final IClass enclosingClass=context.getThisClass();
  final IType superType=enclosingClass.getSuperType();
  if (superType == null) {
    final Marker marker=Markers.semanticError(this.position,"String_Node_Str");
    marker.addInfo(Markers.getSemantic("String_Node_Str",enclosingClass.getClassType()));
    markers.add(marker);
    return;
  }
  this.type=superType;
}
Program: 82839
Project: 82839
Buggy source:
@Override public void resolveTypes(MarkerList markers,IContext context){
  if (this.type != Types.UNKNOWN) {
    this.type=this.type.resolveType(markers,context);
    return;
  }
  final IType thisType=context.getThisType();
  if (thisType != null) {
    this.type=thisType;
  }
 else {
    markers.add(Markers.semanticError(this.position,"String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void resolveTypes(MarkerList markers,IContext context){
  if (this.type != Types.UNKNOWN) {
    this.type=this.type.resolveType(markers,context);
    final IClass iclass=this.type.getTheClass();
    if (iclass != null) {
      this.type=iclass.getThisType();
    }
    return;
  }
  final IType thisType=context.getThisType();
  if (thisType != null) {
    this.type=thisType;
  }
 else {
    markers.add(Markers.semanticError(this.position,"String_Node_Str"));
  }
}
Program: 82840
Project: 82840
Buggy source:
@Override public void resolveTypes(MarkerList markers,IContext context){
  if (this.annotations != null) {
    this.annotations.resolveTypes(markers,context,this);
  }
  if (this.lowerBound != null) {
    this.lowerBound=this.lowerBound.resolveType(markers,context);
  }
  if (this.upperBound == null) {
    this.upperBound=DEFAULT_BOUND;
  }
  this.upperBound=this.upperBound.resolveType(markers,context);
  this.upperBounds=getUpperBounds(this.upperBound);
  IType type=this.upperBounds[0];
  IClass typeClass=type.getTheClass();
  if (typeClass != null && !typeClass.isInterface()) {
    this.erasure=type;
  }
  for (int i=1, count=this.upperBounds.length; i < count; i++) {
    type=this.upperBounds[i];
    typeClass=type.getTheClass();
    if (typeClass != null && !typeClass.hasModifier(Modifiers.INTERFACE_CLASS)) {
      final Marker marker=Markers.semanticError(type.getPosition(),"String_Node_Str");
      marker.addInfo(Markers.getSemantic("String_Node_Str",Util.classSignatureToString(typeClass)));
      markers.add(marker);
    }
  }
}

Fixed version (ground truth):
@Override public void resolveTypes(MarkerList markers,IContext context){
  if (this.annotations != null) {
    this.annotations.resolveTypes(markers,context,this);
  }
  if (this.lowerBound != null) {
    this.lowerBound=this.lowerBound.resolveType(markers,context);
  }
  if (this.upperBound == null) {
    this.upperBound=Types.NULLABLE_ANY;
  }
  this.upperBound=this.upperBound.resolveType(markers,context);
  this.upperBounds=getUpperBounds(this.upperBound);
  IType type=this.upperBounds[0];
  IClass typeClass=type.getTheClass();
  if (typeClass != null && !typeClass.isInterface()) {
    this.erasure=type;
  }
  for (int i=1, count=this.upperBounds.length; i < count; i++) {
    type=this.upperBounds[i];
    typeClass=type.getTheClass();
    if (typeClass != null && !typeClass.hasModifier(Modifiers.INTERFACE_CLASS)) {
      final Marker marker=Markers.semanticError(type.getPosition(),"String_Node_Str");
      marker.addInfo(Markers.getSemantic("String_Node_Str",Util.classSignatureToString(typeClass)));
      markers.add(marker);
    }
  }
}
Program: 82841
Project: 82841
Buggy source:
@Override public boolean isSuperTypeOf(IType subType){
  if (!isSuperType(this.getUpperBound(),subType)) {
    return false;
  }
  final IType lowerBound=this.getLowerBound();
  if (lowerBound != null) {
    if (!isSuperType(subType,lowerBound)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isSuperTypeOf(IType subType){
  if (!isSuperType(this.getSafeUpperBound(),subType)) {
    return false;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound == null || isSuperType(subType,lowerBound);
}
Program: 82842
Project: 82842
Buggy source:
@Override public boolean isSuperClassOf(IType subType){
  if (!isSuperClass(this.getUpperBound(),subType)) {
    return false;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound == null || isSuperClass(subType,lowerBound);
}

Fixed version (ground truth):
@Override public boolean isSuperClassOf(IType subType){
  if (!isSuperClass(this.getSafeUpperBound(),subType)) {
    return false;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound == null || isSuperClass(subType,lowerBound);
}
Program: 82843
Project: 82843
Buggy source:
@Override public boolean isAssignableFrom(IType type,ITypeContext typeContext){
  if (!Types.isSuperType(this.getUpperBound().getConcreteType(typeContext),type)) {
    return false;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound == null || Types.isSuperType(type,lowerBound.getConcreteType(typeContext));
}

Fixed version (ground truth):
@Override public boolean isAssignableFrom(IType type,ITypeContext typeContext){
  if (!Types.isSuperType(this.getSafeUpperBound().getConcreteType(typeContext),type)) {
    return false;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound == null || Types.isSuperType(type,lowerBound.getConcreteType(typeContext));
}
Program: 82844
Project: 82844
Buggy source:
@Override public boolean isSameType(IType type){
  if (Types.isSameType(type,this.getUpperBound())) {
    return true;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound != null && Types.isSameType(lowerBound,type);
}

Fixed version (ground truth):
@Override public boolean isSameType(IType type){
  if (Types.isSameType(type,this.getUpperBound())) {
    return true;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound == null || Types.isSameType(lowerBound,type);
}
Program: 82845
Project: 82845
Buggy source:
@Override public IClass getTheClass(){
  return this.getUpperBound().getTheClass();
}

Fixed version (ground truth):
@Override public IClass getTheClass(){
  return this.getSafeUpperBound().getTheClass();
}
Program: 82846
Project: 82846
Buggy source:
@Override public void getImplicitMatches(MatchList<IMethod> list,IValue value,IType targetType){
  this.getUpperBound().getImplicitMatches(list,value,targetType);
}

Fixed version (ground truth):
@Override public void getImplicitMatches(MatchList<IMethod> list,IValue value,IType targetType){
  this.getSafeUpperBound().getImplicitMatches(list,value,targetType);
}
Program: 82847
Project: 82847
Buggy source:
@Override public boolean isSubClassOf(IType superType){
  if (isSuperClass(superType,this.getUpperBound())) {
    return true;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound != null && isSuperClass(lowerBound,superType) || Types.isSameClass(superType,Types.OBJECT);
}

Fixed version (ground truth):
@Override public boolean isSubClassOf(IType superType){
  return isSuperClass(superType,this.getUpperBound());
}
Program: 82848
Project: 82848
Buggy source:
@Override public IDataMember resolveField(Name name){
  return this.getUpperBound().resolveField(name);
}

Fixed version (ground truth):
@Override public IDataMember resolveField(Name name){
  return this.getSafeUpperBound().resolveField(name);
}
Program: 82849
Project: 82849
Buggy source:
@Override public void getMethodMatches(MatchList<IMethod> list,IValue instance,Name name,IArguments arguments){
  this.getUpperBound().getMethodMatches(list,instance,name,arguments);
}

Fixed version (ground truth):
@Override public void getMethodMatches(MatchList<IMethod> list,IValue instance,Name name,IArguments arguments){
  this.getSafeUpperBound().getMethodMatches(list,instance,name,arguments);
}
Program: 82850
Project: 82850
Buggy source:
@Override public boolean isSameClass(IType type){
  if (Types.isSameClass(type,this.getUpperBound())) {
    return true;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound != null && Types.isSameClass(lowerBound,type);
}

Fixed version (ground truth):
@Override public boolean isSameClass(IType type){
  if (Types.isSameClass(type,this.getUpperBound())) {
    return true;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound == null || Types.isSameClass(lowerBound,type);
}
Program: 82851
Project: 82851
Buggy source:
@Override public void toString(String prefix,StringBuilder buffer){
  if (this.annotations != null) {
    for (int i=0, size=this.annotations.annotationCount(); i < size; i++) {
      this.annotations.getAnnotation(i).toString(prefix,buffer);
      buffer.append(' ');
    }
  }
  buffer.append("String_Node_Str");
  this.variance.appendPrefix(buffer);
  buffer.append(this.name);
  final IType upperBound=this.getUpperBound();
  if (upperBound != null) {
    buffer.append("String_Node_Str");
    upperBound.toString(prefix,buffer);
  }
  final IType lowerBound=this.getLowerBound();
  if (lowerBound != null) {
    buffer.append("String_Node_Str");
    lowerBound.toString(prefix,buffer);
  }
}

Fixed version (ground truth):
@Override public void toString(String prefix,StringBuilder buffer){
  if (this.annotations != null) {
    for (int i=0, size=this.annotations.annotationCount(); i < size; i++) {
      this.annotations.getAnnotation(i).toString(prefix,buffer);
      buffer.append(' ');
    }
  }
  buffer.append("String_Node_Str");
  this.variance.appendPrefix(buffer);
  buffer.append(this.name);
  final IType upperBound=this.getSafeUpperBound();
  if (upperBound != null) {
    buffer.append("String_Node_Str");
    upperBound.toString(prefix,buffer);
  }
  final IType lowerBound=this.getLowerBound();
  if (lowerBound != null) {
    buffer.append("String_Node_Str");
    lowerBound.toString(prefix,buffer);
  }
}
Program: 82852
Project: 82852
Buggy source:
@Override public boolean isSubTypeOf(IType superType){
  if (isSuperType(superType,this.getUpperBound())) {
    return true;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound != null && isSuperType(lowerBound,superType) || Types.isExactType(superType,Types.OBJECT);
}

Fixed version (ground truth):
@Override public boolean isSubTypeOf(IType superType){
  return isSuperType(superType,this.getUpperBound());
}
Program: 82853
Project: 82853
Buggy source:
@Override public boolean isSuperTypeOf(IType subType){
  if (subType.hasTag(IType.NULL)) {
    return true;
  }
  final NullableType nullable=subType.extract(NullableType.class);
  return Types.isSuperType(this.type,nullable != null ? nullable.getElementType() : subType);
}

Fixed version (ground truth):
@Override public boolean isSuperTypeOf(IType subType){
  if (subType.hasTag(IType.NULL)) {
    return true;
  }
  final NullableType nullable=subType.extract(NullableType.class);
  if (nullable != null) {
    return Types.isSuperType(this,nullable.getElementType());
  }
  return Types.isSuperType(this.type,subType);
}
Program: 82854
Project: 82854
Buggy source:
@Override public void checkType(MarkerList markers,IContext context,int position){
  ModifierUtil.checkVisibility(this.theClass,this.position,markers,context);
  final int count=Math.min(this.typeArgumentCount,this.theClass.typeParameterCount());
  for (int i=0; i < count; i++) {
    final ITypeParameter typeVariable=this.theClass.getTypeParameter(i);
    final IType type=this.typeArguments[i];
    if (type.isResolved() && !typeVariable.isSuperTypeOf(type)) {
      final Marker marker=Markers.semanticError(type.getPosition(),"String_Node_Str",typeVariable.getName().qualified,this.theClass.getFullName());
      marker.addInfo(Markers.getSemantic("String_Node_Str",type));
      marker.addInfo(Markers.getSemantic("String_Node_Str",typeVariable));
      markers.add(marker);
    }
  }
  if ((position & TypePosition.GENERIC_FLAG) == 0) {
    markers.add(Markers.semanticError(this.position,"String_Node_Str"));
  }
  super.checkType(markers,context,position);
}

Fixed version (ground truth):
@Override public void checkType(MarkerList markers,IContext context,int position){
  ModifierUtil.checkVisibility(this.theClass,this.position,markers,context);
  final int count=Math.min(this.typeArgumentCount,this.theClass.typeParameterCount());
  for (int i=0; i < count; i++) {
    final ITypeParameter typeVariable=this.theClass.getTypeParameter(i);
    final IType typeArgument=this.typeArguments[i];
    if (typeArgument.isResolved() && !Variance.checkCompatible(Variance.COVARIANT,typeVariable.getCovariantType(),typeArgument)) {
      final Marker marker=Markers.semanticError(typeArgument.getPosition(),"String_Node_Str",typeVariable.getName().qualified,this.theClass.getFullName());
      marker.addInfo(Markers.getSemantic("String_Node_Str",typeArgument));
      marker.addInfo(Markers.getSemantic("String_Node_Str",typeVariable));
      markers.add(marker);
    }
  }
  if ((position & TypePosition.GENERIC_FLAG) == 0) {
    markers.add(Markers.semanticError(this.position,"String_Node_Str"));
  }
  super.checkType(markers,context,position);
}
Program: 82855
Project: 82855
Buggy source:
@Override public boolean isSuperTypeOf(IType subType){
  return this.typeParameter.isAssignableFrom(subType,ITypeContext.COVARIANT);
}

Fixed version (ground truth):
@Override public boolean isSuperTypeOf(IType subType){
  return this.backReference || this.typeParameter.isAssignableFrom(subType,ITypeContext.COVARIANT);
}
Program: 82856
Project: 82856
Buggy source:
@Override public boolean isSameType(IType type){
  return this.typeParameter.isSuperTypeOf(type);
}

Fixed version (ground truth):
@Override public boolean isSameType(IType type){
  return this.backReference || this.typeParameter.isSuperTypeOf(type);
}
Program: 82857
Project: 82857
Buggy source:
public CovariantTypeVarType(ITypeParameter typeVariable){
  super(typeVariable);
}

Fixed version (ground truth):
public CovariantTypeVarType(ITypeParameter typeParameter,boolean backReference){
  super(typeParameter);
  this.backReference=backReference;
}
Program: 82858
Project: 82858
Buggy source:
@Override public boolean isSubTypeOf(IType superType){
  return this.typeParameter.isSuperTypeOf(superType);
}

Fixed version (ground truth):
@Override public boolean isSubTypeOf(IType superType){
  return this.backReference || this.typeParameter.isSuperTypeOf(superType);
}
Program: 82859
Project: 82859
Buggy source:
@Override public IType getConcreteType(ITypeContext context){
  IType type=super.getConcreteType(context);
  final TypeVarType typeVar=type.extract(TypeVarType.class);
  return typeVar != null && typeVar.getTypeVariable() == this.typeParameter ? this : type;
}

Fixed version (ground truth):
@Override public IType getConcreteType(ITypeContext context){
  final IType type=super.getConcreteType(context);
  final TypeVarType typeVar=type.extract(TypeVarType.class);
  return typeVar != null && typeVar.getTypeVariable() == this.typeParameter ? this : type;
}
Program: 82860
Project: 82860
Buggy source:
public CodeTypeParameter(ICodePosition position,ITypeParametric generic,Name name,Variance variance){
  super(generic,name,variance);
  this.position=position;
  this.upperBound=Types.OBJECT;
}

Fixed version (ground truth):
public CodeTypeParameter(ICodePosition position,ITypeParametric generic,Name name,Variance variance){
  super(generic,name,variance);
  this.position=position;
}
Program: 82861
Project: 82861
Buggy source:
@Override public void resolveTypes(MarkerList markers,IContext context){
  if (this.annotations != null) {
    this.annotations.resolveTypes(markers,context,this);
  }
  if (this.lowerBound != null) {
    this.lowerBound=this.lowerBound.resolveType(markers,context);
  }
  if (this.upperBound == null) {
    return;
  }
  this.upperBound=this.upperBound.resolveType(markers,context);
  this.upperBounds=getUpperBounds(this.upperBound);
  IType type=this.upperBounds[0];
  IClass typeClass=type.getTheClass();
  if (typeClass != null && !typeClass.isInterface()) {
    this.erasure=type;
  }
  for (int i=1, count=this.upperBounds.length; i < count; i++) {
    type=this.upperBounds[i];
    typeClass=type.getTheClass();
    if (typeClass != null && !typeClass.hasModifier(Modifiers.INTERFACE_CLASS)) {
      final Marker marker=Markers.semanticError(type.getPosition(),"String_Node_Str");
      marker.addInfo(Markers.getSemantic("String_Node_Str",Util.classSignatureToString(typeClass)));
      markers.add(marker);
    }
  }
}

Fixed version (ground truth):
@Override public void resolveTypes(MarkerList markers,IContext context){
  if (this.annotations != null) {
    this.annotations.resolveTypes(markers,context,this);
  }
  if (this.lowerBound != null) {
    this.lowerBound=this.lowerBound.resolveType(markers,context);
  }
  if (this.upperBound == null) {
    this.upperBound=DEFAULT_BOUND;
  }
  this.upperBound=this.upperBound.resolveType(markers,context);
  this.upperBounds=getUpperBounds(this.upperBound);
  IType type=this.upperBounds[0];
  IClass typeClass=type.getTheClass();
  if (typeClass != null && !typeClass.isInterface()) {
    this.erasure=type;
  }
  for (int i=1, count=this.upperBounds.length; i < count; i++) {
    type=this.upperBounds[i];
    typeClass=type.getTheClass();
    if (typeClass != null && !typeClass.hasModifier(Modifiers.INTERFACE_CLASS)) {
      final Marker marker=Markers.semanticError(type.getPosition(),"String_Node_Str");
      marker.addInfo(Markers.getSemantic("String_Node_Str",Util.classSignatureToString(typeClass)));
      markers.add(marker);
    }
  }
}
Program: 82862
Project: 82862
Buggy source:
@Override public boolean isAssignableFrom(IType type,ITypeContext typeContext){
  if (!Types.isAssignable(this.getUpperBound().getConcreteType(typeContext),type)) {
    return false;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound == null || Types.isAssignable(type,lowerBound.getConcreteType(typeContext));
}

Fixed version (ground truth):
@Override public boolean isAssignableFrom(IType type,ITypeContext typeContext){
  if (!Types.isSuperType(this.getUpperBound().getConcreteType(typeContext),type)) {
    return false;
  }
  final IType lowerBound=this.getLowerBound();
  return lowerBound == null || Types.isSuperType(type,lowerBound.getConcreteType(typeContext));
}
Program: 82863
Project: 82863
Buggy source:
@Override public IValue convertValueTo(IValue value,IType targetType,ITypeContext typeContext,MarkerList markers,IContext context){
  if (!this.isConvertibleTo(targetType)) {
    return null;
  }
  final LiteralConversion conversion=new LiteralConversion(value,LazyTypes.UNWRAP);
  conversion.setType(targetType);
  return conversion;
}

Fixed version (ground truth):
@Override public IValue convertValueTo(IValue value,IType targetType,ITypeContext typeContext,MarkerList markers,IContext context){
  if (!this.isConvertibleTo(targetType)) {
    return null;
  }
  final LiteralConversion conversion=new LiteralConversion(value,LazyTypes.UNWRAP);
  conversion.setType(this.type);
  return conversion;
}
Program: 82865
Project: 82865
Buggy source:
protected void addVariable(FieldInitializer initializer,MarkerList markers,IContext context){
  final IVariable variable=initializer.variable;
  final Name variableName=variable.getName();
  if (variable.getValue() == null) {
    variable.setValue(variable.getType().getDefaultValue());
    markers.add(Markers.semanticError(this.position,"String_Node_Str",variableName));
  }
  final IDataMember dataMember=context.resolveField(variableName);
  if (dataMember != null && dataMember.isVariable()) {
    markers.add(Markers.semantic(initializer.getPosition(),"String_Node_Str",variableName));
  }
  if (this.variables == null) {
    this.variables=new ArrayList<>();
  }
  this.variables.add(variable);
}

Fixed version (ground truth):
protected void addVariable(FieldInitializer initializer,MarkerList markers,IContext context){
  final IVariable variable=initializer.variable;
  final Name variableName=variable.getName();
  if (variable.getValue() == null) {
    variable.setValue(variable.getType().getDefaultValue());
    markers.add(Markers.semanticError(variable.getPosition(),"String_Node_Str",variableName));
  }
  final IDataMember dataMember=context.resolveField(variableName);
  if (dataMember != null && dataMember.isVariable()) {
    markers.add(Markers.semantic(initializer.getPosition(),"String_Node_Str",variableName));
  }
  if (this.variables == null) {
    this.variables=new ArrayList<>();
  }
  this.variables.add(variable);
}
Program: 82866
Project: 82866
Buggy source:
@Override public void writeInnerClassInfo(ClassWriter writer){
  if (this.enclosingClass != null) {
    int modifiers=this.modifiers.toFlags() & 0x761F;
    if ((modifiers & Modifiers.INTERFACE_CLASS) != Modifiers.INTERFACE_CLASS) {
      modifiers|=Modifiers.STATIC;
    }
 else {
      modifiers&=~Modifiers.STATIC;
    }
    final String outerName=this.enclosingClass.getInternalName();
    writer.visitInnerClass(this.getInternalName(),outerName,this.name.qualified,modifiers);
    writer.visitOuterClass(outerName,null,null);
  }
}

Fixed version (ground truth):
@Override public void writeInnerClassInfo(ClassWriter writer){
  if (this.enclosingClass != null) {
    int modifiers=this.modifiers.toFlags() & 0x761F;
    if ((modifiers & Modifiers.INTERFACE_CLASS) != Modifiers.INTERFACE_CLASS) {
      modifiers|=Modifiers.STATIC;
    }
 else {
      modifiers&=~Modifiers.STATIC;
    }
    final String outerName=this.enclosingClass.getInternalName();
    writer.visitInnerClass(this.getInternalName(),outerName,this.name.qualified,modifiers);
  }
}
Program: 82867
Project: 82867
Buggy source:
protected void writeField(ClassWriter writer,int modifiers,String name,String descriptor){
  final String signature=this.type.needsSignature() ? this.getSignature() : null;
  final Object value;
  if (this.value != null && this.hasModifier(Modifiers.STATIC) && this.hasConstantValue()) {
    value=this.value.toObject();
  }
 else {
    value=null;
  }
  final FieldVisitor fieldVisitor=writer.visitField(modifiers,name,descriptor,signature,value);
  IField.writeAnnotations(fieldVisitor,this.modifiers,this.annotations,this.type);
  fieldVisitor.visitEnd();
}

Fixed version (ground truth):
protected void writeField(ClassWriter writer,int modifiers,String name,String descriptor){
  final String signature=this.getType().needsSignature() ? this.getSignature() : null;
  final Object value;
  if (this.value != null && this.hasModifier(Modifiers.STATIC) && this.hasConstantValue()) {
    value=this.value.toObject();
  }
 else {
    value=null;
  }
  final FieldVisitor fieldVisitor=writer.visitField(modifiers,name,descriptor,signature,value);
  IField.writeAnnotations(fieldVisitor,this.modifiers,this.annotations,this.type);
  fieldVisitor.visitEnd();
}
Program: 82868
Project: 82868
Buggy source:
private RetentionPolicy getRetention(){
  return this.type.getTheClass().getMetadata().getRetention();
}

Fixed version (ground truth):
private RetentionPolicy getRetention(){
  final IClass type=this.type.getTheClass();
  return type == null ? null : type.getMetadata().getRetention();
}
Program: 82869
Project: 82869
Buggy source:
private IType resolveTopLevelWith(MarkerList markers,IContext context){
  final IClass theClass=context.resolveClass(this.name);
  if (theClass != null) {
    final IType classType=theClass.getThisType();
    return this.checkCount(markers,theClass,"String_Node_Str",classType);
  }
  final ITypeParameter typeParameter=context.resolveTypeParameter(this.name);
  if (typeParameter != null) {
    markers.add(Markers.semanticError(this.position,"String_Node_Str",typeParameter.getName()));
    return new ResolvedTypeVarType(typeParameter,this.position);
  }
  final ITypeAlias typeAlias=context.resolveTypeAlias(this.name,this.typeArgumentCount);
  if (typeAlias != null) {
    final IType type=typeAlias.getType();
    return this.checkCount(markers,typeAlias,"String_Node_Str",type);
  }
  return null;
}

Fixed version (ground truth):
private IType resolveTopLevelWith(MarkerList markers,IContext context){
  final IClass theClass=context.resolveClass(this.name);
  if (theClass != null) {
    final IType classType=theClass.getThisType();
    return this.checkCount(markers,theClass,"String_Node_Str",classType);
  }
  final ITypeParameter typeParameter=context.resolveTypeParameter(this.name);
  if (typeParameter != null) {
    markers.add(Markers.semanticError(this.position,"String_Node_Str",typeParameter.getName()));
    return new ResolvedTypeVarType(typeParameter,this.position);
  }
  final ITypeAlias typeAlias=context.resolveTypeAlias(this.name,this.typeArgumentCount);
  if (typeAlias != null) {
    final IType aliasType=typeAlias.getType();
    if (!aliasType.isResolved()) {
      markers.add(Markers.semanticError(this.position,"String_Node_Str",this.name));
      return aliasType.atPosition(this.position);
    }
    return this.checkCount(markers,typeAlias,"String_Node_Str",aliasType);
  }
  return null;
}
Program: 82870
Project: 82870
Buggy source:
private IType resolveTopLevelWith(@SuppressWarnings("String_Node_Str") MarkerList markers,IContext context){
  final IClass theClass=context.resolveClass(this.name);
  if (theClass != null) {
    return new ResolvedClassType(theClass,this.position);
  }
  final ITypeParameter typeParameter=context.resolveTypeParameter(this.name);
  if (typeParameter != null) {
    return new ResolvedTypeVarType(typeParameter,this.position);
  }
  final ITypeAlias type=context.resolveTypeAlias(this.name,0);
  if (type != null) {
    return type.getType().getConcreteType(ITypeContext.DEFAULT).atPosition(this.position);
  }
  return null;
}

Fixed version (ground truth):
private IType resolveTopLevelWith(@SuppressWarnings("String_Node_Str") MarkerList markers,IContext context){
  final IClass theClass=context.resolveClass(this.name);
  if (theClass != null) {
    return new ResolvedClassType(theClass,this.position);
  }
  final ITypeParameter typeParameter=context.resolveTypeParameter(this.name);
  if (typeParameter != null) {
    return new ResolvedTypeVarType(typeParameter,this.position);
  }
  final ITypeAlias type=context.resolveTypeAlias(this.name,0);
  if (type != null) {
    final IType aliasType=type.getType();
    if (!aliasType.isResolved()) {
      markers.add(Markers.semanticError(this.position,"String_Node_Str",this.name));
      return aliasType.atPosition(this.position);
    }
    return aliasType.getConcreteType(ITypeContext.DEFAULT).atPosition(this.position);
  }
  return null;
}
Program: 82871
Project: 82871
Buggy source:
public void findFiles(File sourceDir,File targetDir){
  final String[] subFiles=sourceDir.list();
  if (subFiles == null) {
    return;
  }
  Map<String,Template> templates=new HashMap<>();
  List<Specialization> specializations=new ArrayList<>();
  for (  String subFile : subFiles) {
    final File sourceFile=new File(sourceDir,subFile);
    if (sourceFile.isDirectory()) {
      this.findFiles(sourceFile,new File(targetDir,subFile));
      continue;
    }
    final int endIndex=subFile.length() - 4;
    if (subFile.endsWith("String_Node_Str")) {
      final String fileName=subFile.substring(0,endIndex);
      templates.put(fileName,new Template(sourceFile,targetDir,fileName));
    }
 else     if (subFile.endsWith("String_Node_Str")) {
      final int dashIndex=subFile.lastIndexOf('-',endIndex);
      final String fileName=subFile.substring(0,dashIndex);
      final String specName=subFile.substring(dashIndex + 1,endIndex);
      specializations.add(new Specialization(sourceFile,fileName,specName));
    }
  }
  for (  Specialization spec : specializations) {
    this.specs.put(spec.getSourceFile(),spec);
    final Template template=templates.get(spec.getTemplateName());
    if (template == null) {
      continue;
    }
    spec.setTemplate(template);
    template.addSpecialization(spec);
  }
  this.templates.addAll(templates.values());
}

Fixed version (ground truth):
public void findFiles(File sourceDir,File targetDir){
  final String[] subFiles=sourceDir.list();
  if (subFiles == null) {
    return;
  }
  Map<String,Template> templates=new HashMap<>();
  List<Specialization> specializations=new ArrayList<>();
  for (  String subFile : subFiles) {
    final File sourceFile=new File(sourceDir,subFile);
    if (sourceFile.isDirectory()) {
      this.findFiles(sourceFile,new File(targetDir,subFile));
      continue;
    }
    final int endIndex=subFile.length() - 4;
    if (subFile.endsWith("String_Node_Str")) {
      final String fileName=subFile.substring(0,endIndex);
      templates.put(fileName,new Template(sourceFile,targetDir,fileName));
    }
 else     if (subFile.endsWith("String_Node_Str")) {
      final int dashIndex=subFile.lastIndexOf('-',endIndex);
      final Specialization spec;
      if (dashIndex < 0) {
        spec=new Specialization(sourceFile,subFile.substring(0,endIndex));
      }
 else {
        final String fileName=subFile.substring(0,dashIndex);
        final String specName=subFile.substring(dashIndex + 1,endIndex);
        spec=new Specialization(sourceFile,fileName,specName);
      }
      specializations.add(spec);
    }
  }
  for (  Specialization spec : specializations) {
    this.specs.put(spec.getSourceFile(),spec);
    final Template template=templates.get(spec.getTemplateName());
    if (template == null) {
      continue;
    }
    spec.setTemplate(template);
    template.addSpecialization(spec);
  }
  this.templates.addAll(templates.values());
}
Program: 82873
Project: 82873
Buggy source:
private boolean isConvertibleFrom(IType type){
  return type.getAnnotation(MapType.MapTypes.MAP_CONVERTIBLE_CLASS) != null;
}

Fixed version (ground truth):
private boolean isConvertibleFrom(IType type){
  return type.getAnnotation(LazyTypes.MAP_CONVERTIBLE_CLASS) != null;
}
Program: 82874
Project: 82874
Buggy source:
@Override public IValue withType(IType mapType,ITypeContext typeContext,MarkerList markers,IContext context){
  if (!MapType.MapTypes.MAP_CLASS.isSubClassOf(mapType)) {
    IAnnotation annotation=mapType.getTheClass().getAnnotation(MapType.MapTypes.MAP_CONVERTIBLE_CLASS);
    if (annotation != null) {
      ArgumentList arguments=new ArgumentList(new IValue[]{new ArrayExpr(this.keys,this.count),new ArrayExpr(this.values,this.count)},2);
      return new LiteralConversion(this,annotation,arguments).withType(mapType,typeContext,markers,context);
    }
    return null;
  }
  final IType keyType=this.keyType=Types.resolveTypeSafely(mapType,MapType.MapTypes.KEY_VARIABLE);
  final IType valueType=this.valueType=Types.resolveTypeSafely(mapType,MapType.MapTypes.VALUE_VARIABLE);
  for (int i=0; i < this.count; i++) {
    this.keys[i]=TypeChecker.convertValue(this.keys[i],keyType,typeContext,markers,context,KEY_MARKER_SUPPLIER);
    this.values[i]=TypeChecker.convertValue(this.values[i],valueType,typeContext,markers,context,VALUE_MARKER_SUPPLIER);
  }
  return this;
}

Fixed version (ground truth):
@Override public IValue withType(IType mapType,ITypeContext typeContext,MarkerList markers,IContext context){
  if (!MapType.MapTypes.MAP_CLASS.isSubClassOf(mapType)) {
    IAnnotation annotation=mapType.getTheClass().getAnnotation(LazyTypes.MAP_CONVERTIBLE_CLASS);
    if (annotation != null) {
      ArgumentList arguments=new ArgumentList(new IValue[]{new ArrayExpr(this.keys,this.count),new ArrayExpr(this.values,this.count)},2);
      return new LiteralConversion(this,annotation,arguments).withType(mapType,typeContext,markers,context);
    }
    return null;
  }
  final IType keyType=this.keyType=Types.resolveTypeSafely(mapType,MapType.MapTypes.KEY_VARIABLE);
  final IType valueType=this.valueType=Types.resolveTypeSafely(mapType,MapType.MapTypes.VALUE_VARIABLE);
  for (int i=0; i < this.count; i++) {
    this.keys[i]=TypeChecker.convertValue(this.keys[i],keyType,typeContext,markers,context,KEY_MARKER_SUPPLIER);
    this.values[i]=TypeChecker.convertValue(this.values[i],valueType,typeContext,markers,context,VALUE_MARKER_SUPPLIER);
  }
  return this;
}
Program: 82875
Project: 82875
Buggy source:
@Override public IValue checkAccess(MarkerList markers,ICodePosition position,IValue receiver,IContext context){
  if (receiver != null) {
    if (this.modifiers.hasIntModifier(Modifiers.STATIC)) {
      if (receiver.isClassAccess()) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
 else       if (receiver.getType().getTheClass() != this.enclosingClass) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name,this.enclosingClass.getFullName()));
      }
      receiver=null;
    }
 else     if (receiver.isClassAccess()) {
      if (!receiver.getType().getTheClass().isObject()) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
    }
 else {
      IType type=this.enclosingClass.getClassType();
      receiver=TypeChecker.convertValue(receiver,type,type,markers,context,TypeChecker.markerSupplier("String_Node_Str",this.name));
    }
  }
 else   if (!this.modifiers.hasIntModifier(Modifiers.STATIC)) {
    if (context.isStatic()) {
      markers.add(Markers.semantic(position,"String_Node_Str",this.name));
    }
 else {
      markers.add(Markers.semantic(position,"String_Node_Str",this.name.unqualified));
      receiver=new ThisExpr(position,this.enclosingClass.getType(),context,markers);
    }
  }
  ModifierUtil.checkVisibility(this,position,markers,context);
  return receiver;
}

Fixed version (ground truth):
@Override public IValue checkAccess(MarkerList markers,ICodePosition position,IValue receiver,IContext context){
  if (receiver != null) {
    if (this.modifiers.hasIntModifier(Modifiers.STATIC)) {
      if (!receiver.isClassAccess()) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
 else       if (receiver.getType().getTheClass() != this.enclosingClass) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name,this.enclosingClass.getFullName()));
      }
      receiver=receiver.asIgnoredClassAccess();
    }
 else     if (receiver.isClassAccess()) {
      if (!receiver.getType().getTheClass().isObject()) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
    }
 else {
      IType type=this.enclosingClass.getClassType();
      receiver=TypeChecker.convertValue(receiver,type,type,markers,context,TypeChecker.markerSupplier("String_Node_Str",this.name));
    }
  }
 else   if (!this.modifiers.hasIntModifier(Modifiers.STATIC)) {
    if (context.isStatic()) {
      markers.add(Markers.semantic(position,"String_Node_Str",this.name));
    }
 else {
      markers.add(Markers.semantic(position,"String_Node_Str",this.name.unqualified));
      receiver=new ThisExpr(position,this.enclosingClass.getType(),context,markers);
    }
  }
  ModifierUtil.checkVisibility(this,position,markers,context);
  return receiver;
}
Program: 82876
Project: 82876
Buggy source:
@Override public void writeClassInit(MethodWriter writer) throws BytecodeException {
  if (this.traitInit) {
    writer.visitVarInsn(Opcodes.ALOAD,0);
    writer.visitMethodInsn(Opcodes.INVOKEVIRTUAL,this.getInternalName(),TraitMetadata.INIT_NAME,"String_Node_Str",false);
  }
  this.metadata.writeClassInit(writer);
  if (this.body != null) {
    for (int i=0, count=this.body.fieldCount(); i < count; i++) {
      this.body.getField(i).writeClassInit(writer);
    }
    for (int i=0, count=this.body.propertyCount(); i < count; i++) {
      this.body.getProperty(i).writeClassInit(writer);
    }
    for (int i=0, count=this.body.initializerCount(); i < count; i++) {
      this.body.getInitializer(i).writeClassInit(writer);
    }
  }
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].writeClassInit(writer);
  }
}

Fixed version (ground truth):
@Override public void writeClassInit(MethodWriter writer) throws BytecodeException {
  if (this.traitInit) {
    writer.visitVarInsn(Opcodes.ALOAD,0);
    writer.visitMethodInsn(Opcodes.INVOKEVIRTUAL,this.getInternalName(),TraitMetadata.INIT_NAME,"String_Node_Str",false);
  }
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].writeClassInit(writer);
  }
  this.metadata.writeClassInit(writer);
  if (this.body == null) {
    return;
  }
  for (int i=0, count=this.body.fieldCount(); i < count; i++) {
    this.body.getField(i).writeClassInit(writer);
  }
  for (int i=0, count=this.body.propertyCount(); i < count; i++) {
    this.body.getProperty(i).writeClassInit(writer);
  }
  for (int i=0, count=this.body.initializerCount(); i < count; i++) {
    this.body.getInitializer(i).writeClassInit(writer);
  }
}
Program: 82877
Project: 82877
Buggy source:
@Override public void writeStaticInit(MethodWriter writer) throws BytecodeException {
  this.metadata.writeStaticInit(writer);
  if (this.body != null) {
    for (int i=0, count=this.body.fieldCount(); i < count; i++) {
      this.body.getField(i).writeStaticInit(writer);
    }
    for (int i=0, count=this.body.propertyCount(); i < count; i++) {
      this.body.getProperty(i).writeStaticInit(writer);
    }
    for (int i=0, count=this.body.initializerCount(); i < count; i++) {
      this.body.getInitializer(i).writeStaticInit(writer);
    }
  }
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].writeStaticInit(writer);
  }
}

Fixed version (ground truth):
@Override public void writeStaticInit(MethodWriter writer) throws BytecodeException {
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].writeStaticInit(writer);
  }
  this.metadata.writeStaticInit(writer);
  if (this.body == null) {
    return;
  }
  for (int i=0, count=this.body.fieldCount(); i < count; i++) {
    this.body.getField(i).writeStaticInit(writer);
  }
  for (int i=0, count=this.body.propertyCount(); i < count; i++) {
    this.body.getProperty(i).writeStaticInit(writer);
  }
  for (int i=0, count=this.body.initializerCount(); i < count; i++) {
    this.body.getInitializer(i).writeStaticInit(writer);
  }
}
Program: 82878
Project: 82878
Buggy source:
@Override public void appendSignature(StringBuilder buffer){
  buffer.append(this.name).append(':');
  if (this.upperBoundCount <= 0) {
    buffer.append("String_Node_Str");
    return;
  }
  if (this.upperBounds[0].getTheClass().isInterface()) {
    buffer.append(':');
  }
  this.upperBounds[0].appendSignature(buffer,false);
  for (int i=1; i < this.upperBoundCount; i++) {
    buffer.append(':');
    this.upperBounds[i].appendSignature(buffer,false);
  }
}

Fixed version (ground truth):
@Override public void appendSignature(StringBuilder buffer){
  buffer.append(this.name).append(':');
  if (this.upperBoundCount <= 0) {
    buffer.append("String_Node_Str");
    return;
  }
  final IClass theClass=this.upperBounds[0].getTheClass();
  if (theClass != null && theClass.isInterface()) {
    buffer.append(':');
  }
  this.upperBounds[0].appendSignature(buffer,false);
  for (int i=1; i < this.upperBoundCount; i++) {
    buffer.append(':');
    this.upperBounds[i].appendSignature(buffer,false);
  }
}
Program: 82879
Project: 82879
Buggy source:
@Override public boolean isResolved(){
  return this.type != null;
}

Fixed version (ground truth):
@Override public boolean isResolved(){
  return this.left.isResolved() && this.right.isResolved();
}
Program: 82882
Project: 82882
Buggy source:
private void preWrite(MethodWriter writer,IValue instance,IArguments arguments,int localCount){
  if (!this.preProcessed) {
    this.preProcessed=true;
    final int[] accessCounts=new int[this.maxLocals];
    int lastStoredIndex=-1;
    for (int i=0; i < this.instructionCount; i++) {
      final IInstruction instruction=this.instructions[i];
      final int opcode=instruction.getOpcode();
      if (Opcodes.isLoadOpcode(opcode)) {
        final int varIndex=((VarInstruction)instruction).getIndex();
        if (++accessCounts[varIndex] < 2) {
          continue;
        }
        if (varIndex > lastStoredIndex) {
          lastStoredIndex=varIndex;
        }
      }
 else       if (Opcodes.isReturnOpcode(opcode)) {
        this.returnIndex=i;
      }
    }
    this.storedParameters=lastStoredIndex + 1;
    final IParameterList parameterList=this.method.getParameterList();
    int parameterSlots=0;
    for (int i=0, parameterCount=parameterList.size(); i < parameterCount; i++) {
      parameterSlots+=parameterList.get(i).getInternalType().getLocalSlots();
    }
    this.parameterSlots=parameterSlots;
  }
  for (int i=0; i < this.storedParameters; i++) {
    final IType type=IntrinsicData.writeArgument(writer,this.method,i,instance,arguments);
    writer.visitVarInsn(type.getStoreOpcode(),localCount);
    localCount=writer.localCount();
  }
}

Fixed version (ground truth):
private void preWrite(MethodWriter writer,IValue instance,IArguments arguments,int localCount){
  if (!this.preProcessed) {
    this.preProcessed=true;
    this.preProcess();
  }
  for (int i=0; i < this.storedParameters; i++) {
    final IType type=IntrinsicData.writeArgument(writer,this.method,i,instance,arguments);
    writer.visitVarInsn(type.getStoreOpcode(),localCount);
    localCount=writer.localCount();
  }
}
Program: 82883
Project: 82883
Buggy source:
private static boolean lowerPrecedence(OperatorElement element1,OperatorElement element2,OperatorElement ternaryOperator,MarkerList markers){
  if (element1.operator.getType() == IOperator.TERNARY) {
    if (element2.operator.getType() == IOperator.TERNARY) {
      return false;
    }
    if (element2.name == element1.operator.getTernaryName()) {
      return false;
    }
  }
  if (ternaryOperator != null && element1.name == ternaryOperator.operator.getTernaryName()) {
    if (element2.name == element1.name) {
      return true;
    }
    if (element2.name == ternaryOperator.name) {
      return false;
    }
  }
  final int comparePrecedence=element1.operator.comparePrecedence(element2.operator);
  if (comparePrecedence < 0) {
    return true;
  }
  if (comparePrecedence == 0) {
switch (element1.operator.getAssociativity()) {
case IOperator.NONE:
      markers.add(Markers.semantic(element1.position,"String_Node_Str",element1.name));
case IOperator.LEFT:
    return true;
}
}
return false;
}

Fixed version (ground truth):
private static boolean lowerPrecedence(OperatorElement element1,OperatorElement element2,OperatorElement ternaryOperator,MarkerList markers){
  final byte element1Type=element1.operator.getType();
  if (element1Type == IOperator.TERNARY) {
    if (element2.operator.getType() == IOperator.TERNARY) {
      return false;
    }
    if (element2.name == element1.operator.getTernaryName()) {
      return false;
    }
  }
  if (ternaryOperator != null && element1.name == ternaryOperator.operator.getTernaryName()) {
    if (element2.name == element1.name) {
      return true;
    }
    if (element2.name == ternaryOperator.name) {
      return false;
    }
  }
  final int comparePrecedence=element1.operator.comparePrecedence(element2.operator);
  if (comparePrecedence < 0) {
    return true;
  }
  if (comparePrecedence > 0) {
    return false;
  }
switch (element1.operator.getAssociativity()) {
case IOperator.NONE:
    if (element1Type != IOperator.INFIX) {
      return true;
    }
  markers.add(Markers.semantic(element1.position,"String_Node_Str",element1.name));
case IOperator.LEFT:
return true;
}
return false;
}
Program: 82884
Project: 82884
Buggy source:
@Override public IValue resolveCall(MarkerList markers,IContext context){
  final IValue op=Operators.getPrefix(this.name,this.arguments.getFirstValue());
  if (op != null) {
    op.setPosition(this.position);
    return op.resolveOperator(markers,context);
  }
  if (this.resolveMethodCall(markers,context)) {
    return this;
  }
  if (this.resolveImplicitCall(markers,context)) {
    return this;
  }
  return null;
}

Fixed version (ground truth):
@Override public IValue resolveCall(MarkerList markers,IContext context){
  final IValue operand=this.arguments.getFirstValue();
  if (operand != null) {
    final IValue op=Operators.getPrefix(this.name,operand);
    if (op != null) {
      op.setPosition(this.position);
      return op.resolveOperator(markers,context);
    }
  }
  if (this.resolveMethodCall(markers,context)) {
    return this;
  }
  if (this.resolveImplicitCall(markers,context)) {
    return this;
  }
  return null;
}
Program: 82885
Project: 82885
Buggy source:
@Override public void resolveTypes(MarkerList markers,IContext context){
  super.resolveTypes(markers,context);
  if (this.type.getTheClass().isInterface()) {
    this.nestedClass.addInterface(this.type);
  }
 else {
    this.nestedClass.setSuperType(this.type);
  }
  this.nestedClass.resolveTypes(markers,context);
}

Fixed version (ground truth):
@Override public void resolveTypes(MarkerList markers,IContext context){
  super.resolveTypes(markers,context);
  final IClass theClass=this.type.getTheClass();
  if (theClass != null) {
    if (theClass.isInterface()) {
      this.nestedClass.addInterface(this.type);
    }
 else {
      this.nestedClass.setSuperType(this.type);
    }
  }
  this.nestedClass.resolveTypes(markers,context);
}