Program: 186057
Project: 186057
Buggy source:
public VisitStatus acceptASTNode(ASTNode node,TypeLookupResult result,IJavaElement enclosingElement){
  if (node instanceof ClassExpression || node instanceof ClassNode || node instanceof ImportNode|| node instanceof AnnotationNode|| node instanceof ConstructorNode) {
    ASTNode noArray;
    if (node instanceof ClassNode) {
      noArray=removeArray((ClassNode)node);
    }
 else     if (node instanceof ConstructorNode) {
      noArray=((ConstructorNode)node).getDeclaringClass();
    }
 else {
      noArray=node;
    }
    ClassNode type;
    if (node instanceof ConstructorNode) {
      type=((ConstructorNode)node).getDeclaringClass();
    }
 else {
      type=result.type;
    }
    if (node instanceof ClassExpression && type == VariableScope.CLASS_CLASS_NODE) {
      type=((ClassExpression)node).getType();
    }
    if (type != null) {
      String qualifiedName=removeArray(type).getName();
      if (qualifiedNameMatches(qualifiedName) && noArray.getEnd() > 0) {
        int start;
        int end;
        if (node instanceof ImportNode) {
          node=((ImportNode)node).getType();
          start=node.getStart();
          end=node.getEnd();
        }
 else         if (node instanceof ClassExpression) {
          start=node.getStart();
          end=start + ((ClassExpression)node).getType().getNameWithoutPackage().length();
        }
 else         if (node instanceof ClassNode) {
          ClassNode classNode=(ClassNode)node;
          if (classNode.getNameEnd() > 0) {
            start=classNode.getNameStart();
            end=classNode.getNameEnd() + 1;
          }
 else {
            classNode=maybeGetComponentType(classNode);
            start=classNode.getStart();
            end=start + classNode.getNameWithoutPackage().length();
          }
        }
 else         if (node instanceof ConstructorNode) {
          start=((ConstructorNode)node).getNameStart();
          end=((ConstructorNode)node).getNameEnd() + 1;
        }
 else {
          start=node.getStart();
          end=node.getEnd();
        }
        SearchMatch match=new SearchMatch(enclosingElement,getAccuracy(result.confidence),start,end - start,participant,enclosingElement.getResource());
        try {
          requestor.acceptSearchMatch(match);
        }
 catch (        CoreException e) {
          Util.log(e,"String_Node_Str" + enclosingElement);
        }
      }
    }
  }
  return VisitStatus.CONTINUE;
}

Fixed version (ground truth):
public VisitStatus acceptASTNode(ASTNode node,TypeLookupResult result,IJavaElement enclosingElement){
  if (node instanceof ClassExpression || node instanceof ClassNode || node instanceof ImportNode|| node instanceof AnnotationNode|| node instanceof ConstructorNode) {
    ASTNode noArray;
    if (node instanceof ClassNode) {
      noArray=removeArray((ClassNode)node);
    }
 else     if (node instanceof ConstructorNode) {
      noArray=((ConstructorNode)node).getDeclaringClass();
    }
 else {
      noArray=node;
    }
    ClassNode type;
    if (node instanceof ConstructorNode) {
      type=((ConstructorNode)node).getDeclaringClass();
    }
 else {
      type=result.type;
    }
    if (node instanceof ClassExpression && type == VariableScope.CLASS_CLASS_NODE) {
      type=((ClassExpression)node).getType();
    }
    if (type != null) {
      String qualifiedName=removeArray(type).getName();
      if (qualifiedNameMatches(qualifiedName) && noArray.getEnd() > 0) {
        int start;
        int end;
        if (node instanceof ImportNode) {
          node=((ImportNode)node).getType();
          start=node.getStart();
          end=node.getEnd();
        }
 else         if (node instanceof ClassExpression) {
          start=node.getStart();
          end=start + ((ClassExpression)node).getType().getNameWithoutPackage().length();
        }
 else         if (node instanceof ClassNode) {
          ClassNode classNode=(ClassNode)node;
          if (classNode.getNameEnd() > 0) {
            start=classNode.getNameStart();
            end=classNode.getNameEnd() + 1;
          }
 else           if (classNode.redirect() == classNode) {
            start=end=-1;
          }
 else {
            classNode=maybeGetComponentType(classNode);
            start=classNode.getStart();
            end=start + classNode.getNameWithoutPackage().length();
          }
        }
 else         if (node instanceof ConstructorNode) {
          start=((ConstructorNode)node).getNameStart();
          end=((ConstructorNode)node).getNameEnd() + 1;
          if (start == 0 && end == 1) {
            start=end=-1;
          }
        }
 else {
          start=node.getStart();
          end=node.getEnd();
        }
        if (start >= 0 && end >= 0) {
          SearchMatch match=new SearchMatch(enclosingElement,getAccuracy(result.confidence),start,end - start,participant,enclosingElement.getResource());
          try {
            requestor.acceptSearchMatch(match);
          }
 catch (          CoreException e) {
            Util.log(e,"String_Node_Str" + enclosingElement);
          }
        }
      }
    }
  }
  return VisitStatus.CONTINUE;
}