Program: 12242
Project: 12242
Buggy source:
private void infixExpressionHandler(Expression operand,Expression typeCheckExpression,IfStatementExpressionAnalyzer analyzer){
  SimpleName leftOperandName=null;
  if (operand instanceof SimpleName) {
    SimpleName leftOperandSimpleName=(SimpleName)operand;
    leftOperandName=leftOperandSimpleName;
  }
 else   if (operand instanceof QualifiedName) {
    QualifiedName leftOperandQualifiedName=(QualifiedName)operand;
    leftOperandName=leftOperandQualifiedName.getName();
  }
 else   if (operand instanceof FieldAccess) {
    FieldAccess leftOperandFieldAccess=(FieldAccess)operand;
    leftOperandName=leftOperandFieldAccess.getName();
  }
 else   if (operand instanceof MethodInvocation) {
    MethodInvocation methodInvocation=(MethodInvocation)operand;
    for (    MethodDeclaration method : methods) {
      SimpleName fieldInstruction=MethodDeclarationUtility.isGetter(method);
      if (fieldInstruction != null && method.resolveBinding().isEqualTo(methodInvocation.resolveMethodBinding())) {
        leftOperandName=fieldInstruction;
        break;
      }
      MethodInvocation delegateMethodInvocation=MethodDeclarationUtility.isDelegate(method);
      if (delegateMethodInvocation != null && method.resolveBinding().isEqualTo(methodInvocation.resolveMethodBinding())) {
        methodInvocation=delegateMethodInvocation;
        break;
      }
    }
    if (leftOperandName == null) {
      IMethodBinding methodInvocationBinding=methodInvocation.resolveMethodBinding();
      for (      InheritanceTree tree : inheritanceTreeList) {
        DefaultMutableTreeNode root=tree.getRootNode();
        String rootClassName=(String)root.getUserObject();
        ITypeBinding declaringClassTypeBinding=methodInvocationBinding.getDeclaringClass();
        if (rootClassName.equals(declaringClassTypeBinding.getQualifiedName())) {
          boolean found=false;
          for (          MethodInvocation key : typeMethodInvocationCounterMap.keySet()) {
            if (key.toString().equals(methodInvocation.toString())) {
              typeMethodInvocationCounterMap.put(key,typeMethodInvocationCounterMap.get(key) + 1);
              found=true;
            }
          }
          if (!found)           typeMethodInvocationCounterMap.put(methodInvocation,1);
          break;
        }
      }
    }
  }
  if (leftOperandName != null) {
    IBinding leftOperandNameBinding=leftOperandName.resolveBinding();
    if (leftOperandNameBinding.getKind() == IBinding.VARIABLE) {
      IVariableBinding leftOperandNameVariableBinding=(IVariableBinding)leftOperandNameBinding;
      if (leftOperandNameVariableBinding.isField() && (leftOperandNameVariableBinding.getModifiers() & Modifier.STATIC) != 0) {
        typeCheckElimination.addStaticType(analyzer.getCompleteExpression(),leftOperandName);
        typeCheckElimination.addRemainingIfStatementExpression(analyzer.getCompleteExpression(),analyzer.getRemainingExpression(typeCheckExpression));
      }
 else {
        for (        FieldDeclaration field : fields) {
          List<VariableDeclarationFragment> fragments=field.fragments();
          for (          VariableDeclarationFragment fragment : fragments) {
            IVariableBinding fragmentVariableBinding=fragment.resolveBinding();
            if (fragmentVariableBinding.isEqualTo(leftOperandNameVariableBinding)) {
              if (fieldTypeCounterMap.containsKey(fragment)) {
                fieldTypeCounterMap.put(fragment,fieldTypeCounterMap.get(fragment) + 1);
              }
 else {
                fieldTypeCounterMap.put(fragment,1);
              }
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void infixExpressionHandler(Expression operand,Expression typeCheckExpression,IfStatementExpressionAnalyzer analyzer){
  SimpleName leftOperandName=null;
  if (operand instanceof SimpleName) {
    SimpleName leftOperandSimpleName=(SimpleName)operand;
    leftOperandName=leftOperandSimpleName;
  }
 else   if (operand instanceof QualifiedName) {
    QualifiedName leftOperandQualifiedName=(QualifiedName)operand;
    leftOperandName=leftOperandQualifiedName.getName();
  }
 else   if (operand instanceof FieldAccess) {
    FieldAccess leftOperandFieldAccess=(FieldAccess)operand;
    leftOperandName=leftOperandFieldAccess.getName();
  }
 else   if (operand instanceof MethodInvocation) {
    MethodInvocation methodInvocation=(MethodInvocation)operand;
    for (    MethodDeclaration method : methods) {
      SimpleName fieldInstruction=MethodDeclarationUtility.isGetter(method);
      if (fieldInstruction != null && method.resolveBinding().isEqualTo(methodInvocation.resolveMethodBinding())) {
        leftOperandName=fieldInstruction;
        break;
      }
      MethodInvocation delegateMethodInvocation=MethodDeclarationUtility.isDelegate(method);
      if (delegateMethodInvocation != null && method.resolveBinding().isEqualTo(methodInvocation.resolveMethodBinding())) {
        methodInvocation=delegateMethodInvocation;
        break;
      }
    }
    if (leftOperandName == null) {
      IMethodBinding methodInvocationBinding=methodInvocation.resolveMethodBinding();
      for (      InheritanceTree tree : inheritanceTreeList) {
        DefaultMutableTreeNode root=tree.getRootNode();
        String rootClassName=(String)root.getUserObject();
        ITypeBinding declaringClassTypeBinding=methodInvocationBinding.getDeclaringClass();
        if (rootClassName.equals(declaringClassTypeBinding.getQualifiedName())) {
          boolean found=false;
          for (          MethodInvocation key : typeMethodInvocationCounterMap.keySet()) {
            if (key.toString().equals(methodInvocation.toString())) {
              typeMethodInvocationCounterMap.put(key,typeMethodInvocationCounterMap.get(key) + 1);
              found=true;
            }
          }
          if (!found)           typeMethodInvocationCounterMap.put(methodInvocation,1);
          break;
        }
      }
    }
  }
  if (leftOperandName != null) {
    IBinding leftOperandNameBinding=leftOperandName.resolveBinding();
    if (leftOperandNameBinding.getKind() == IBinding.VARIABLE) {
      IVariableBinding leftOperandNameVariableBinding=(IVariableBinding)leftOperandNameBinding;
      if (leftOperandNameVariableBinding.isField() && (leftOperandNameVariableBinding.getModifiers() & Modifier.STATIC) != 0) {
        if (analyzer.allParentNodesAreConditionalAndOperators()) {
          typeCheckElimination.addStaticType(analyzer.getCompleteExpression(),leftOperandName);
          typeCheckElimination.addRemainingIfStatementExpression(analyzer.getCompleteExpression(),analyzer.getRemainingExpression(typeCheckExpression));
        }
      }
 else {
        for (        FieldDeclaration field : fields) {
          List<VariableDeclarationFragment> fragments=field.fragments();
          for (          VariableDeclarationFragment fragment : fragments) {
            IVariableBinding fragmentVariableBinding=fragment.resolveBinding();
            if (fragmentVariableBinding.isEqualTo(leftOperandNameVariableBinding)) {
              if (fieldTypeCounterMap.containsKey(fragment)) {
                fieldTypeCounterMap.put(fragment,fieldTypeCounterMap.get(fragment) + 1);
              }
 else {
                fieldTypeCounterMap.put(fragment,1);
              }
            }
          }
        }
      }
    }
  }
}