nus-yam/ex-repair huggingface dataset:
Program: 164850
Project: 164850
Buggy source:
@Nullable private String getGenericReturnType(@NotNull String genericReturnTypeDesc){
  Type cascadingType=mockedType;
  if (!(cascadingType instanceof ParameterizedType)) {
    cascadingType=((Class<?>)cascadingType).getGenericSuperclass();
  }
  if (cascadingType instanceof ParameterizedType) {
    return getGenericReturnTypeWithTypeArguments(genericReturnTypeDesc,(ParameterizedType)cascadingType);
  }
  return getReturnTypeIfCascadingSupportedForIt(genericReturnTypeDesc);
}

Fixed version (ground truth):
@NotNull private Type getGenericReturnType(@NotNull Class<?> cascadingClass,@NotNull String methodNameAndDesc){
  Method cascadingMethod=new RealMethodOrConstructor(cascadingClass,methodNameAndDesc).getMember();
  Type genericReturnType=cascadingMethod.getGenericReturnType();
  if (genericReturnType instanceof TypeVariable<?>) {
    GenericTypeReflection typeReflection=new GenericTypeReflection(cascadingClass,mockedType);
    genericReturnType=typeReflection.resolveReturnType((TypeVariable<?>)genericReturnType);
  }
  return genericReturnType;
}
Program: 164851
Project: 164851
Buggy source:
@Nullable private Object getCascadedInstance(@NotNull String methodNameAndDesc,@NotNull String returnTypeInternalName){
  Type returnType=cascadedTypesAndMocks.get(returnTypeInternalName);
  if (returnType == null) {
    returnType=registerIntermediateCascadingType(methodNameAndDesc,returnTypeInternalName);
    if (returnType == null) {
      if (cascadedInstance != null) {
        return cascadedInstance;
      }
      returnType=mockedType;
    }
  }
  return createNewCascadedInstanceOrUseNonCascadedOneIfAvailable(methodNameAndDesc,returnType);
}

Fixed version (ground truth):
@Nullable private Object getCascadedInstance(@NotNull String methodNameAndDesc,@NotNull String returnTypeInternalName){
  Type returnType=cascadedTypesAndMocks.get(returnTypeInternalName);
  Class<?> returnClass;
  if (returnType == null) {
    Class<?> cascadingClass=mockedType instanceof Class<?> ? (Class<?>)mockedType : (Class<?>)((ParameterizedType)mockedType).getRawType();
    Type genericReturnType=getGenericReturnType(cascadingClass,methodNameAndDesc);
    Class<?> resolvedReturnType=getClassType(genericReturnType);
    if (resolvedReturnType.isAssignableFrom(cascadingClass)) {
      if (cascadedInstance != null) {
        return cascadedInstance;
      }
      returnType=mockedType;
      returnClass=cascadingClass;
    }
 else {
      Object defaultReturnValue=DefaultValues.computeForType(resolvedReturnType);
      if (defaultReturnValue != null) {
        return defaultReturnValue;
      }
      cascadedTypesAndMocks.put(returnTypeInternalName,genericReturnType);
      CASCADING_TYPES.add(returnTypeInternalName,false,genericReturnType,null);
      returnType=genericReturnType;
      returnClass=resolvedReturnType;
    }
  }
 else {
    returnClass=getClassType(returnType);
  }
  if (getReturnTypeIfCascadingSupportedForIt(returnClass) == null) {
    return null;
  }
  return createNewCascadedInstanceOrUseNonCascadedOneIfAvailable(methodNameAndDesc,returnType);
}
Program: 164852
Project: 164852
Buggy source:
private static void clearTestMethodArguments(@NotNull ITestResult testResult){
  testResult.setParameters(NO_ARGS);
}

Fixed version (ground truth):
private static void clearTestMethodArguments(@NotNull ITestResult testResult){
  Method method=testResult.getMethod().getConstructorOrMethod().getMethod();
  if (!isMethodWithParametersProvidedByTestNG(method)) {
    testResult.setParameters(NO_ARGS);
  }
}
Program: 164853
Project: 164853
Buggy source:
@Nullable private MockedTypeCascade getCascade(@NotNull String invokedTypeDesc,@NotNull Class<?> mockedType){
  Class<?> typeToLookFor=mockedType;
  do {
    String typeDesc=Type.getInternalName(typeToLookFor);
    if (invokedTypeDesc.equals(typeDesc)) {
      return null;
    }
    MockedTypeCascade cascade=cascadingTypes.get(typeDesc);
    if (cascade != null) {
      return cascade;
    }
    typeToLookFor=typeToLookFor.getSuperclass();
  }
 while (typeToLookFor != Object.class);
  return null;
}

Fixed version (ground truth):
@Nullable private MockedTypeCascade getCascade(@NotNull String invokedTypeDesc,@NotNull Class<?> mockedClass){
  Class<?> typeToLookFor=mockedClass;
  do {
    String typeDesc=Type.getInternalName(typeToLookFor);
    if (invokedTypeDesc.equals(typeDesc)) {
      return null;
    }
    MockedTypeCascade cascade=cascadingTypes.get(typeDesc);
    if (cascade != null) {
      cascade.mockedClass=mockedClass;
      return cascade;
    }
    typeToLookFor=typeToLookFor.getSuperclass();
  }
 while (typeToLookFor != Object.class);
  return null;
}
Program: 164854
Project: 164854
Buggy source:
@Nullable private Object getCascadedInstance(@NotNull String methodNameAndDesc,@NotNull String returnTypeInternalName){
  Type returnType=cascadedTypesAndMocks.get(returnTypeInternalName);
  Class<?> returnClass;
  if (returnType == null) {
    Class<?> cascadingClass=mockedType instanceof Class<?> ? (Class<?>)mockedType : (Class<?>)((ParameterizedType)mockedType).getRawType();
    Type genericReturnType=getGenericReturnType(cascadingClass,methodNameAndDesc);
    Class<?> resolvedReturnType=getClassType(genericReturnType);
    if (resolvedReturnType.isAssignableFrom(cascadingClass)) {
      if (cascadedInstance != null) {
        return cascadedInstance;
      }
      returnType=mockedType;
      returnClass=cascadingClass;
    }
 else {
      Object defaultReturnValue=DefaultValues.computeForType(resolvedReturnType);
      if (defaultReturnValue != null) {
        return defaultReturnValue;
      }
      cascadedTypesAndMocks.put(returnTypeInternalName,genericReturnType);
      CASCADING_TYPES.add(returnTypeInternalName,false,genericReturnType,null);
      returnType=genericReturnType;
      returnClass=resolvedReturnType;
    }
  }
 else {
    returnClass=getClassType(returnType);
  }
  if (getReturnTypeIfCascadingSupportedForIt(returnClass) == null) {
    return null;
  }
  return createNewCascadedInstanceOrUseNonCascadedOneIfAvailable(methodNameAndDesc,returnType);
}

Fixed version (ground truth):
@Nullable private Object getCascadedInstance(@NotNull String methodNameAndDesc,@NotNull String returnTypeInternalName){
  Type returnType=cascadedTypesAndMocks.get(returnTypeInternalName);
  Class<?> returnClass;
  if (returnType == null) {
    Class<?> cascadingClass=getClassWithCalledMethod();
    Type genericReturnType=getGenericReturnType(cascadingClass,methodNameAndDesc);
    Class<?> resolvedReturnType=getClassType(genericReturnType);
    if (resolvedReturnType.isAssignableFrom(cascadingClass)) {
      if (cascadedInstance != null) {
        return cascadedInstance;
      }
      returnType=mockedType;
      returnClass=cascadingClass;
    }
 else {
      Object defaultReturnValue=DefaultValues.computeForType(resolvedReturnType);
      if (defaultReturnValue != null) {
        return defaultReturnValue;
      }
      cascadedTypesAndMocks.put(returnTypeInternalName,genericReturnType);
      CASCADING_TYPES.add(returnTypeInternalName,false,genericReturnType,null);
      returnType=genericReturnType;
      returnClass=resolvedReturnType;
    }
  }
 else {
    returnClass=getClassType(returnType);
  }
  if (getReturnTypeIfCascadingSupportedForIt(returnClass) == null) {
    return null;
  }
  return createNewCascadedInstanceOrUseNonCascadedOneIfAvailable(methodNameAndDesc,returnType);
}
Program: 164855
Project: 164855
Buggy source:
private void registerCascadingAsNeeded(){
  boolean shouldCascade=mocked == null || mocked.cascading();
  if (shouldCascade && !(declaredType instanceof TypeVariable)) {
    TestRun.getExecutingTest().getCascadingTypes().add(fieldFromTestClass,declaredType,null);
  }
}

Fixed version (ground truth):
private void registerCascadingAsNeeded(){
  if (isMockableType()) {
    boolean shouldCascade=mocked == null || mocked.cascading();
    if (shouldCascade && !(declaredType instanceof TypeVariable)) {
      TestRun.getExecutingTest().getCascadingTypes().add(fieldFromTestClass,declaredType,null);
    }
  }
}
Program: 164856
Project: 164856
Buggy source:
@Override public void visitMethodInsn(int opcode,@NotNull String owner,@NotNull String name,@NotNull String desc,boolean itf){
  if (pendingCallToConstructorOfSameClass) {
    if (opcode == INVOKESPECIAL && "String_Node_Str".equals(name) && owner.equals(classDesc)) {
      mw.visitMethodInsn(opcode,owner,name,desc,itf);
      pendingCallToConstructorOfSameClass=false;
    }
  }
 else   if (callToAnotherConstructorAlreadyDisregarded || opcode != INVOKESPECIAL || !"String_Node_Str".equals(name) || !owner.equals(superClassName) && !owner.equals(classDesc)) {
    mw.visitMethodInsn(opcode,owner,name,desc,itf);
  }
 else {
    mw.visitInsn(POP);
    callToAnotherConstructorAlreadyDisregarded=true;
  }
}

Fixed version (ground truth):
@Override public void visitMethodInsn(int opcode,@NotNull String owner,@NotNull String name,@NotNull String desc,boolean itf){
  if (pendingCallToConstructorOfSameClass) {
    if (opcode == INVOKESPECIAL && "String_Node_Str".equals(name) && owner.equals(classDesc)) {
      mw.visitMethodInsn(opcode,owner,name,desc,itf);
      pendingCallToConstructorOfSameClass=false;
    }
  }
 else   if (callToAnotherConstructorAlreadyDisregarded || opcode != INVOKESPECIAL || !"String_Node_Str".equals(name) || !owner.equals(superClassName) && !owner.equals(classDesc)) {
    mw.visitMethodInsn(opcode,owner,name,desc,itf);
  }
 else {
    callToAnotherConstructorAlreadyDisregarded=true;
  }
}
Program: 164857
Project: 164857
Buggy source:
@Mock void $init(int i){
}

Fixed version (ground truth):
@Mock void $init(){
}
Program: 164858
Project: 164858
Buggy source:
@NotNull public InstanceFactory redefineType(){
  return redefineType(mockedType);
}

Fixed version (ground truth):
@Nullable public InstanceFactory redefineType(){
  return redefineType(mockedType);
}
Program: 164859
Project: 164859
Buggy source:
@NotNull private static Object createNewCascadedInstanceOrUseNonCascadedOneIfAvailable(@NotNull String methodNameAndDesc,@NotNull Type mockedReturnType){
  InstanceFactory instanceFactory=TestRun.mockFixture().findInstanceFactory(mockedReturnType);
  if (instanceFactory == null) {
    String methodName=methodNameAndDesc.substring(0,methodNameAndDesc.indexOf('('));
    CascadingTypeRedefinition typeRedefinition=new CascadingTypeRedefinition(methodName,mockedReturnType);
    instanceFactory=typeRedefinition.redefineType();
  }
 else {
    Object lastInstance=instanceFactory.getLastInstance();
    if (lastInstance != null) {
      return lastInstance;
    }
  }
  Object cascadedInstance=instanceFactory.create();
  instanceFactory.clearLastInstance();
  TestRun.getExecutingTest().addInjectableMock(cascadedInstance);
  return cascadedInstance;
}

Fixed version (ground truth):
@Nullable private static Object createNewCascadedInstanceOrUseNonCascadedOneIfAvailable(@NotNull String methodNameAndDesc,@NotNull Type mockedReturnType){
  InstanceFactory instanceFactory=TestRun.mockFixture().findInstanceFactory(mockedReturnType);
  if (instanceFactory == null) {
    String methodName=methodNameAndDesc.substring(0,methodNameAndDesc.indexOf('('));
    CascadingTypeRedefinition typeRedefinition=new CascadingTypeRedefinition(methodName,mockedReturnType);
    instanceFactory=typeRedefinition.redefineType();
    if (instanceFactory == null) {
      return null;
    }
  }
 else {
    Object lastInstance=instanceFactory.getLastInstance();
    if (lastInstance != null) {
      return lastInstance;
    }
  }
  Object cascadedInstance=instanceFactory.create();
  instanceFactory.clearLastInstance();
  TestRun.getExecutingTest().addInjectableMock(cascadedInstance);
  return cascadedInstance;
}
Program: 164860
Project: 164860
Buggy source:
@NotNull private Object getCascadedInstance(@NotNull String methodNameAndDesc,@NotNull String returnTypeInternalName){
  Type returnType=cascadedTypesAndMocks.get(returnTypeInternalName);
  if (returnType == null) {
    returnType=registerIntermediateCascadingType(methodNameAndDesc,returnTypeInternalName);
    if (returnType == null) {
      if (cascadedInstance != null) {
        return cascadedInstance;
      }
      returnType=mockedType;
    }
  }
  return createNewCascadedInstanceOrUseNonCascadedOneIfAvailable(methodNameAndDesc,returnType);
}

Fixed version (ground truth):
@Nullable private Object getCascadedInstance(@NotNull String methodNameAndDesc,@NotNull String returnTypeInternalName){
  Type returnType=cascadedTypesAndMocks.get(returnTypeInternalName);
  if (returnType == null) {
    returnType=registerIntermediateCascadingType(methodNameAndDesc,returnTypeInternalName);
    if (returnType == null) {
      if (cascadedInstance != null) {
        return cascadedInstance;
      }
      returnType=mockedType;
    }
  }
  return createNewCascadedInstanceOrUseNonCascadedOneIfAvailable(methodNameAndDesc,returnType);
}
Program: 164861
Project: 164861
Buggy source:
@Test public void cascadeOneLevelDuringReplay(@Mocked Foo foo){
  cascadedBar1=foo.getBar();
  assertEquals(0,cascadedBar1.doSomething());
  cascadedBar2=Foo.globalBar();
  assertEquals(0,cascadedBar2.doSomething());
  Bar bar=foo.getBar();
  assertSame(cascadedBar1,bar);
  Bar globalBar=Foo.globalBar();
  assertSame(cascadedBar2,globalBar);
  assertNotSame(bar,globalBar);
  foo.doSomething("String_Node_Str");
  assertEquals(0,foo.getIntValue());
  assertFalse(foo.getBooleanValue());
  assertTrue(foo.getList().isEmpty());
  assertNotNull(foo.returnTypeWithWildcard());
  assertNotNull(foo.returnTypeWithBoundedTypeVariable());
  Entry<Baz,List<Integer>> x=foo.returnTypeWithMultipleTypeVariables();
  assertNotNull(x);
}

Fixed version (ground truth):
@Test public void cascadeOneLevelDuringReplay(@Mocked Foo foo){
  cascadedBar1=foo.getBar();
  assertEquals(0,cascadedBar1.doSomething());
  cascadedBar2=Foo.globalBar();
  assertEquals(0,cascadedBar2.doSomething());
  Bar bar=foo.getBar();
  assertSame(cascadedBar1,bar);
  Bar globalBar=Foo.globalBar();
  assertSame(cascadedBar2,globalBar);
  assertNotSame(bar,globalBar);
  foo.doSomething("String_Node_Str");
  assertEquals(0,foo.getIntValue());
  assertFalse(foo.getBooleanValue());
  assertTrue(foo.getList().isEmpty());
  assertNotNull(foo.returnTypeWithWildcard());
  assertNotNull(foo.returnTypeWithBoundedTypeVariable());
  Entry<Baz,List<Integer>> x=foo.returnTypeWithMultipleTypeVariables();
  assertNotNull(x);
  HashMap<?,?> map=foo.getMap();
  assertNull(map);
}
Program: 164862
Project: 164862
Buggy source:
public static void fieldRead(@NotNull Object instance,@NotNull String file,@NotNull String classAndFieldNames){
  if (terminated)   return;
  CoverageData coverageData=CoverageData.instance();
  FileCoverageData fileData=coverageData.getFileData(file);
  fileData.dataCoverageInfo.registerReadOfInstanceField(instance,classAndFieldNames);
}

Fixed version (ground truth):
public static void fieldRead(@NotNull Object instance,@NotNull String file,@NotNull String classAndFieldNames){
  if (terminated)   return;
synchronized (TestRun.class) {
    CoverageData coverageData=CoverageData.instance();
    FileCoverageData fileData=coverageData.getFileData(file);
    fileData.dataCoverageInfo.registerReadOfInstanceField(instance,classAndFieldNames);
  }
}
Program: 164863
Project: 164863
Buggy source:
public static void branchExecuted(int fileIndex,int line,int branchIndex){
  if (terminated)   return;
  CoverageData coverageData=CoverageData.instance();
  PerFileLineCoverage fileData=coverageData.getFileData(fileIndex).lineCoverageInfo;
  CallPoint callPoint=null;
  if (coverageData.isWithCallPoints() && fileData.acceptsAdditionalCallPoints(line,branchIndex)) {
    callPoint=CallPoint.create(new Throwable());
  }
  fileData.registerExecution(line,branchIndex,callPoint);
}

Fixed version (ground truth):
public static void branchExecuted(int fileIndex,int line,int branchIndex){
  if (terminated)   return;
synchronized (TestRun.class) {
    CoverageData coverageData=CoverageData.instance();
    PerFileLineCoverage fileData=coverageData.getFileData(fileIndex).lineCoverageInfo;
    CallPoint callPoint=null;
    if (coverageData.isWithCallPoints() && fileData.acceptsAdditionalCallPoints(line,branchIndex)) {
      callPoint=CallPoint.create(new Throwable());
    }
    fileData.registerExecution(line,branchIndex,callPoint);
  }
}
Program: 164864
Project: 164864
Buggy source:
public static void fieldAssigned(@NotNull Object instance,@NotNull String file,@NotNull String classAndFieldNames){
  if (terminated)   return;
  CoverageData coverageData=CoverageData.instance();
  FileCoverageData fileData=coverageData.getFileData(file);
  fileData.dataCoverageInfo.registerAssignmentToInstanceField(instance,classAndFieldNames);
}

Fixed version (ground truth):
public static void fieldAssigned(@NotNull Object instance,@NotNull String file,@NotNull String classAndFieldNames){
  if (terminated)   return;
synchronized (TestRun.class) {
    CoverageData coverageData=CoverageData.instance();
    FileCoverageData fileData=coverageData.getFileData(file);
    fileData.dataCoverageInfo.registerAssignmentToInstanceField(instance,classAndFieldNames);
  }
}
Program: 164865
Project: 164865
Buggy source:
public static void nodeReached(@NotNull String file,int firstLineInMethodBody,int node){
  if (terminated)   return;
  CoverageData coverageData=CoverageData.instance();
  FileCoverageData fileData=coverageData.getFileData(file);
  fileData.pathCoverageInfo.registerExecution(firstLineInMethodBody,node);
}

Fixed version (ground truth):
public static void nodeReached(@NotNull String file,int firstLineInMethodBody,int node){
  if (terminated)   return;
synchronized (TestRun.class) {
    CoverageData coverageData=CoverageData.instance();
    FileCoverageData fileData=coverageData.getFileData(file);
    fileData.pathCoverageInfo.registerExecution(firstLineInMethodBody,node);
  }
}
Program: 164866
Project: 164866
Buggy source:
public static void lineExecuted(int fileIndex,int line){
  if (terminated)   return;
  CoverageData coverageData=CoverageData.instance();
  PerFileLineCoverage fileData=coverageData.getFileData(fileIndex).lineCoverageInfo;
  CallPoint callPoint=null;
  if (coverageData.isWithCallPoints() && fileData.acceptsAdditionalCallPoints(line)) {
    callPoint=CallPoint.create(new Throwable());
  }
  fileData.registerExecution(line,callPoint);
}

Fixed version (ground truth):
public static void lineExecuted(int fileIndex,int line){
  if (terminated)   return;
synchronized (TestRun.class) {
    CoverageData coverageData=CoverageData.instance();
    PerFileLineCoverage fileData=coverageData.getFileData(fileIndex).lineCoverageInfo;
    CallPoint callPoint=null;
    if (coverageData.isWithCallPoints() && fileData.acceptsAdditionalCallPoints(line)) {
      callPoint=CallPoint.create(new Throwable());
    }
    fileData.registerExecution(line,callPoint);
  }
}
Program: 164867
Project: 164867
Buggy source:
public synchronized void registerReadOfInstanceField(@NotNull Object instance,@NotNull String classAndFieldNames){
  InstanceFieldData instanceData=getInstanceFieldData(classAndFieldNames);
  if (instanceData != null) {
    instanceData.registerRead(instance);
  }
}

Fixed version (ground truth):
public void registerReadOfInstanceField(@NotNull Object instance,@NotNull String classAndFieldNames){
  InstanceFieldData instanceData=getInstanceFieldData(classAndFieldNames);
  if (instanceData != null) {
    instanceData.registerRead(instance);
  }
}
Program: 164868
Project: 164868
Buggy source:
public synchronized void registerAssignmentToStaticField(@NotNull String classAndFieldNames){
  StaticFieldData staticData=getStaticFieldData(classAndFieldNames);
  if (staticData != null) {
    staticData.registerAssignment();
  }
}

Fixed version (ground truth):
public void registerAssignmentToStaticField(@NotNull String classAndFieldNames){
  StaticFieldData staticData=getStaticFieldData(classAndFieldNames);
  if (staticData != null) {
    staticData.registerAssignment();
  }
}
Program: 164869
Project: 164869
Buggy source:
private <FI extends FieldData>void addFieldsFromPreviousTestRunIfAbsent(@NotNull Map<String,FI> currentInfo,@NotNull Map<String,FI> previousInfo){
  for (  Entry<String,FI> nameAndInfo : previousInfo.entrySet()) {
    String fieldName=nameAndInfo.getKey();
    if (!currentInfo.containsKey(fieldName)) {
      currentInfo.put(fieldName,previousInfo.get(fieldName));
    }
  }
}

Fixed version (ground truth):
private static <FI extends FieldData>void addFieldsFromPreviousTestRunIfAbsent(@NotNull Map<String,FI> currentInfo,@NotNull Map<String,FI> previousInfo){
  for (  Entry<String,FI> nameAndInfo : previousInfo.entrySet()) {
    String fieldName=nameAndInfo.getKey();
    if (!currentInfo.containsKey(fieldName)) {
      currentInfo.put(fieldName,previousInfo.get(fieldName));
    }
  }
}
Program: 164870
Project: 164870
Buggy source:
private <FI extends FieldData>void addInfoFromPreviousTestRun(@NotNull Map<String,FI> currentInfo,@NotNull Map<String,FI> previousInfo){
  for (  Entry<String,FI> nameAndInfo : currentInfo.entrySet()) {
    String fieldName=nameAndInfo.getKey();
    FieldData previousFieldInfo=previousInfo.get(fieldName);
    if (previousFieldInfo != null) {
      FieldData fieldInfo=nameAndInfo.getValue();
      fieldInfo.addCountsFromPreviousTestRun(previousFieldInfo);
    }
  }
}

Fixed version (ground truth):
private static <FI extends FieldData>void addInfoFromPreviousTestRun(@NotNull Map<String,FI> currentInfo,@NotNull Map<String,FI> previousInfo){
  for (  Entry<String,FI> nameAndInfo : currentInfo.entrySet()) {
    String fieldName=nameAndInfo.getKey();
    FieldData previousFieldInfo=previousInfo.get(fieldName);
    if (previousFieldInfo != null) {
      FieldData fieldInfo=nameAndInfo.getValue();
      fieldInfo.addCountsFromPreviousTestRun(previousFieldInfo);
    }
  }
}
Program: 164871
Project: 164871
Buggy source:
public synchronized void registerReadOfStaticField(@NotNull String classAndFieldNames){
  StaticFieldData staticData=getStaticFieldData(classAndFieldNames);
  if (staticData != null) {
    staticData.registerRead();
  }
}

Fixed version (ground truth):
public void registerReadOfStaticField(@NotNull String classAndFieldNames){
  StaticFieldData staticData=getStaticFieldData(classAndFieldNames);
  if (staticData != null) {
    staticData.registerRead();
  }
}
Program: 164872
Project: 164872
Buggy source:
public synchronized void registerAssignmentToInstanceField(@NotNull Object instance,@NotNull String classAndFieldNames){
  InstanceFieldData instanceData=getInstanceFieldData(classAndFieldNames);
  if (instanceData != null) {
    instanceData.registerAssignment(instance);
  }
}

Fixed version (ground truth):
public void registerAssignmentToInstanceField(@NotNull Object instance,@NotNull String classAndFieldNames){
  InstanceFieldData instanceData=getInstanceFieldData(classAndFieldNames);
  if (instanceData != null) {
    instanceData.registerAssignment(instance);
  }
}
Program: 164873
Project: 164873
Buggy source:
public void addLine(int line){
  if (!lineToLineData.containsKey(line)) {
    lineToLineData.put(line,null);
  }
  if (line > lastLine) {
    if (executionCounts != NO_EXECUTIONS_YET && line >= executionCounts.length) {
synchronized (lineToLineData) {
        int[] newCounts=new int[line + 30];
        System.arraycopy(executionCounts,0,newCounts,0,executionCounts.length);
        executionCounts=newCounts;
      }
    }
    lastLine=line;
  }
}

Fixed version (ground truth):
public void addLine(int line){
  if (!lineToLineData.containsKey(line)) {
    lineToLineData.put(line,null);
  }
  if (line > lastLine) {
    int[] initialExecutionCounts=executionCounts;
    if (initialExecutionCounts != NO_EXECUTIONS_YET && line >= initialExecutionCounts.length) {
      int[] newCounts=new int[line + 30];
      System.arraycopy(initialExecutionCounts,0,newCounts,0,initialExecutionCounts.length);
      executionCounts=newCounts;
    }
    lastLine=line;
  }
}
Program: 164874
Project: 164874
Buggy source:
private void computeValuesIfNeeded(){
  if (totalSegments >= 0)   return;
  totalSegments=coveredSegments=0;
  for (int line=1, n=lastLine; line <= n; line++) {
    if (lineToLineData.containsKey(line)) {
      LineCoverageData lineData=lineToLineData.get(line);
      if (lineData == null) {
        totalSegments++;
        if (executionCounts != NO_EXECUTIONS_YET && executionCounts[line] > 0) {
          coveredSegments++;
        }
      }
 else {
        totalSegments+=lineData.getNumberOfSegments();
        coveredSegments+=lineData.getNumberOfCoveredSegments();
      }
    }
  }
}

Fixed version (ground truth):
private void computeValuesIfNeeded(){
  if (totalSegments >= 0)   return;
  totalSegments=coveredSegments=0;
  for (int line=1, n=lastLine; line <= n; line++) {
    if (lineToLineData.containsKey(line)) {
      LineCoverageData lineData=lineToLineData.get(line);
      int executionCount=executionCounts == NO_EXECUTIONS_YET ? 0 : executionCounts[line];
      if (lineData == null) {
        totalSegments++;
        if (executionCount > 0) {
          coveredSegments++;
        }
      }
 else {
        lineData.setExecutionCount(executionCount);
        totalSegments+=lineData.getNumberOfSegments();
        coveredSegments+=lineData.getNumberOfCoveredSegments();
      }
    }
  }
}
Program: 164875
Project: 164875
Buggy source:
public synchronized void registerExecution(int firstLineInMethodBody,int node){
  MethodCoverageData methodData=firstLineToMethodData.get(firstLineInMethodBody);
  if (methodData != null) {
    methodData.markNodeAsReached(node);
  }
}

Fixed version (ground truth):
public void registerExecution(int firstLineInMethodBody,int node){
  MethodCoverageData methodData=firstLineToMethodData.get(firstLineInMethodBody);
  if (methodData != null) {
    methodData.markNodeAsReached(node);
  }
}
Program: 164876
Project: 164876
Buggy source:
@Nullable public static Object getMock(@NotNull String mockedTypeDesc,@NotNull String mockedMethodNameAndDesc,@Nullable Object mockInstance,@NotNull String returnTypeDesc,@Nullable String genericReturnTypeDesc){
  char typeCode=returnTypeDesc.charAt(0);
  if (typeCode != 'L') {
    return null;
  }
  MockedTypeCascade cascade=CASCADING_TYPES.getCascade(mockedTypeDesc,mockInstance);
  if (cascade == null) {
    return null;
  }
  String resolvedReturnTypeDesc=null;
  if (genericReturnTypeDesc != null) {
    resolvedReturnTypeDesc=cascade.getGenericReturnType(genericReturnTypeDesc);
  }
  if (resolvedReturnTypeDesc == null) {
    resolvedReturnTypeDesc=getReturnTypeIfCascadingSupportedForIt(returnTypeDesc);
  }
  if (resolvedReturnTypeDesc == null) {
    return null;
  }
  return cascade.getCascadedInstance(mockedMethodNameAndDesc,resolvedReturnTypeDesc);
}

Fixed version (ground truth):
@Nullable public static Object getMock(@NotNull String mockedTypeDesc,@NotNull String mockedMethodNameAndDesc,@Nullable Object mockInstance,@NotNull String returnTypeDesc,@Nullable String genericReturnTypeDesc){
  char typeCode=returnTypeDesc.charAt(0);
  if (typeCode != 'L') {
    return null;
  }
  MockedTypeCascade cascade=CASCADING_TYPES.getCascade(mockedTypeDesc,mockInstance);
  if (cascade == null) {
    return null;
  }
  String resolvedReturnTypeDesc=null;
  if (genericReturnTypeDesc != null) {
    resolvedReturnTypeDesc=cascade.getGenericReturnType(genericReturnTypeDesc);
  }
  if (resolvedReturnTypeDesc == null) {
    resolvedReturnTypeDesc=getReturnTypeIfCascadingSupportedForIt(returnTypeDesc);
    if (resolvedReturnTypeDesc == null) {
      return null;
    }
  }
 else   if (resolvedReturnTypeDesc.charAt(0) == '[') {
    return DefaultValues.computeForArrayType(resolvedReturnTypeDesc);
  }
  return cascade.getCascadedInstance(mockedMethodNameAndDesc,resolvedReturnTypeDesc);
}
Program: 164877
Project: 164877
Buggy source:
public static Object defaultValueForPrimitiveType(Class<?> type){
  if (type == int.class) {
    return ZERO_INT;
  }
 else   if (type == boolean.class) {
    return Boolean.FALSE;
  }
 else   if (type == long.class) {
    return ZERO_LONG;
  }
 else   if (type == double.class) {
    return ZERO_DOUBLE;
  }
 else   if (type == float.class) {
    return ZERO_FLOAT;
  }
 else   if (type == char.class) {
    return ZERO_CHAR;
  }
 else   if (type == byte.class) {
    return ZERO_BYTE;
  }
 else {
    return ZERO_SHORT;
  }
}

Fixed version (ground truth):
@NotNull public static Object defaultValueForPrimitiveType(@NotNull Class<?> type){
  if (type == int.class) {
    return ZERO_INT;
  }
 else   if (type == boolean.class) {
    return Boolean.FALSE;
  }
 else   if (type == long.class) {
    return ZERO_LONG;
  }
 else   if (type == double.class) {
    return ZERO_DOUBLE;
  }
 else   if (type == float.class) {
    return ZERO_FLOAT;
  }
 else   if (type == char.class) {
    return ZERO_CHAR;
  }
 else   if (type == byte.class) {
    return ZERO_BYTE;
  }
 else {
    return ZERO_SHORT;
  }
}
Program: 164878
Project: 164878
Buggy source:
@Nullable public static Object computeForType(Class<?> type){
  if (type.isArray()) {
    return Array.newInstance(type.getComponentType(),0);
  }
 else   if (type != void.class && type.isPrimitive()) {
    return defaultValueForPrimitiveType(type);
  }
  return computeForWrapperType(type);
}

Fixed version (ground truth):
@Nullable public static Object computeForType(@NotNull Class<?> type){
  if (type.isArray()) {
    return Array.newInstance(type.getComponentType(),0);
  }
 else   if (type != void.class && type.isPrimitive()) {
    return defaultValueForPrimitiveType(type);
  }
  return computeForWrapperType(type);
}
Program: 164879
Project: 164879
Buggy source:
@SuppressWarnings("String_Node_Str") @Nullable public static <T>T computeForWrapperType(java.lang.reflect.Type type){
  if (type == Integer.class) {
    return (T)ZERO_INT;
  }
 else   if (type == Boolean.class) {
    return (T)Boolean.FALSE;
  }
 else   if (type == Long.class) {
    return (T)ZERO_LONG;
  }
 else   if (type == Double.class) {
    return (T)ZERO_DOUBLE;
  }
 else   if (type == Float.class) {
    return (T)ZERO_FLOAT;
  }
 else   if (type == Character.class) {
    return (T)ZERO_CHAR;
  }
 else   if (type == Byte.class) {
    return (T)ZERO_BYTE;
  }
 else   if (type == Short.class) {
    return (T)ZERO_SHORT;
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Nullable public static <T>T computeForWrapperType(@NotNull java.lang.reflect.Type type){
  if (type == Integer.class) {
    return (T)ZERO_INT;
  }
 else   if (type == Boolean.class) {
    return (T)Boolean.FALSE;
  }
 else   if (type == Long.class) {
    return (T)ZERO_LONG;
  }
 else   if (type == Double.class) {
    return (T)ZERO_DOUBLE;
  }
 else   if (type == Float.class) {
    return (T)ZERO_FLOAT;
  }
 else   if (type == Character.class) {
    return (T)ZERO_CHAR;
  }
 else   if (type == Byte.class) {
    return (T)ZERO_BYTE;
  }
 else   if (type == Short.class) {
    return (T)ZERO_SHORT;
  }
  return null;
}
Program: 164880
Project: 164880
Buggy source:
Runnable doSomething(){
  return null;
}

Fixed version (ground truth):
T doSomething(){
  return null;
}
Program: 164881
Project: 164881
Buggy source:
@Nullable Integer getLine(){
  return (Integer)label.info;
}

Fixed version (ground truth):
@Nullable Integer getLine(){
  return label.info == null ? label.line : (Integer)label.info;
}
Program: 164882
Project: 164882
Buggy source:
public int addBranchingPoint(@NotNull Label jumpSource,@NotNull Label jumpTarget){
  int initialIndex=branches.size();
  if (initialIndex == 0) {
    branches=new ArrayList<BranchCoverageData>(4);
  }
 else {
    int existingBranchIndex=findBranchIndex(jumpSource,jumpTarget);
    if (existingBranchIndex >= 0) {
      return existingBranchIndex;
    }
  }
  branches.add(new BranchCoverageData(jumpSource));
  branches.add(new BranchCoverageData(jumpTarget));
  return initialIndex;
}

Fixed version (ground truth):
public int addBranchingPoint(@NotNull Label jumpSource,@NotNull Label jumpTarget){
  int initialIndex=branches.size();
  if (initialIndex == 0) {
    branches=new ArrayList<BranchCoverageData>(4);
  }
  branches.add(new BranchCoverageData(jumpSource));
  branches.add(new BranchCoverageData(jumpTarget));
  return initialIndex;
}
Program: 164883
Project: 164883
Buggy source:
public int getNumberOfSegments(){
  int n=branches.size();
  if (n == 0) {
    return 1;
  }
  BranchCoverageData branch=branches.get(0);
  Integer sourceLine=branch.getLine();
  int count=2;
  for (int i=1; i < n; i+=2) {
    branch=branches.get(i);
    Integer targetLine=branch.getLine();
    if (targetLine != null && targetLine.equals(sourceLine)) {
      count++;
    }
  }
  return count;
}

Fixed version (ground truth):
public int getNumberOfSegments(){
  int previouslyCounted=segments;
  if (previouslyCounted > 0) {
    return previouslyCounted;
  }
  int n=branches.size();
  if (n == 0) {
    return 1;
  }
  BranchCoverageData branch=branches.get(0);
  Integer sourceLine=branch.getLine();
  int count=1;
  for (int i=1; i < n; i+=2) {
    branch=branches.get(i);
    Integer targetLine=branch.getLine();
    if (targetLine != null && targetLine.equals(sourceLine)) {
      count++;
    }
    count++;
  }
  segments=count;
  return count;
}
Program: 164884
Project: 164884
Buggy source:
@SuppressWarnings("String_Node_Str") void addResult(@Nullable Object value){
  if (value == null) {
    getResults().addReturnValueResult(null);
  }
 else   if (isReplacementInstance(value)) {
    invocation.replacementInstance=value;
  }
 else   if (value instanceof Throwable) {
    getResults().addThrowable((Throwable)value);
  }
 else   if (value instanceof mockit.Delegate) {
    getResults().addDelegatedResult((mockit.Delegate<?>)value);
  }
 else {
    Class<?> rt=getReturnType();
    if (rt.isInstance(value)) {
      substituteCascadedMockToBeReturnedIfNeeded(value);
      getResults().addReturnValueResult(value);
    }
 else {
      new ReturnTypeConversion(this,rt,value).addConvertedValue();
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") void addResult(@Nullable Object value){
  if (value == null) {
    getResults().addReturnValueResult(null);
  }
 else   if (isReplacementInstance(value)) {
    invocation.replacementInstance=value;
  }
 else   if (value instanceof Throwable) {
    getResults().addThrowable((Throwable)value);
  }
 else   if (value instanceof mockit.Delegate) {
    getResults().addDelegatedResult((mockit.Delegate<?>)value);
  }
 else {
    Class<?> rt=getReturnType();
    if (rt.isInstance(value)) {
      clearNextInstanceToMatchIfRecording();
      getResults().addReturnValueResult(value);
    }
 else {
      new ReturnTypeConversion(this,rt,value).addConvertedValue();
    }
  }
}
Program: 164885
Project: 164885
Buggy source:
void addConvertedValueOrValues(){
  boolean valueIsArray=valueToReturn.getClass().isArray();
  boolean valueIsIterable=valueToReturn instanceof Iterable<?>;
  InvocationResults results=expectation.getResults();
  if (valueIsArray || valueIsIterable || valueToReturn instanceof Iterator<?>) {
    if (returnType == void.class || hasReturnOfDifferentType()) {
      if (valueIsArray) {
        results.addReturnValues(valueToReturn);
      }
 else       if (valueIsIterable) {
        results.addReturnValues((Iterable<?>)valueToReturn);
      }
 else {
        results.addDeferredReturnValues((Iterator<?>)valueToReturn);
      }
      return;
    }
  }
  expectation.substituteCascadedMockToBeReturnedIfNeeded(valueToReturn);
  results.addReturnValue(valueToReturn);
}

Fixed version (ground truth):
void addConvertedValueOrValues(){
  boolean valueIsArray=valueToReturn.getClass().isArray();
  boolean valueIsIterable=valueToReturn instanceof Iterable<?>;
  InvocationResults results=expectation.getResults();
  if (valueIsArray || valueIsIterable || valueToReturn instanceof Iterator<?>) {
    if (returnType == void.class || hasReturnOfDifferentType()) {
      if (valueIsArray) {
        results.addReturnValues(valueToReturn);
      }
 else       if (valueIsIterable) {
        results.addReturnValues((Iterable<?>)valueToReturn);
      }
 else {
        results.addDeferredReturnValues((Iterator<?>)valueToReturn);
      }
      return;
    }
  }
  expectation.clearNextInstanceToMatchIfRecording();
  results.addReturnValue(valueToReturn);
}
Program: 164886
Project: 164886
Buggy source:
private void produceCascadedInstanceIfApplicable(@Nullable TestOnlyPhase phase,@NotNull String returnTypeDesc,@Nullable String genericReturnTypeDesc){
  String mockedTypeDesc=getClassDesc();
  cascadedMock=MockedTypeCascade.getMock(mockedTypeDesc,arguments.methodNameAndDesc,instance,returnTypeDesc,genericReturnTypeDesc);
  if (cascadedMock != null) {
    if (phase != null) {
      phase.setNextInstanceToMatch(cascadedMock);
    }
    defaultReturnValue=cascadedMock;
  }
}

Fixed version (ground truth):
private void produceCascadedInstanceIfApplicable(@Nullable TestOnlyPhase phase,@NotNull String returnTypeDesc,@Nullable String genericReturnTypeDesc){
  String mockedTypeDesc=getClassDesc();
  Object cascadedMock=MockedTypeCascade.getMock(mockedTypeDesc,arguments.methodNameAndDesc,instance,returnTypeDesc,genericReturnTypeDesc);
  if (cascadedMock != null) {
    if (phase != null) {
      phase.setNextInstanceToMatch(cascadedMock);
    }
    defaultReturnValue=cascadedMock;
  }
}
Program: 164887
Project: 164887
Buggy source:
private void assertDefaultEqualsBehavior(Object a,Object b){
  assertFalse(a.equals(null));
  assertFalse(a.equals("String_Node_Str"));
  assertTrue(a.equals(a));
  assertFalse(a.equals(b));
}

Fixed version (ground truth):
void assertDefaultEqualsBehavior(Object obj1,Object obj2){
  assertFalse(obj1.equals(null));
  assertFalse(obj1.equals("String_Node_Str"));
  assertTrue(obj1.equals(obj1));
  assertFalse(obj1.equals(obj2));
}
Program: 164888
Project: 164888
Buggy source:
@Override public void beforeInvocation(@NotNull IInvokedMethod invokedMethod,@NotNull ITestResult testResult){
  ITestNGMethod testNGMethod=testResult.getMethod();
  Class<?> testClass=testResult.getTestClass().getRealClass();
  if (!invokedMethod.isTestMethod()) {
    beforeConfigurationMethod(testNGMethod,testClass);
    return;
  }
  Object testInstance=testResult.getInstance();
  if (testInstance == null || testInstance.getClass() != testClass && testClass.getClass().getName().equals(testClass.getName())) {
    return;
  }
  TestRun.enterNoMockingZone();
  try {
    updateTestClassState(testInstance,testClass);
    TestRun.setRunningIndividualTest(testInstance);
    SavePoint testMethodSavePoint=new SavePoint();
    savePoint.set(testMethodSavePoint);
    if (shouldPrepareForNextTest) {
      TestRun.prepareForNextTest();
      shouldPrepareForNextTest=false;
    }
    Method method=testNGMethod.getConstructorOrMethod().getMethod();
    if (!isMethodWithParametersProvidedByTestNG(method)) {
      Object[] parameters=testResult.getParameters();
      Object[] mockParameters=createInstancesForMockParameters(method,parameters);
      if (mockParameters != null) {
        System.arraycopy(mockParameters,0,parameters,0,parameters.length);
      }
    }
    createInstancesForTestedFields(testInstance);
  }
  finally {
    TestRun.exitNoMockingZone();
  }
}

Fixed version (ground truth):
@Override public void beforeInvocation(@NotNull IInvokedMethod invokedMethod,@NotNull ITestResult testResult){
  ITestNGMethod testNGMethod=testResult.getMethod();
  Class<?> testClass=testResult.getTestClass().getRealClass();
  if (!invokedMethod.isTestMethod()) {
    beforeConfigurationMethod(testNGMethod,testClass);
    return;
  }
  Object testInstance=testResult.getInstance();
  if (testInstance == null || testInstance.getClass() != testClass && !testClass.getClass().getName().equals(testClass.getName())) {
    return;
  }
  TestRun.enterNoMockingZone();
  try {
    updateTestClassState(testInstance,testClass);
    TestRun.setRunningIndividualTest(testInstance);
    SavePoint testMethodSavePoint=new SavePoint();
    savePoint.set(testMethodSavePoint);
    if (shouldPrepareForNextTest) {
      TestRun.prepareForNextTest();
      shouldPrepareForNextTest=false;
    }
    Method method=testNGMethod.getConstructorOrMethod().getMethod();
    if (!isMethodWithParametersProvidedByTestNG(method)) {
      Object[] parameters=testResult.getParameters();
      Object[] mockParameters=createInstancesForMockParameters(method,parameters);
      if (mockParameters != null) {
        System.arraycopy(mockParameters,0,parameters,0,parameters.length);
      }
    }
    createInstancesForTestedFields(testInstance);
  }
  finally {
    TestRun.exitNoMockingZone();
  }
}
Program: 164889
Project: 164889
Buggy source:
@Override public void visitMethodInsn(int opcode,@NotNull String owner,@NotNull String name,@NotNull String desc,boolean itf){
  if (callToAnotherConstructorAlreadyDisregarded || opcode != INVOKESPECIAL || !"String_Node_Str".equals(name) || !owner.equals(superClassName) && !owner.equals(classDesc)) {
    mw.visitMethodInsn(opcode,owner,name,desc,itf);
  }
 else {
    mw.visitInsn(POP);
    callToAnotherConstructorAlreadyDisregarded=true;
  }
}

Fixed version (ground truth):
@Override public void visitMethodInsn(int opcode,@NotNull String owner,@NotNull String name,@NotNull String desc,boolean itf){
  if (pendingCallToConstructorOfSameClass) {
    if (opcode == INVOKESPECIAL && "String_Node_Str".equals(name) && owner.equals(classDesc)) {
      mw.visitMethodInsn(opcode,owner,name,desc,itf);
      pendingCallToConstructorOfSameClass=false;
    }
  }
 else   if (callToAnotherConstructorAlreadyDisregarded || opcode != INVOKESPECIAL || !"String_Node_Str".equals(name) || !owner.equals(superClassName) && !owner.equals(classDesc)) {
    mw.visitMethodInsn(opcode,owner,name,desc,itf);
  }
 else {
    mw.visitInsn(POP);
    callToAnotherConstructorAlreadyDisregarded=true;
  }
}
Program: 164890
Project: 164890
Buggy source:
/** 
 * Just creates a new MethodWriter which will write out the method bytecode when visited. <p/> Removes any "abstract" or "native" modifiers for the modified version.
 */
protected final void startModifiedMethodVersion(int access,@NotNull String name,@NotNull String desc,@Nullable String signature,@Nullable String[] exceptions){
  mw=cw.visitMethod(access & METHOD_ACCESS_MASK,name,desc,signature,exceptions);
  methodAccess=access;
  methodName=name;
  methodDesc=desc;
  callToAnotherConstructorAlreadyDisregarded=false;
  if (isNative(access)) {
    TestRun.mockFixture().addRedefinedClassWithNativeMethods(classDesc);
  }
}

Fixed version (ground truth):
/** 
 * Just creates a new MethodWriter which will write out the method bytecode when visited. <p/> Removes any "abstract" or "native" modifiers for the modified version.
 */
protected final void startModifiedMethodVersion(int access,@NotNull String name,@NotNull String desc,@Nullable String signature,@Nullable String[] exceptions){
  mw=cw.visitMethod(access & METHOD_ACCESS_MASK,name,desc,signature,exceptions);
  methodAccess=access;
  methodName=name;
  methodDesc=desc;
  if (isNative(access)) {
    TestRun.mockFixture().addRedefinedClassWithNativeMethods(classDesc);
  }
}
Program: 164891
Project: 164891
Buggy source:
public void insertListOfCallPoints(@Nullable List<CallPoint> callPoints){
  if (content.length() == 0) {
    content.append(EOL).append("String_Node_Str");
  }
  if (callPoints == null) {
    content.append("String_Node_Str").append(EOL).append("String_Node_Str");
    return;
  }
  content.append("String_Node_Str").append(EOL);
  CallPoint currentCP=callPoints.get(0);
  appendTestMethod(currentCP.getStackTraceElement());
  appendRepetitionCountIfNeeded(currentCP);
  for (int i=1, n=callPoints.size(); i < n; i++) {
    CallPoint nextCP=callPoints.get(i);
    StackTraceElement ste=nextCP.getStackTraceElement();
    if (nextCP.isSameTestMethod(currentCP)) {
      content.append("String_Node_Str").append(ste.getLineNumber());
    }
 else {
      content.append("String_Node_Str").append(EOL);
      appendTestMethod(ste);
    }
    appendRepetitionCountIfNeeded(nextCP);
    currentCP=nextCP;
  }
  content.append("String_Node_Str").append(EOL).append("String_Node_Str").append(EOL).append("String_Node_Str");
}

Fixed version (ground truth):
public void insertListOfCallPoints(@Nullable List<CallPoint> callPoints){
  if (callPoints == null) {
    return;
  }
  if (content.length() == 0) {
    content.append(EOL).append("String_Node_Str");
  }
  content.append("String_Node_Str").append(EOL);
  CallPoint currentCP=callPoints.get(0);
  appendTestMethod(currentCP.getStackTraceElement());
  appendRepetitionCountIfNeeded(currentCP);
  for (int i=1, n=callPoints.size(); i < n; i++) {
    CallPoint nextCP=callPoints.get(i);
    StackTraceElement ste=nextCP.getStackTraceElement();
    if (nextCP.isSameTestMethod(currentCP)) {
      content.append("String_Node_Str").append(ste.getLineNumber());
    }
 else {
      content.append("String_Node_Str").append(EOL);
      appendTestMethod(ste);
    }
    appendRepetitionCountIfNeeded(nextCP);
    currentCP=nextCP;
  }
  content.append("String_Node_Str").append(EOL).append("String_Node_Str").append(EOL).append("String_Node_Str");
}
Program: 164892
Project: 164892
Buggy source:
void substituteCascadedMockToBeReturnedIfNeeded(){
  Object cascadedMock=invocation.getCascadedMock();
  if (cascadedMock != null) {
    TestRun.getExecutingTest().discardCascadedMockWhenInjectable(cascadedMock);
    if (recordPhase != null) {
      recordPhase.setNextInstanceToMatch(null);
    }
  }
}

Fixed version (ground truth):
void substituteCascadedMockToBeReturnedIfNeeded(@NotNull Object instanceToBeReturned){
  Object cascadedMock=invocation.getCascadedMock();
  if (cascadedMock != null && cascadedMock != instanceToBeReturned) {
    TestRun.getExecutingTest().discardCascadedMockWhenInjectable(cascadedMock);
    if (recordPhase != null) {
      recordPhase.setNextInstanceToMatch(null);
    }
  }
}
Program: 164893
Project: 164893
Buggy source:
@SuppressWarnings("String_Node_Str") void addResult(@Nullable Object value){
  if (value == null) {
    getResults().addReturnValueResult(null);
  }
 else   if (isReplacementInstance(value)) {
    invocation.replacementInstance=value;
  }
 else   if (value instanceof Throwable) {
    getResults().addThrowable((Throwable)value);
  }
 else   if (value instanceof mockit.Delegate) {
    getResults().addDelegatedResult((mockit.Delegate<?>)value);
  }
 else {
    Class<?> rt=getReturnType();
    if (rt.isInstance(value)) {
      substituteCascadedMockToBeReturnedIfNeeded();
      getResults().addReturnValueResult(value);
    }
 else {
      new ReturnTypeConversion(this,rt,value).addConvertedValue();
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") void addResult(@Nullable Object value){
  if (value == null) {
    getResults().addReturnValueResult(null);
  }
 else   if (isReplacementInstance(value)) {
    invocation.replacementInstance=value;
  }
 else   if (value instanceof Throwable) {
    getResults().addThrowable((Throwable)value);
  }
 else   if (value instanceof mockit.Delegate) {
    getResults().addDelegatedResult((mockit.Delegate<?>)value);
  }
 else {
    Class<?> rt=getReturnType();
    if (rt.isInstance(value)) {
      substituteCascadedMockToBeReturnedIfNeeded(value);
      getResults().addReturnValueResult(value);
    }
 else {
      new ReturnTypeConversion(this,rt,value).addConvertedValue();
    }
  }
}