Program: 12094
Project: 12094
Buggy source:
private void processArgumentOfInternalMethodInvocation(MethodObject methodObject,AbstractVariable argumentDeclaration,int initialArgumentPosition,VariableDeclaration parameterDeclaration,Set<String> processedMethods){
  SystemObject systemObject=ASTReader.getSystemObject();
  if (methodObject.getMethodBody() == null) {
    IMethodBinding superMethodDeclarationBinding=methodObject.getMethodDeclaration().resolveBinding();
    IType superType=(IType)superMethodDeclarationBinding.getDeclaringClass().getJavaElement();
    processedMethods.add(superMethodDeclarationBinding.getKey());
    Set<IType> subTypes=CompilationUnitCache.getInstance().getSubTypes(superType);
    for (    IType subType : subTypes) {
      ClassObject subClassObject=systemObject.getClassObject(subType.getFullyQualifiedName('.'));
      if (subClassObject != null) {
        ListIterator<MethodObject> methodIterator=subClassObject.getMethodIterator();
        while (methodIterator.hasNext()) {
          MethodObject subMethod=methodIterator.next();
          if (equalSignature(subMethod.getMethodDeclaration().resolveBinding(),superMethodDeclarationBinding)) {
            ParameterObject parameterObject=subMethod.getParameter(initialArgumentPosition);
            VariableDeclaration parameterDeclaration2=parameterObject.getSingleVariableDeclaration();
            processArgumentOfInternalMethodInvocation(subMethod,argumentDeclaration,initialArgumentPosition,parameterDeclaration2,processedMethods);
            break;
          }
        }
      }
    }
  }
 else {
    for (    AbstractVariable originalField : methodObject.getDefinedFieldsThroughParameters()) {
      if (parameterDeclaration.resolveBinding().getKey().equals(originalField.getVariableBindingKey())) {
        AbstractVariable field=new CompositeVariable(argumentDeclaration.getVariableBindingKey(),argumentDeclaration.getVariableName(),argumentDeclaration.getVariableType(),argumentDeclaration.isField(),argumentDeclaration.isParameter(),((CompositeVariable)originalField).getRightPart());
        definedVariables.add(field);
      }
    }
    for (    AbstractVariable originalField : methodObject.getUsedFieldsThroughParameters()) {
      if (parameterDeclaration.resolveBinding().getKey().equals(originalField.getVariableBindingKey())) {
        AbstractVariable field=new CompositeVariable(argumentDeclaration.getVariableBindingKey(),argumentDeclaration.getVariableName(),argumentDeclaration.getVariableType(),argumentDeclaration.isField(),argumentDeclaration.isParameter(),((CompositeVariable)originalField).getRightPart());
        usedVariables.add(field);
      }
    }
    processedMethods.add(methodObject.getMethodDeclaration().resolveBinding().getKey());
    Map<AbstractVariable,LinkedHashSet<MethodInvocationObject>> invokedMethodsThroughParameters=methodObject.getInvokedMethodsThroughParameters();
    for (    AbstractVariable originalField : invokedMethodsThroughParameters.keySet()) {
      if (parameterDeclaration.resolveBinding().getKey().equals(originalField.getVariableBindingKey())) {
        AbstractVariable field=null;
        if (originalField instanceof PlainVariable)         field=argumentDeclaration;
 else         field=new CompositeVariable(argumentDeclaration.getVariableBindingKey(),argumentDeclaration.getVariableName(),argumentDeclaration.getVariableType(),argumentDeclaration.isField(),argumentDeclaration.isParameter(),((CompositeVariable)originalField).getRightPart());
        LinkedHashSet<MethodInvocationObject> methodInvocations=invokedMethodsThroughParameters.get(originalField);
        for (        MethodInvocationObject methodInvocationObject : methodInvocations) {
          MethodInvocation methodInvocation2=methodInvocationObject.getMethodInvocation();
          ClassObject classObject2=systemObject.getClassObject(methodInvocationObject.getOriginClassName());
          if (classObject2 != null) {
            MethodObject methodObject2=classObject2.getMethod(methodInvocationObject);
            if (methodObject2 != null) {
              processInternalMethodInvocation(classObject2,methodObject2,field,new LinkedHashSet<String>());
            }
          }
 else {
            LibraryClassStorage instance=LibraryClassStorage.getInstance();
            IMethodBinding invokedMethodBinding=methodInvocation2.resolveMethodBinding();
            if (instance.isAnalyzed(invokedMethodBinding.getKey())) {
              handleAlreadyAnalyzedMethod(invokedMethodBinding.getKey(),field,instance);
            }
 else {
              MethodDeclaration invokedMethodDeclaration=getInvokedMethodDeclaration(invokedMethodBinding);
              if (invokedMethodDeclaration != null)               processExternalMethodInvocation(invokedMethodDeclaration,field,new LinkedHashSet<String>(),0);
            }
          }
        }
      }
    }
    Map<PlainVariable,LinkedHashSet<MethodInvocationObject>> parametersPassedAsArgumentsInMethodInvocations=methodObject.getParametersPassedAsArgumentsInMethodInvocations();
    for (    PlainVariable parameter : parametersPassedAsArgumentsInMethodInvocations.keySet()) {
      if (parameterDeclaration.resolveBinding().getKey().equals(parameter.getVariableBindingKey())) {
        LinkedHashSet<MethodInvocationObject> methodInvocations=parametersPassedAsArgumentsInMethodInvocations.get(parameter);
        for (        MethodInvocationObject methodInvocationObject : methodInvocations) {
          ClassObject classObject2=systemObject.getClassObject(methodInvocationObject.getOriginClassName());
          if (classObject2 != null) {
            MethodObject methodObject2=classObject2.getMethod(methodInvocationObject);
            if (methodObject2 != null && !methodObject2.equals(methodObject)) {
              MethodInvocation methodInvocation2=methodInvocationObject.getMethodInvocation();
              int argumentPosition=getArgumentPosition(methodInvocation2.arguments(),parameter);
              ParameterObject parameterObject=methodObject2.getParameter(argumentPosition);
              VariableDeclaration parameterDeclaration2=parameterObject.getSingleVariableDeclaration();
              if (!processedMethods.contains(methodInvocation2.resolveMethodBinding().getKey()))               processArgumentOfInternalMethodInvocation(methodObject2,argumentDeclaration,argumentPosition,parameterDeclaration2,processedMethods);
            }
          }
        }
      }
    }
    Map<PlainVariable,LinkedHashSet<SuperMethodInvocationObject>> parametersPassedAsArgumentsInSuperMethodInvocations=methodObject.getParametersPassedAsArgumentsInSuperMethodInvocations();
    for (    PlainVariable parameter : parametersPassedAsArgumentsInSuperMethodInvocations.keySet()) {
      if (parameterDeclaration.resolveBinding().getKey().equals(parameter.getVariableBindingKey())) {
        LinkedHashSet<SuperMethodInvocationObject> superMethodInvocations=parametersPassedAsArgumentsInSuperMethodInvocations.get(parameter);
        for (        SuperMethodInvocationObject superMethodInvocationObject : superMethodInvocations) {
          ClassObject classObject2=systemObject.getClassObject(superMethodInvocationObject.getOriginClassName());
          if (classObject2 != null) {
            MethodObject methodObject2=classObject2.getMethod(superMethodInvocationObject);
            if (methodObject2 != null) {
              SuperMethodInvocation superMethodInvocation=superMethodInvocationObject.getSuperMethodInvocation();
              int argumentPosition=getArgumentPosition(superMethodInvocation.arguments(),parameter);
              ParameterObject parameterObject=methodObject2.getParameter(argumentPosition);
              VariableDeclaration parameterDeclaration2=parameterObject.getSingleVariableDeclaration();
              if (!processedMethods.contains(superMethodInvocation.resolveMethodBinding().getKey()))               processArgumentOfInternalMethodInvocation(methodObject2,argumentDeclaration,argumentPosition,parameterDeclaration2,processedMethods);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void processArgumentOfInternalMethodInvocation(MethodObject methodObject,AbstractVariable argumentDeclaration,int initialArgumentPosition,VariableDeclaration parameterDeclaration,Set<String> processedMethods){
  SystemObject systemObject=ASTReader.getSystemObject();
  if (methodObject.getMethodBody() == null) {
    IMethodBinding superMethodDeclarationBinding=methodObject.getMethodDeclaration().resolveBinding();
    IType superType=(IType)superMethodDeclarationBinding.getDeclaringClass().getJavaElement();
    processedMethods.add(superMethodDeclarationBinding.getKey());
    Set<IType> subTypes=CompilationUnitCache.getInstance().getSubTypes(superType);
    for (    IType subType : subTypes) {
      ClassObject subClassObject=systemObject.getClassObject(subType.getFullyQualifiedName('.'));
      if (subClassObject != null) {
        ListIterator<MethodObject> methodIterator=subClassObject.getMethodIterator();
        while (methodIterator.hasNext()) {
          MethodObject subMethod=methodIterator.next();
          if (equalSignature(subMethod.getMethodDeclaration().resolveBinding(),superMethodDeclarationBinding)) {
            ParameterObject parameterObject=subMethod.getParameter(initialArgumentPosition);
            VariableDeclaration parameterDeclaration2=parameterObject.getSingleVariableDeclaration();
            if (!processedMethods.contains(subMethod.getMethodDeclaration().resolveBinding().getKey()))             processArgumentOfInternalMethodInvocation(subMethod,argumentDeclaration,initialArgumentPosition,parameterDeclaration2,processedMethods);
            break;
          }
        }
      }
    }
  }
 else {
    for (    AbstractVariable originalField : methodObject.getDefinedFieldsThroughParameters()) {
      if (parameterDeclaration.resolveBinding().getKey().equals(originalField.getVariableBindingKey())) {
        AbstractVariable field=new CompositeVariable(argumentDeclaration.getVariableBindingKey(),argumentDeclaration.getVariableName(),argumentDeclaration.getVariableType(),argumentDeclaration.isField(),argumentDeclaration.isParameter(),((CompositeVariable)originalField).getRightPart());
        definedVariables.add(field);
      }
    }
    for (    AbstractVariable originalField : methodObject.getUsedFieldsThroughParameters()) {
      if (parameterDeclaration.resolveBinding().getKey().equals(originalField.getVariableBindingKey())) {
        AbstractVariable field=new CompositeVariable(argumentDeclaration.getVariableBindingKey(),argumentDeclaration.getVariableName(),argumentDeclaration.getVariableType(),argumentDeclaration.isField(),argumentDeclaration.isParameter(),((CompositeVariable)originalField).getRightPart());
        usedVariables.add(field);
      }
    }
    processedMethods.add(methodObject.getMethodDeclaration().resolveBinding().getKey());
    Map<AbstractVariable,LinkedHashSet<MethodInvocationObject>> invokedMethodsThroughParameters=methodObject.getInvokedMethodsThroughParameters();
    for (    AbstractVariable originalField : invokedMethodsThroughParameters.keySet()) {
      if (parameterDeclaration.resolveBinding().getKey().equals(originalField.getVariableBindingKey())) {
        AbstractVariable field=null;
        if (originalField instanceof PlainVariable)         field=argumentDeclaration;
 else         field=new CompositeVariable(argumentDeclaration.getVariableBindingKey(),argumentDeclaration.getVariableName(),argumentDeclaration.getVariableType(),argumentDeclaration.isField(),argumentDeclaration.isParameter(),((CompositeVariable)originalField).getRightPart());
        LinkedHashSet<MethodInvocationObject> methodInvocations=invokedMethodsThroughParameters.get(originalField);
        for (        MethodInvocationObject methodInvocationObject : methodInvocations) {
          MethodInvocation methodInvocation2=methodInvocationObject.getMethodInvocation();
          ClassObject classObject2=systemObject.getClassObject(methodInvocationObject.getOriginClassName());
          if (classObject2 != null) {
            MethodObject methodObject2=classObject2.getMethod(methodInvocationObject);
            if (methodObject2 != null) {
              processInternalMethodInvocation(classObject2,methodObject2,field,new LinkedHashSet<String>());
            }
          }
 else {
            LibraryClassStorage instance=LibraryClassStorage.getInstance();
            IMethodBinding invokedMethodBinding=methodInvocation2.resolveMethodBinding();
            if (instance.isAnalyzed(invokedMethodBinding.getKey())) {
              handleAlreadyAnalyzedMethod(invokedMethodBinding.getKey(),field,instance);
            }
 else {
              MethodDeclaration invokedMethodDeclaration=getInvokedMethodDeclaration(invokedMethodBinding);
              if (invokedMethodDeclaration != null)               processExternalMethodInvocation(invokedMethodDeclaration,field,new LinkedHashSet<String>(),0);
            }
          }
        }
      }
    }
    Map<PlainVariable,LinkedHashSet<MethodInvocationObject>> parametersPassedAsArgumentsInMethodInvocations=methodObject.getParametersPassedAsArgumentsInMethodInvocations();
    for (    PlainVariable parameter : parametersPassedAsArgumentsInMethodInvocations.keySet()) {
      if (parameterDeclaration.resolveBinding().getKey().equals(parameter.getVariableBindingKey())) {
        LinkedHashSet<MethodInvocationObject> methodInvocations=parametersPassedAsArgumentsInMethodInvocations.get(parameter);
        for (        MethodInvocationObject methodInvocationObject : methodInvocations) {
          ClassObject classObject2=systemObject.getClassObject(methodInvocationObject.getOriginClassName());
          if (classObject2 != null) {
            MethodObject methodObject2=classObject2.getMethod(methodInvocationObject);
            if (methodObject2 != null && !methodObject2.equals(methodObject)) {
              MethodInvocation methodInvocation2=methodInvocationObject.getMethodInvocation();
              int argumentPosition=getArgumentPosition(methodInvocation2.arguments(),parameter);
              ParameterObject parameterObject=methodObject2.getParameter(argumentPosition);
              VariableDeclaration parameterDeclaration2=parameterObject.getSingleVariableDeclaration();
              if (!processedMethods.contains(methodInvocation2.resolveMethodBinding().getKey()))               processArgumentOfInternalMethodInvocation(methodObject2,argumentDeclaration,argumentPosition,parameterDeclaration2,processedMethods);
            }
          }
        }
      }
    }
    Map<PlainVariable,LinkedHashSet<SuperMethodInvocationObject>> parametersPassedAsArgumentsInSuperMethodInvocations=methodObject.getParametersPassedAsArgumentsInSuperMethodInvocations();
    for (    PlainVariable parameter : parametersPassedAsArgumentsInSuperMethodInvocations.keySet()) {
      if (parameterDeclaration.resolveBinding().getKey().equals(parameter.getVariableBindingKey())) {
        LinkedHashSet<SuperMethodInvocationObject> superMethodInvocations=parametersPassedAsArgumentsInSuperMethodInvocations.get(parameter);
        for (        SuperMethodInvocationObject superMethodInvocationObject : superMethodInvocations) {
          ClassObject classObject2=systemObject.getClassObject(superMethodInvocationObject.getOriginClassName());
          if (classObject2 != null) {
            MethodObject methodObject2=classObject2.getMethod(superMethodInvocationObject);
            if (methodObject2 != null) {
              SuperMethodInvocation superMethodInvocation=superMethodInvocationObject.getSuperMethodInvocation();
              int argumentPosition=getArgumentPosition(superMethodInvocation.arguments(),parameter);
              ParameterObject parameterObject=methodObject2.getParameter(argumentPosition);
              VariableDeclaration parameterDeclaration2=parameterObject.getSingleVariableDeclaration();
              if (!processedMethods.contains(superMethodInvocation.resolveMethodBinding().getKey()))               processArgumentOfInternalMethodInvocation(methodObject2,argumentDeclaration,argumentPosition,parameterDeclaration2,processedMethods);
            }
          }
        }
      }
    }
  }
}