nus-yam/ex-repair huggingface dataset:
Program: 164757
Project: 164757
Buggy source:
boolean isSelected(@Nonnull String className,@Nonnull ProtectionDomain protectionDomain){
  CodeSource codeSource=protectionDomain.getCodeSource();
  if (codeSource == null || isIneligibleForSelection(className) || !canAccessJMockitFromClassToBeMeasured(protectionDomain)) {
    return false;
  }
  URL location=findLocationInCodeSource(className,protectionDomain);
  if (location == null) {
    return false;
  }
  if (configurationRead) {
    if (isClassExcludedFromCoverage(className)) {
      return false;
    }
 else     if (classesToInclude != null) {
      return classesToInclude.reset(className).matches();
    }
  }
  return !isClassFromExternalLibrary(location);
}

Fixed version (ground truth):
boolean isSelected(@Nonnull String className,@Nonnull ProtectionDomain protectionDomain){
  CodeSource codeSource=protectionDomain.getCodeSource();
  if (codeSource == null || isIneligibleForSelection(className) || !canAccessJMockitFromClassToBeMeasured(protectionDomain)) {
    return false;
  }
  URL location=findLocationInCodeSource(className,protectionDomain);
  if (location == null) {
    return false;
  }
  if (!configurationRead) {
    readConfiguration();
  }
  if (isClassExcludedFromCoverage(className)) {
    return false;
  }
 else   if (classesToInclude != null) {
    return classesToInclude.reset(className).matches();
  }
  return !isClassFromExternalLibrary(location);
}
Program: 164758
Project: 164758
Buggy source:
private boolean isClassFromExternalLibrary(@Nonnull URL location){
  if ("String_Node_Str".equals(location.getProtocol())) {
    return true;
  }
  String path=location.getPath();
  if (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str") || testCode != null && (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str"))) {
    return true;
  }
  if (!configurationRead) {
    readConfiguration();
  }
  return false;
}

Fixed version (ground truth):
private boolean isClassFromExternalLibrary(@Nonnull URL location){
  if ("String_Node_Str".equals(location.getProtocol())) {
    return true;
  }
  String path=location.getPath();
  return path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str") || testCode != null && (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str"));
}
Program: 164759
Project: 164759
Buggy source:
private static int getSumOfArgumentSizes(@Nonnull String memberDesc){
  int sum=0;
  int i=1;
  while (true) {
    char c=memberDesc.charAt(i);
    i++;
    if (c == ')') {
      return sum;
    }
    if (c == 'L') {
      while (memberDesc.charAt(i) != ';')       i++;
      sum++;
    }
 else     if (c == '[') {
      while ((c=memberDesc.charAt(i)) == '[')       i++;
      if (isDoubleSizeType(c)) {
        i++;
        sum++;
      }
    }
 else     if (isDoubleSizeType(c)) {
      sum+=2;
    }
 else {
      sum++;
    }
  }
}

Fixed version (ground truth):
private static int getSumOfArgumentSizes(@Nonnull String memberDesc){
  int sum=0;
  int i=1;
  while (true) {
    char c=memberDesc.charAt(i);
    i++;
    if (c == ')') {
      return sum;
    }
    if (c == 'L') {
      while (memberDesc.charAt(i) != ';')       i++;
      i++;
      sum++;
    }
 else     if (c == '[') {
      while ((c=memberDesc.charAt(i)) == '[')       i++;
      if (isDoubleSizeType(c)) {
        i++;
        sum++;
      }
    }
 else     if (isDoubleSizeType(c)) {
      sum+=2;
    }
 else {
      sum++;
    }
  }
}
Program: 164760
Project: 164760
Buggy source:
private void assertFieldsSetByTheConstructor(){
  assertEquals(123,tested1.i);
  assertEquals("String_Node_Str",tested1.name);
  assertNull(tested1.action1);
  assertEquals(45,tested2.i);
  assertEquals("String_Node_Str",tested2.name);
  assertNotNull(tested2.action1);
  assertNotSame(action,tested2.action1);
}

Fixed version (ground truth):
void assertFieldsSetByTheConstructor(){
  assertEquals(123,tested1.i);
  assertEquals("String_Node_Str",tested1.name);
  assertNull(tested1.action1);
  assertEquals(45,tested2.i);
  assertEquals("String_Node_Str",tested2.name);
  assertNotNull(tested2.action1);
  assertNotSame(action,tested2.action1);
}
Program: 164761
Project: 164761
Buggy source:
private void assertFieldsSetThroughFieldInjectionFromInjectableFields(){
  assertSame(action,tested1.action2);
  assertEquals(-67,tested1.i2);
  assertEquals("String_Node_Str",tested1.text);
  assertSame(action,tested2.action2);
  assertEquals(-67,tested2.i2);
  assertEquals("String_Node_Str",tested2.text);
  assertEquals(asList("String_Node_Str","String_Node_Str"),tested1.names);
  assertSame(tested1.names,tested2.names);
}

Fixed version (ground truth):
void assertFieldsSetThroughFieldInjectionFromInjectableFields(){
  assertSame(action,tested1.action2);
  assertEquals(-67,tested1.i2);
  assertEquals("String_Node_Str",tested1.text);
  assertSame(action,tested2.action2);
  assertEquals(-67,tested2.i2);
  assertEquals("String_Node_Str",tested2.text);
  assertEquals(asList("String_Node_Str","String_Node_Str"),tested1.names);
  assertSame(tested1.names,tested2.names);
}
Program: 164762
Project: 164762
Buggy source:
ConstructorSearch(@Nonnull InjectionState injectionState,@Nonnull Class<?> testedClass,boolean withFullInjection){
  this.injectionState=injectionState;
  this.testedClass=testedClass;
  Class<?> declaredClass=isGeneratedClass(testedClass.getName()) ? testedClass.getSuperclass() : testedClass;
  testedClassDesc=new ParameterNameExtractor(false).extractNames(declaredClass);
  parameterProviders=new ArrayList<InjectionPointProvider>();
  this.withFullInjection=withFullInjection;
}

Fixed version (ground truth):
ConstructorSearch(@Nonnull InjectionState injectionState,@Nonnull Class<?> testedClass,boolean withFullInjection){
  this.injectionState=injectionState;
  this.testedClass=testedClass;
  Class<?> declaredClass=isGeneratedClass(testedClass.getName()) ? testedClass.getSuperclass() : testedClass;
  testedClassDesc=new ParameterNameExtractor().extractNames(declaredClass);
  parameterProviders=new ArrayList<InjectionPointProvider>();
  this.withFullInjection=withFullInjection;
}
Program: 164763
Project: 164763
Buggy source:
ParameterNameExtractor(boolean forMethods){
  this.forMethods=forMethods;
  classDesc=memberName=memberDesc="String_Node_Str";
}

Fixed version (ground truth):
ParameterNameExtractor(){
  classDesc=memberName=memberDesc="String_Node_Str";
}
Program: 164764
Project: 164764
Buggy source:
@Nullable @Override public MethodVisitor visitMethod(int access,@Nonnull String name,@Nonnull String desc,@Nullable String signature,@Nullable String[] exceptions){
  if ((access & ACC_SYNTHETIC) == 0) {
    boolean visitingAMethod=name.charAt(0) != '<';
    if (visitingAMethod == forMethods) {
      memberAccess=access;
      memberName=name;
      memberDesc=desc;
      return new MethodOrConstructorVisitor();
    }
  }
  return null;
}

Fixed version (ground truth):
@Nullable @Override public MethodVisitor visitMethod(int access,@Nonnull String name,@Nonnull String desc,@Nullable String signature,@Nullable String[] exceptions){
  if ((access & ACC_SYNTHETIC) == 0) {
    memberAccess=access;
    memberName=name;
    memberDesc=desc;
    return new MethodOrConstructorVisitor();
  }
  return null;
}
Program: 164765
Project: 164765
Buggy source:
@Nonnull public Collection<MethodCoverageData> getMethods(){
  return pathCoverageInfo.firstLineToMethodData.values();
}

Fixed version (ground truth):
@Nonnull public Collection<MethodCoverageData> getMethods(){
  List<MethodCoverageData> methods=new ArrayList<MethodCoverageData>(pathCoverageInfo.firstLineToMethodData.values());
  Collections.sort(methods,new Comparator<MethodCoverageData>(){
    @Override public int compare(    MethodCoverageData m1,    MethodCoverageData m2){
      int l1=m1.getFirstLineInBody();
      int l2=m2.getFirstLineInBody();
      if (l1 == l2) {
        return 0;
      }
      return l1 < l2 ? -1 : 1;
    }
  }
);
  return methods;
}
Program: 164766
Project: 164766
Buggy source:
public void mergeInformation(@Nonnull PerFilePathCoverage previousCoverage){
  Map<Integer,MethodCoverageData> previousInfo=previousCoverage.firstLineToMethodData;
  for (  Map.Entry<Integer,MethodCoverageData> firstLineAndInfo : firstLineToMethodData.entrySet()) {
    Integer firstLine=firstLineAndInfo.getKey();
    MethodCoverageData previousPathInfo=previousInfo.get(firstLine);
    if (previousPathInfo != null) {
      MethodCoverageData pathInfo=firstLineAndInfo.getValue();
      pathInfo.addCountsFromPreviousTestRun(previousPathInfo);
    }
  }
  for (  Map.Entry<Integer,MethodCoverageData> firstLineAndInfo : previousInfo.entrySet()) {
    Integer firstLine=firstLineAndInfo.getKey();
    if (!firstLineToMethodData.containsKey(firstLine)) {
      firstLineToMethodData.put(firstLine,firstLineAndInfo.getValue());
    }
  }
}

Fixed version (ground truth):
public void mergeInformation(@Nonnull PerFilePathCoverage previousCoverage){
  Map<Integer,MethodCoverageData> previousInfo=previousCoverage.firstLineToMethodData;
  addExecutionCountsFromPreviousTestRun(previousInfo);
  addPathInfoFromPreviousTestRunForMethodsNotExecutedInCurrentTestRun(previousInfo);
}
Program: 164767
Project: 164767
Buggy source:
public void addMethod(@Nonnull MethodCoverageData methodData){
  firstLineToMethodData.put(methodData.getFirstLineInBody(),methodData);
}

Fixed version (ground truth):
public void addMethod(@Nonnull MethodCoverageData methodData){
  int firstLineInBody=methodData.getFirstLineInBody();
  firstLineToMethodData.put(firstLineInBody,methodData);
}
Program: 164768
Project: 164768
Buggy source:
public static void doSomething(){
  new NestedClass.DeeplyNestedClass().print("String_Node_Str");
}

Fixed version (ground truth):
public static void doSomething(){
  new NestedClass.DeeplyNestedClass().print("String_Node_Str");
  if (System.out != null) {
    System.out.println("String_Node_Str");
  }
}
Program: 164769
Project: 164769
Buggy source:
@Test public void exerciseNestedClasses(){
  ClassWithNestedClasses.doSomething();
  assertEquals(8,fileData.lineCoverageInfo.getExecutableLineCount());
  assertEquals(50,fileData.lineCoverageInfo.getCoveragePercentage());
  assertEquals(8,fileData.lineCoverageInfo.getTotalItems());
  assertEquals(4,fileData.lineCoverageInfo.getCoveredItems());
  assertEquals(5,fileData.pathCoverageInfo.firstLineToMethodData.size());
  assertEquals(60,fileData.pathCoverageInfo.getCoveragePercentage());
  assertEquals(5,fileData.pathCoverageInfo.getTotalItems());
  assertEquals(3,fileData.pathCoverageInfo.getCoveredItems());
}

Fixed version (ground truth):
@Test public void exerciseNestedClasses(){
  ClassWithNestedClasses.doSomething();
  assertEquals(10,fileData.lineCoverageInfo.getExecutableLineCount());
  assertEquals(60,fileData.lineCoverageInfo.getCoveragePercentage());
  assertEquals(10,fileData.lineCoverageInfo.getTotalItems());
  assertEquals(6,fileData.lineCoverageInfo.getCoveredItems());
  findMethodData(27);
  assertMethodLines(27,33);
  assertPaths(2,1,1);
  assertPath(4,0);
  assertPath(5,1);
  assertEquals(5,fileData.pathCoverageInfo.firstLineToMethodData.size());
  assertEquals(50,fileData.pathCoverageInfo.getCoveragePercentage());
  assertEquals(6,fileData.pathCoverageInfo.getTotalItems());
  assertEquals(3,fileData.pathCoverageInfo.getCoveredItems());
}
Program: 164770
Project: 164770
Buggy source:
@Override protected void generateMethodBody(int access,@Nonnull String name,@Nonnull String desc,@Nullable String signature,@Nullable String[] exceptions){
  String resolvedSignature=signature;
  if (signature != null) {
    resolvedSignature=mockedTypeInfo.genericTypeMap.resolveReturnType(signature);
  }
  mw=cw.visitMethod(ACC_PUBLIC,name,desc,resolvedSignature,exceptions);
  generateDirectCallToHandler(mw,interfaceName,access,name,desc,resolvedSignature);
  generateReturnWithObjectAtTopOfTheStack(desc);
  mw.visitMaxs(1,0);
}

Fixed version (ground truth):
@Override protected void generateMethodBody(int access,@Nonnull String name,@Nonnull String desc,@Nullable String signature,@Nullable String[] exceptions){
  String resolvedSignature=signature;
  if (signature != null) {
    resolvedSignature=mockedTypeInfo.genericTypeMap.resolveReturnType(interfaceName,signature);
  }
  mw=cw.visitMethod(ACC_PUBLIC,name,desc,resolvedSignature,exceptions);
  generateDirectCallToHandler(mw,interfaceName,access,name,desc,resolvedSignature);
  generateReturnWithObjectAtTopOfTheStack(desc);
  mw.visitMaxs(1,0);
}
Program: 164771
Project: 164771
Buggy source:
@Override @SuppressWarnings("String_Node_Str") protected void generateMethodImplementation(@Nonnull String className,int access,@Nonnull String name,@Nonnull String desc,@Nullable String signature,@Nullable String[] exceptions){
  if (signature != null && mockedTypeInfo != null) {
    signature=mockedTypeInfo.genericTypeMap.resolveReturnType(signature);
  }
  mw=cw.visitMethod(ACC_PUBLIC,name,desc,signature,exceptions);
  if (ObjectMethods.isMethodFromObject(name,desc)) {
    generateEmptyImplementation(desc);
  }
 else {
    generateDirectCallToHandler(mw,className,access,name,desc,signature);
    generateReturnWithObjectAtTopOfTheStack(desc);
    mw.visitMaxs(1,0);
  }
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") protected void generateMethodImplementation(@Nonnull String className,int access,@Nonnull String name,@Nonnull String desc,@Nullable String signature,@Nullable String[] exceptions){
  if (signature != null && mockedTypeInfo != null) {
    signature=mockedTypeInfo.genericTypeMap.resolveReturnType(className,signature);
  }
  mw=cw.visitMethod(ACC_PUBLIC,name,desc,signature,exceptions);
  if (ObjectMethods.isMethodFromObject(name,desc)) {
    generateEmptyImplementation(desc);
  }
 else {
    generateDirectCallToHandler(mw,className,access,name,desc,signature);
    generateReturnWithObjectAtTopOfTheStack(desc);
    mw.visitMaxs(1,0);
  }
}
Program: 164772
Project: 164772
Buggy source:
@Nonnull public Type resolveReturnType(@Nonnull TypeVariable<?> typeVariable){
  Type typeArgument=typeParametersToTypeArguments.get(typeVariable.getName());
  if (typeArgument == null) {
    typeArgument=typeVariable.getBounds()[0];
  }
  if (typeArgument instanceof TypeVariable<?>) {
    typeArgument=resolveReturnType((TypeVariable<?>)typeArgument);
  }
  return typeArgument;
}

Fixed version (ground truth):
@Nonnull public Type resolveReturnType(@Nonnull TypeVariable<?> typeVariable){
  String typeVarKey=getTypeVariableKey(typeVariable);
  Type typeArgument=typeParametersToTypeArguments.get(typeVarKey);
  if (typeArgument == null) {
    typeArgument=typeVariable.getBounds()[0];
  }
  if (typeArgument instanceof TypeVariable<?>) {
    typeArgument=resolveReturnType((TypeVariable<?>)typeArgument);
  }
  return typeArgument;
}
Program: 164773
Project: 164773
Buggy source:
@Nonnull private Class<?> getClassType(@Nonnull Type type){
  if (type instanceof ParameterizedType) {
    ParameterizedType parameterizedType=(ParameterizedType)type;
    return (Class<?>)parameterizedType.getRawType();
  }
 else   if (type instanceof TypeVariable<?>) {
    TypeVariable<?> typeVar=(TypeVariable<?>)type;
    String typeVarName=typeVar.getName();
    Type typeArg=typeParametersToTypeArguments.get(typeVarName);
    if (typeArg == null) {
      throw new IllegalArgumentException("String_Node_Str" + typeVarName + '"');
    }
    return getClassType(typeArg);
  }
  return (Class<?>)type;
}

Fixed version (ground truth):
@Nonnull private Class<?> getClassType(@Nonnull Type type){
  if (type instanceof ParameterizedType) {
    ParameterizedType parameterizedType=(ParameterizedType)type;
    return (Class<?>)parameterizedType.getRawType();
  }
 else   if (type instanceof TypeVariable<?>) {
    TypeVariable<?> typeVar=(TypeVariable<?>)type;
    String typeVarKey=getTypeVariableKey(typeVar);
    Type typeArg=typeParametersToTypeArguments.get(typeVarKey);
    if (typeArg == null) {
      throw new IllegalArgumentException("String_Node_Str" + typeVar.getName() + '"');
    }
    return getClassType(typeArg);
  }
  return (Class<?>)type;
}
Program: 164774
Project: 164774
Buggy source:
@Nonnull private String replaceTypeParametersWithActualTypes(@Nonnull String typeDesc){
  if (typeDesc.charAt(0) == 'T') {
    String typeParameter=typeDesc.substring(0,typeDesc.length() - 1);
    String typeArg=typeParametersToTypeArgumentNames.get(typeParameter);
    return typeArg == null ? typeDesc : typeArg + ';';
  }
  int p=typeDesc.indexOf('<');
  if (p < 0) {
    return typeDesc;
  }
  String resolvedTypeDesc=typeDesc;
  for (  Entry<String,String> paramAndArg : typeParametersToTypeArgumentNames.entrySet()) {
    String typeParam=paramAndArg.getKey() + ';';
    String typeArg=paramAndArg.getValue() + ';';
    resolvedTypeDesc=resolvedTypeDesc.replace(typeParam,typeArg);
  }
  return resolvedTypeDesc;
}

Fixed version (ground truth):
@Nonnull private String replaceTypeParametersWithActualTypes(@Nonnull String ownerTypeDesc,@Nonnull String typeDesc){
  if (typeDesc.charAt(0) == 'T') {
    String typeParameter=typeDesc.substring(0,typeDesc.length() - 1);
    String typeArg=typeParametersToTypeArgumentNames.get(ownerTypeDesc + ':' + typeParameter);
    return typeArg == null ? typeDesc : typeArg + ';';
  }
  int p=typeDesc.indexOf('<');
  if (p < 0) {
    return typeDesc;
  }
  String resolvedTypeDesc=typeDesc;
  for (  Entry<String,String> paramAndArg : typeParametersToTypeArgumentNames.entrySet()) {
    String typeMappingKey=paramAndArg.getKey();
    String typeParam=typeMappingKey.substring(typeMappingKey.indexOf(':') + 1) + ';';
    String typeArg=paramAndArg.getValue() + ';';
    resolvedTypeDesc=resolvedTypeDesc.replace(typeParam,typeArg);
  }
  return resolvedTypeDesc;
}
Program: 164775
Project: 164775
Buggy source:
private boolean areParametersOfSameType(@Nonnull String param1,@Nonnull String param2){
  if (param1.equals(param2))   return true;
  int i=-1;
  char c;
  do {
    i++;
    c=param1.charAt(i);
  }
 while (c == '[');
  if (c != 'T')   return false;
  String typeArg1=typeParametersToTypeArgumentNames.get(param1.substring(i));
  return param2.substring(i).equals(typeArg1);
}

Fixed version (ground truth):
private boolean areParametersOfSameType(@Nonnull String param1,@Nonnull String param2){
  if (param1.equals(param2))   return true;
  int i=-1;
  char c;
  do {
    i++;
    c=param1.charAt(i);
  }
 while (c == '[');
  if (c != 'T')   return false;
  String typeVarName1=param1.substring(i);
  String typeVarName2=param2.substring(i);
  String typeArg1=null;
  for (  Entry<String,String> typeParamAndArgName : typeParametersToTypeArgumentNames.entrySet()) {
    String typeMappingKey=typeParamAndArgName.getKey();
    String typeVarName=typeMappingKey.substring(typeMappingKey.indexOf(':') + 1);
    if (typeVarName.equals(typeVarName1)) {
      typeArg1=typeParamAndArgName.getValue();
      break;
    }
  }
  return typeVarName2.equals(typeArg1);
}
Program: 164776
Project: 164776
Buggy source:
private void addMappingsFromTypeParametersToTypeArguments(@Nonnull Class<?> mockedClass,@Nonnull ParameterizedType mockedType){
  TypeVariable<?>[] typeParameters=mockedClass.getTypeParameters();
  Type[] typeArguments=mockedType.getActualTypeArguments();
  int n=typeParameters.length;
  for (int i=0; i < n; i++) {
    TypeVariable<?> typeParam=typeParameters[i];
    String typeVarName=typeParam.getName();
    if (typeParametersToTypeArguments.containsKey(typeVarName)) {
      continue;
    }
    Type typeArg=typeArguments[i];
    Type mappedTypeArg;
    String mappedTypeArgName=null;
    if (typeArg instanceof Class<?>) {
      mappedTypeArg=typeArg;
      if (withSignatures) {
        mappedTypeArgName='L' + ((Class<?>)typeArg).getName().replace('.','/');
      }
    }
 else     if (typeArg instanceof TypeVariable<?>) {
      mappedTypeArg=typeArg;
      if (withSignatures) {
        String intermediateTypeArg='T' + ((TypeVariable<?>)typeArg).getName();
        mappedTypeArgName=typeParametersToTypeArgumentNames.get(intermediateTypeArg);
      }
    }
 else {
      mappedTypeArg=typeParam.getBounds()[0];
      if (withSignatures) {
        mappedTypeArgName='L' + getClassType(mappedTypeArg).getName().replace('.','/');
      }
    }
    addTypeMapping(typeVarName,mappedTypeArg,mappedTypeArgName);
  }
}

Fixed version (ground truth):
private void addMappingsFromTypeParametersToTypeArguments(@Nonnull Class<?> mockedClass,@Nonnull ParameterizedType mockedType){
  String ownerTypeDesc=mockedClass.getName().replace('.','/');
  TypeVariable<?>[] typeParameters=mockedClass.getTypeParameters();
  Type[] typeArguments=mockedType.getActualTypeArguments();
  int n=typeParameters.length;
  for (int i=0; i < n; i++) {
    TypeVariable<?> typeParam=typeParameters[i];
    String typeVarName=typeParam.getName();
    if (typeParametersToTypeArguments.containsKey(ownerTypeDesc + ':' + typeVarName)) {
      continue;
    }
    Type typeArg=typeArguments[i];
    Type mappedTypeArg;
    String mappedTypeArgName=null;
    if (typeArg instanceof Class<?>) {
      mappedTypeArg=typeArg;
      if (withSignatures) {
        mappedTypeArgName='L' + ((Class<?>)typeArg).getName().replace('.','/');
      }
    }
 else     if (typeArg instanceof TypeVariable<?>) {
      mappedTypeArg=typeArg;
      if (withSignatures) {
        TypeVariable<?> typeVar=(TypeVariable<?>)typeArg;
        String ownerClassDesc=getOwnerClassDesc(typeVar);
        String intermediateTypeArg=ownerClassDesc + "String_Node_Str" + typeVar.getName();
        mappedTypeArgName=typeParametersToTypeArgumentNames.get(intermediateTypeArg);
      }
    }
 else {
      mappedTypeArg=typeParam.getBounds()[0];
      if (withSignatures) {
        mappedTypeArgName='L' + getClassType(mappedTypeArg).getName().replace('.','/');
      }
    }
    addTypeMapping(ownerTypeDesc,typeVarName,mappedTypeArg,mappedTypeArgName);
  }
}
Program: 164777
Project: 164777
Buggy source:
private boolean areMatchingTypeArguments(@Nonnull TypeVariable<?> declaredType,@Nonnull Type concreteType){
  Type resolvedType=typeParametersToTypeArguments.get(declaredType.getName());
  if (resolvedType != null) {
    if (resolvedType.equals(concreteType)) {
      return true;
    }
    if (concreteType instanceof Class<?> && typeSatisfiesResolvedTypeVariable(resolvedType,(Class<?>)concreteType)) {
      return true;
    }
    if (concreteType instanceof WildcardType && typeSatisfiesUpperBounds(resolvedType,((WildcardType)concreteType).getUpperBounds())) {
      return true;
    }
  }
 else   if (typeSatisfiesUpperBounds(concreteType,declaredType.getBounds())) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean areMatchingTypeArguments(@Nonnull TypeVariable<?> declaredType,@Nonnull Type concreteType){
  String typeVarKey=getTypeVariableKey(declaredType);
  Type resolvedType=typeParametersToTypeArguments.get(typeVarKey);
  if (resolvedType != null) {
    if (resolvedType.equals(concreteType)) {
      return true;
    }
    if (concreteType instanceof Class<?> && typeSatisfiesResolvedTypeVariable(resolvedType,(Class<?>)concreteType)) {
      return true;
    }
    if (concreteType instanceof WildcardType && typeSatisfiesUpperBounds(resolvedType,((WildcardType)concreteType).getUpperBounds())) {
      return true;
    }
  }
 else   if (typeSatisfiesUpperBounds(concreteType,declaredType.getBounds())) {
    return true;
  }
  return false;
}
Program: 164778
Project: 164778
Buggy source:
private void addTypeArgumentsIfAvailable(@Nonnull String signature){
  int firstParen=signature.indexOf('(');
  if (firstParen == 0)   return;
  int p=1;
  boolean lastMappingFound=false;
  while (!lastMappingFound) {
    int q=signature.indexOf(':',p);
    String typeVar=signature.substring(p,q);
    q++;
    if (signature.charAt(q) == ':') {
      q++;
    }
    int r=signature.indexOf(':',q);
    if (r < 0) {
      r=firstParen - 2;
      lastMappingFound=true;
    }
 else {
      r=signature.lastIndexOf(';',r);
      p=r + 1;
    }
    String typeArg=signature.substring(q,r);
    addTypeMapping(typeVar,typeArg);
  }
}

Fixed version (ground truth):
private void addTypeArgumentsIfAvailable(@Nonnull String ownerTypeDesc,@Nonnull String signature){
  int firstParen=signature.indexOf('(');
  if (firstParen == 0)   return;
  int p=1;
  boolean lastMappingFound=false;
  while (!lastMappingFound) {
    int q=signature.indexOf(':',p);
    String typeVar=signature.substring(p,q);
    q++;
    if (signature.charAt(q) == ':') {
      q++;
    }
    int r=signature.indexOf(':',q);
    if (r < 0) {
      r=firstParen - 2;
      lastMappingFound=true;
    }
 else {
      r=signature.lastIndexOf(';',r);
      p=r + 1;
    }
    String typeArg=signature.substring(q,r);
    addTypeMapping(ownerTypeDesc,typeVar,typeArg);
  }
}
Program: 164779
Project: 164779
Buggy source:
private void addTypeMapping(@Nonnull String typeVarName,@Nonnull String mappedTypeArgName){
  typeParametersToTypeArgumentNames.put('T' + typeVarName,mappedTypeArgName);
}

Fixed version (ground truth):
private void addTypeMapping(@Nonnull String ownerTypeDesc,@Nonnull String typeVarName,@Nonnull String mappedTypeArgName){
  String typeMappingKey=ownerTypeDesc + "String_Node_Str" + typeVarName;
  typeParametersToTypeArgumentNames.put(typeMappingKey,mappedTypeArgName);
}
Program: 164780
Project: 164780
Buggy source:
int doSomething(){
  return 1;
}

Fixed version (ground truth):
<T extends Bar>T doSomething(){
  return null;
}
Program: 164781
Project: 164781
Buggy source:
private void useCascadedMock(@Nullable TestOnlyPhase phase,@Nullable Object cascadedMock){
  if (cascadedMock != null) {
    if (phase != null) {
      phase.setNextInstanceToMatch(cascadedMock);
    }
    defaultReturnValue=cascadedMock;
  }
}

Fixed version (ground truth):
private void useCascadedMock(@Nullable TestOnlyPhase phase,@Nullable Object cascadedMock){
  if (cascadedMock != null) {
    if (phase != null && !TestRun.getExecutingTest().isRegularMockedInstance(cascadedMock)) {
      phase.setNextInstanceToMatch(cascadedMock);
    }
    defaultReturnValue=cascadedMock;
  }
}
Program: 164782
Project: 164782
Buggy source:
@Nullable private List<MockedType> findAvailableInjectablesForConstructor(@Nonnull Constructor<?> candidate){
  Type[] parameterTypes=candidate.getGenericParameterTypes();
  int n=parameterTypes.length;
  List<MockedType> injectablesFound=new ArrayList<MockedType>(n);
  boolean varArgs=candidate.isVarArgs();
  if (varArgs) {
    n--;
  }
  printCandidateConstructorNameIfRequested(candidate);
  String constructorDesc="String_Node_Str" + mockit.external.asm.Type.getConstructorDescriptor(candidate);
  for (int i=0; i < n; i++) {
    injectionState.setTypeOfInjectionPoint(parameterTypes[i]);
    String parameterName=ParameterNames.getName(testedClassDesc,constructorDesc,i);
    MockedType injectable=parameterName == null ? null : injectionState.findInjectableByTypeAndOptionallyName(parameterName);
    if (injectable == null || injectablesFound.contains(injectable)) {
      printParameterOfCandidateConstructorIfRequested(parameterName,injectable);
      return null;
    }
    injectablesFound.add(injectable);
  }
  if (varArgs) {
    MockedType injectable=hasInjectedValuesForVarargsParameter(parameterTypes,n);
    if (injectable != null) {
      injectablesFound.add(injectable);
    }
  }
  return injectablesFound;
}

Fixed version (ground truth):
@Nullable private List<MockedType> findAvailableInjectablesForConstructor(@Nonnull Constructor<?> candidate){
  Type[] parameterTypes=candidate.getGenericParameterTypes();
  int n=parameterTypes.length;
  List<MockedType> injectablesFound=new ArrayList<MockedType>(n);
  boolean varArgs=candidate.isVarArgs();
  if (varArgs) {
    n--;
  }
  printCandidateConstructorNameIfRequested(candidate);
  String constructorDesc="String_Node_Str" + mockit.external.asm.Type.getConstructorDescriptor(candidate);
  for (int i=0; i < n; i++) {
    Type parameterType=parameterTypes[i];
    injectionState.setTypeOfInjectionPoint(parameterType);
    String parameterName=ParameterNames.getName(testedClassDesc,constructorDesc,i);
    MockedType injectable=parameterName == null ? null : injectionState.findInjectableByTypeAndOptionallyName(parameterName);
    if (injectable == null || injectablesFound.contains(injectable)) {
      printParameterOfCandidateConstructorIfRequested(parameterName,injectable);
      return null;
    }
    injectablesFound.add(injectable);
  }
  if (varArgs) {
    MockedType injectable=hasInjectedValuesForVarargsParameter(parameterTypes,n);
    if (injectable != null) {
      injectablesFound.add(injectable);
    }
  }
  return injectablesFound;
}
Program: 164783
Project: 164783
Buggy source:
boolean isSelected(@Nonnull String className,@Nonnull ProtectionDomain protectionDomain){
  CodeSource codeSource=protectionDomain.getCodeSource();
  if (codeSource == null || isIneligibleForSelection(className) || !canAccessJMockitFromClassToBeMeasured(protectionDomain) || !hasLocationInCodeSource(className,protectionDomain)) {
    return false;
  }
  if (configurationRead) {
    if (isClassExcludedFromCoverage(className)) {
      return false;
    }
 else     if (classesToInclude != null) {
      return classesToInclude.reset(className).matches();
    }
  }
  return !isClassFromExternalLibrary(codeSource);
}

Fixed version (ground truth):
boolean isSelected(@Nonnull String className,@Nonnull ProtectionDomain protectionDomain){
  CodeSource codeSource=protectionDomain.getCodeSource();
  if (codeSource == null || isIneligibleForSelection(className) || !canAccessJMockitFromClassToBeMeasured(protectionDomain)) {
    return false;
  }
  URL location=findLocationInCodeSource(className,protectionDomain);
  if (location == null) {
    return false;
  }
  if (configurationRead) {
    if (isClassExcludedFromCoverage(className)) {
      return false;
    }
 else     if (classesToInclude != null) {
      return classesToInclude.reset(className).matches();
    }
  }
  return !isClassFromExternalLibrary(location);
}
Program: 164784
Project: 164784
Buggy source:
private boolean isClassFromExternalLibrary(@Nonnull CodeSource codeSource){
  URL location=codeSource.getLocation();
  if ("String_Node_Str".equals(location.getProtocol())) {
    return true;
  }
  String path=location.getPath();
  if (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str") || testCode != null && (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str"))) {
    return true;
  }
  if (!configurationRead) {
    readConfiguration();
    configurationRead=true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isClassFromExternalLibrary(@Nonnull URL location){
  if ("String_Node_Str".equals(location.getProtocol())) {
    return true;
  }
  String path=location.getPath();
  if (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str") || testCode != null && (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str"))) {
    return true;
  }
  if (!configurationRead) {
    readConfiguration();
    configurationRead=true;
  }
  return false;
}
Program: 164785
Project: 164785
Buggy source:
void findLifecycleMethods(@Nonnull Class<?> testedClass){
  if (classesSearched.contains(testedClass)) {
    return;
  }
  boolean isServlet=isServlet(testedClass);
  Class<?> classWithLifecycleMethods=testedClass;
  do {
    Method initializationMethod=null;
    Method terminationMethod=null;
    int methodsFoundInSameClass=0;
    for (    Method method : classWithLifecycleMethods.getDeclaredMethods()) {
      if (method.isSynthetic()) {
        continue;
      }
 else       if (initializationMethod == null && isInitializationMethod(method,isServlet)) {
        initializationMethods.put(classWithLifecycleMethods,method);
        initializationMethod=method;
        methodsFoundInSameClass++;
      }
 else       if (terminationMethod == null && isTerminationMethod(method,isServlet)) {
        terminationMethods.put(classWithLifecycleMethods,method);
        terminationMethod=method;
        methodsFoundInSameClass++;
      }
      if (methodsFoundInSameClass == 2) {
        break;
      }
    }
    classWithLifecycleMethods=classWithLifecycleMethods.getSuperclass();
  }
 while (classWithLifecycleMethods != Object.class);
  classesSearched.add(testedClass);
}

Fixed version (ground truth):
void findLifecycleMethods(@Nonnull Class<?> testedClass){
  if (testedClass.isInterface() || classesSearched.contains(testedClass)) {
    return;
  }
  boolean isServlet=isServlet(testedClass);
  Class<?> classWithLifecycleMethods=testedClass;
  do {
    findLifecycleMethodsInSingleClass(isServlet,classWithLifecycleMethods);
    classWithLifecycleMethods=classWithLifecycleMethods.getSuperclass();
  }
 while (classWithLifecycleMethods != Object.class);
  classesSearched.add(testedClass);
}
Program: 164786
Project: 164786
Buggy source:
ClassSelection(){
  testCode=Startup.isTestRun() ? TEST_CLASS_NAME.matcher("String_Node_Str") : null;
}

Fixed version (ground truth):
ClassSelection(){
  if (Startup.isTestRun()) {
    testCode=TEST_CLASS_NAME.matcher("String_Node_Str");
  }
 else {
    testCode=null;
    readConfiguration();
  }
}
Program: 164787
Project: 164787
Buggy source:
private void readConfiguration(){
  String classes=Configuration.getProperty("String_Node_Str","String_Node_Str");
  loadedOnly="String_Node_Str".equals(classes);
  classesToInclude=loadedOnly ? null : newMatcherForClassSelection(classes);
  String excludes=Configuration.getProperty("String_Node_Str","String_Node_Str");
  classesToExclude=newMatcherForClassSelection(excludes);
}

Fixed version (ground truth):
private void readConfiguration(){
  String classes=Configuration.getProperty("String_Node_Str","String_Node_Str");
  loadedOnly="String_Node_Str".equals(classes);
  classesToInclude=loadedOnly ? null : newMatcherForClassSelection(classes);
  String excludes=Configuration.getProperty("String_Node_Str","String_Node_Str");
  classesToExclude=newMatcherForClassSelection(excludes);
  configurationRead=true;
}
Program: 164788
Project: 164788
Buggy source:
private boolean isClassFromExternalLibrary(@Nonnull URL location){
  if ("String_Node_Str".equals(location.getProtocol())) {
    return true;
  }
  String path=location.getPath();
  if (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str") || testCode != null && (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str"))) {
    return true;
  }
  if (!configurationRead) {
    readConfiguration();
    configurationRead=true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isClassFromExternalLibrary(@Nonnull URL location){
  if ("String_Node_Str".equals(location.getProtocol())) {
    return true;
  }
  String path=location.getPath();
  if (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str") || testCode != null && (path.endsWith("String_Node_Str") || path.endsWith("String_Node_Str"))) {
    return true;
  }
  if (!configurationRead) {
    readConfiguration();
  }
  return false;
}
Program: 164789
Project: 164789
Buggy source:
@Override protected Class<?> findClass(String name){
  return defineClass(name,modifiedClassfile,0,modifiedClassfile.length);
}

Fixed version (ground truth):
@Override protected Class<?> findClass(String name) throws ClassNotFoundException {
  if (!name.equals(generatedClassName)) {
    return parentLoader.loadClass(name);
  }
  return defineClass(name,modifiedClassfile,0,modifiedClassfile.length);
}
Program: 164790
Project: 164790
Buggy source:
@Nonnull private Class<T> defineNewClass(@Nonnull ClassVisitor modifier){
  ClassLoader parentLoader=sourceClass.getClassLoader();
  if (parentLoader == null) {
    parentLoader=ImplementationClass.class.getClassLoader();
  }
  final byte[] modifiedClassfile=modifier.toByteArray();
  @SuppressWarnings("String_Node_Str") Class<T> generatedClass=(Class<T>)new ClassLoader(parentLoader){
    @Override protected Class<?> findClass(    String name){
      return defineClass(name,modifiedClassfile,0,modifiedClassfile.length);
    }
  }
.findClass(generatedClassName);
  generatedBytecode=modifiedClassfile;
  return generatedClass;
}

Fixed version (ground truth):
@Nonnull private Class<T> defineNewClass(@Nonnull ClassVisitor modifier){
  ClassLoader sourceClassLoader=sourceClass.getClassLoader();
  final ClassLoader parentLoader=sourceClassLoader != null ? sourceClassLoader : ImplementationClass.class.getClassLoader();
  final byte[] modifiedClassfile=modifier.toByteArray();
  try {
    @SuppressWarnings("String_Node_Str") Class<T> generatedClass=(Class<T>)new ClassLoader(parentLoader){
      @Override protected Class<?> findClass(      String name) throws ClassNotFoundException {
        if (!name.equals(generatedClassName)) {
          return parentLoader.loadClass(name);
        }
        return defineClass(name,modifiedClassfile,0,modifiedClassfile.length);
      }
    }
.findClass(generatedClassName);
    generatedBytecode=modifiedClassfile;
    return generatedClass;
  }
 catch (  ClassNotFoundException e) {
    throw new RuntimeException("String_Node_Str" + generatedClassName,e);
  }
}
Program: 164791
Project: 164791
Buggy source:
@Override public void visitLocalVariable(@Nonnull String name,String desc,String signature,Label start,Label end,int index){
  ParameterNames.registerName(classDesc,methodName,methodDesc,name);
}

Fixed version (ground truth):
@Override public void visitLocalVariable(@Nonnull String name,@Nonnull String desc,String signature,Label start,Label end,@Nonnegative int index){
  ParameterNames.registerName(classDesc,memberAccess,memberName,memberDesc,desc,name,index);
}
Program: 164792
Project: 164792
Buggy source:
ParameterNameExtractor(boolean forMethods){
  this.forMethods=forMethods;
  classDesc=methodName=methodDesc="String_Node_Str";
}

Fixed version (ground truth):
ParameterNameExtractor(boolean forMethods){
  this.forMethods=forMethods;
  classDesc=memberName=memberDesc="String_Node_Str";
}
Program: 164793
Project: 164793
Buggy source:
@Nullable @Override public MethodVisitor visitMethod(int access,@Nonnull String name,@Nonnull String desc,@Nullable String signature,@Nullable String[] exceptions){
  if ((access & ACC_SYNTHETIC) == 0) {
    boolean visitingAMethod=name.charAt(0) != '<';
    if (visitingAMethod == forMethods) {
      methodName=name;
      methodDesc=desc;
      return new MethodOrConstructorVisitor();
    }
  }
  return null;
}

Fixed version (ground truth):
@Nullable @Override public MethodVisitor visitMethod(int access,@Nonnull String name,@Nonnull String desc,@Nullable String signature,@Nullable String[] exceptions){
  if ((access & ACC_SYNTHETIC) == 0) {
    boolean visitingAMethod=name.charAt(0) != '<';
    if (visitingAMethod == forMethods) {
      memberAccess=access;
      memberName=name;
      memberDesc=desc;
      return new MethodOrConstructorVisitor();
    }
  }
  return null;
}
Program: 164794
Project: 164794
Buggy source:
@Override public void visitLocalVariable(@Nonnull String name,String desc,String signature,Label start,Label end,int index){
  String classDesc=mockMethods.getMockClassInternalName();
  ParameterNames.registerName(classDesc,methodName,methodDesc,name);
}

Fixed version (ground truth):
@Override public void visitLocalVariable(@Nonnull String name,@Nonnull String desc,String signature,Label start,Label end,@Nonnegative int index){
  String classDesc=mockMethods.getMockClassInternalName();
  ParameterNames.registerName(classDesc,access,methodName,methodDesc,desc,name,index);
}
Program: 164795
Project: 164795
Buggy source:
@Nullable public static String getName(@Nonnull String classDesc,@Nonnull String methodDesc,int index){
  Map<String,String[]> methodsToParameters=classesToMethodsToParameters.get(classDesc);
  if (methodsToParameters == null) {
    return null;
  }
  String[] parameterNames=methodsToParameters.get(methodDesc);
  return parameterNames == null ? null : parameterNames[index];
}

Fixed version (ground truth):
@Nullable public static String getName(@Nonnull String classDesc,@Nonnull String methodDesc,int index){
  Map<String,String[]> methodsToParameters=classesToMethodsToParameters.get(classDesc);
  if (methodsToParameters == null) {
    return null;
  }
  String[] parameterNames=methodsToParameters.get(methodDesc);
  int n=parameterNames.length;
  int i=0;
  int j=0;
  while (true) {
    String name=parameterNames[i];
    if (j == index || name == null) {
      return name;
    }
    i++;
    if (i == n) {
      break;
    }
    String nextName=parameterNames[i];
    if (nextName.isEmpty()) {
      i++;
    }
    j++;
  }
  return null;
}
Program: 164796
Project: 164796
Buggy source:
public static void registerName(@Nonnull String classDesc,@Nonnull String methodName,@Nonnull String methodDesc,@Nonnull String name){
  if ("String_Node_Str".equals(name)) {
    return;
  }
  Map<String,String[]> methodsToParameters=classesToMethodsToParameters.get(classDesc);
  if (methodsToParameters == null) {
    methodsToParameters=new HashMap<String,String[]>();
    classesToMethodsToParameters.put(classDesc,methodsToParameters);
  }
  String methodKey=methodName + methodDesc;
  String[] parameterNames=methodsToParameters.get(methodKey);
  if (parameterNames == null) {
    int numParameters=Type.getArgumentTypes(methodDesc).length;
    parameterNames=numParameters == 0 ? NO_PARAMETERS : new String[numParameters];
    methodsToParameters.put(methodKey,parameterNames);
  }
  for (int i=0, n=parameterNames.length; i < n; i++) {
    if (parameterNames[i] == null) {
      parameterNames[i]=name;
      break;
    }
  }
}

Fixed version (ground truth):
public static void registerName(@Nonnull String classDesc,@Nonnegative int memberAccess,@Nonnull String memberName,@Nonnull String memberDesc,@Nonnull String desc,@Nonnull String name,@Nonnegative int index){
  if ("String_Node_Str".equals(name)) {
    return;
  }
  Map<String,String[]> methodsToParameters=classesToMethodsToParameters.get(classDesc);
  if (methodsToParameters == null) {
    methodsToParameters=new HashMap<String,String[]>();
    classesToMethodsToParameters.put(classDesc,methodsToParameters);
  }
  String methodKey=memberName + memberDesc;
  String[] parameterNames=methodsToParameters.get(methodKey);
  if (parameterNames == null) {
    int sumOfArgumentSizes=getSumOfArgumentSizes(memberDesc);
    parameterNames=sumOfArgumentSizes == 0 ? NO_PARAMETERS : new String[sumOfArgumentSizes];
    methodsToParameters.put(methodKey,parameterNames);
  }
  int i=index - (isStatic(memberAccess) ? 0 : 1);
  if (i < parameterNames.length) {
    parameterNames[i]=name;
    if (isDoubleSizeType(desc.charAt(0))) {
      parameterNames[i + 1]="String_Node_Str";
    }
  }
}
Program: 164798
Project: 164798
Buggy source:
private boolean withMultipleTargetFieldsOfSameType(@Nonnull List<Field> targetFields,@Nonnull Field fieldToBeInjected){
  InjectionState injectionState=testedField.injectionState;
  for (  Field targetField : targetFields) {
    if (targetField != fieldToBeInjected && injectionState.isSameTypeAsInjectionPoint(targetField.getGenericType())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean withMultipleTargetFieldsOfSameType(@Nonnull List<Field> targetFields,@Nonnull Field fieldToBeInjected){
  for (  Field targetField : targetFields) {
    if (targetField != fieldToBeInjected && injectionState.isSameTypeAsInjectionPoint(targetField.getGenericType())) {
      return true;
    }
  }
  return false;
}
Program: 164799
Project: 164799
Buggy source:
void fillOutDependenciesRecursively(@Nonnull Object dependency){
  Class<?> dependencyClass=dependency.getClass();
  List<Field> targetFields=findAllTargetInstanceFieldsInTestedClassHierarchy(dependencyClass);
  if (!targetFields.isEmpty()) {
    InjectionState injectionState=testedField.injectionState;
    List<MockedType> currentlyConsumedInjectables=injectionState.saveConsumedInjectables();
    injectIntoEligibleFields(targetFields,dependency);
    injectionState.restoreConsumedInjectables(currentlyConsumedInjectables);
  }
}

Fixed version (ground truth):
void fillOutDependenciesRecursively(@Nonnull Object dependency){
  Class<?> dependencyClass=dependency.getClass();
  boolean previousRequireDIAnnotation=requireDIAnnotation;
  List<Field> targetFields=findAllTargetInstanceFieldsInTestedClassHierarchy(dependencyClass);
  if (!targetFields.isEmpty()) {
    List<MockedType> currentlyConsumedInjectables=injectionState.saveConsumedInjectables();
    injectIntoEligibleFields(targetFields,dependency);
    injectionState.restoreConsumedInjectables(currentlyConsumedInjectables);
  }
  requireDIAnnotation=previousRequireDIAnnotation;
}
Program: 164800
Project: 164800
Buggy source:
@Nonnull List<Field> findAllTargetInstanceFieldsInTestedClassHierarchy(@Nonnull Class<?> testedClass){
  testedField.requireDIAnnotation=false;
  List<Field> targetFields=new ArrayList<Field>();
  Class<?> classWithFields=testedClass;
  do {
    Field[] fields=classWithFields.getDeclaredFields();
    for (    Field field : fields) {
      if (isEligibleForInjection(field)) {
        targetFields.add(field);
      }
    }
    classWithFields=classWithFields.getSuperclass();
  }
 while (isClassFromSameModuleOrSystemAsTestedClass(classWithFields) || isServlet(classWithFields));
  return targetFields;
}

Fixed version (ground truth):
@Nonnull List<Field> findAllTargetInstanceFieldsInTestedClassHierarchy(@Nonnull Class<?> testedClass){
  requireDIAnnotation=false;
  List<Field> targetFields=new ArrayList<Field>();
  Class<?> classWithFields=testedClass;
  do {
    Field[] fields=classWithFields.getDeclaredFields();
    for (    Field field : fields) {
      if (isEligibleForInjection(field)) {
        targetFields.add(field);
      }
    }
    classWithFields=classWithFields.getSuperclass();
  }
 while (isClassFromSameModuleOrSystemAsTestedClass(classWithFields) || isServlet(classWithFields));
  return targetFields;
}
Program: 164801
Project: 164801
Buggy source:
FieldInjection(@Nonnull TestedField testedField,@Nonnull Class<?> testedClass,boolean fullInjection){
  this.testedField=testedField;
  protectionDomainOfTestedClass=testedClass.getProtectionDomain();
  CodeSource codeSource=protectionDomainOfTestedClass.getCodeSource();
  codeLocationParentPath=codeSource == null ? null : new File(codeSource.getLocation().getPath()).getParent();
  nameOfTestedClass=testedClass.getName();
  this.fullInjection=fullInjection ? new FullInjection(testedField.injectionState) : null;
}

Fixed version (ground truth):
FieldInjection(@Nonnull TestedField testedField,@Nonnull Class<?> testedClass,boolean fullInjection){
  injectionState=testedField.injectionState;
  requireDIAnnotation=testedField.requireDIAnnotation;
  protectionDomainOfTestedClass=testedClass.getProtectionDomain();
  CodeSource codeSource=protectionDomainOfTestedClass.getCodeSource();
  codeLocationParentPath=codeSource == null ? null : new File(codeSource.getLocation().getPath()).getParent();
  nameOfTestedClass=testedClass.getName();
  this.fullInjection=fullInjection ? new FullInjection(injectionState) : null;
}
Program: 164802
Project: 164802
Buggy source:
private boolean isEligibleForInjection(@Nonnull Field field){
  int modifiers=field.getModifiers();
  if (isFinal(modifiers)) {
    return false;
  }
  boolean annotated=isAnnotated(field) != KindOfInjectionPoint.NotAnnotated;
  if (annotated) {
    testedField.requireDIAnnotation=true;
    return true;
  }
  return !isStatic(modifiers);
}

Fixed version (ground truth):
private boolean isEligibleForInjection(@Nonnull Field field){
  int modifiers=field.getModifiers();
  if (isFinal(modifiers)) {
    return false;
  }
  boolean annotated=isAnnotated(field) != KindOfInjectionPoint.NotAnnotated;
  if (annotated) {
    requireDIAnnotation=true;
    return true;
  }
  return !isStatic(modifiers);
}