Program: 83495
Project: 83495
Buggy source:
/** 
 * Invoked by   {@link HtmlGenerator}'s constructor to complete the initialization. <p> This is where the actual annotation of the source code happens.
 */
protected void configure(final CompilationUnitTree cu,final HtmlGenerator gen) throws IOException {
  final LineMap lineMap=cu.getLineMap();
  final LinkResolver linkResolver=linkResolverFactory.create(cu,this);
  JavaLexer lexer=new JavaLexer(new StringReader(gen.sourceFile));
  lexer.setTabSize(tabWidth);
  try {
    while (true) {
      Token token=lexer.nextToken();
      int type=token.getType();
      if (type == JavaTokenTypes.EOF)       break;
      if (type == JavaTokenTypes.IDENT && ReservedWords.LIST.contains(token.getText()))       gen.add(new LexicalMarker(lineMap,token,"String_Node_Str"));
      if (type == JavaTokenTypes.ML_COMMENT || type == JavaTokenTypes.SL_COMMENT)       gen.add(new CommentMarker(lineMap,token));
    }
  }
 catch (  TokenStreamException e) {
  }
  new MarkerBuilder<Void,Void>(cu,gen,linkResolver,srcPos,elements,types){
    /** 
 * primitive types like int, long, void, etc.
 */
    public Void visitPrimitiveType(    PrimitiveTypeTree pt,    Void _){
      gen.add(new LexicalMarker(cu,srcPos,pt,"String_Node_Str"));
      return super.visitPrimitiveType(pt,_);
    }
    /** 
 * literal string, int, etc. Null.
 */
    public Void visitLiteral(    LiteralTree lit,    Void _){
      gen.add(new LexicalMarker(cu,srcPos,lit,"String_Node_Str"));
      return super.visitLiteral(lit,_);
    }
    /** 
 * Definition of a variable, such as parameter, field, and local variables.
 */
    public Void visitVariable(    VariableTree vt,    Void _){
      Element e=TreeUtil.getElement(vt);
      if (e != null) {
        if (e.getKind() != ElementKind.ENUM_CONSTANT) {
          Token t=gen.findTokenAfter(vt.getType(),vt.getName().toString());
          if (t != null) {
            addDecl(t,e);
          }
        }
 else {
          addDecl(vt,e);
        }
      }
      return super.visitVariable(vt,_);
    }
    private void addBookmark(    Tree t,    Bookmark bookmark){
      gen.add(lineMap.getLineNumber(srcPos.getStartPosition(cu,t)),bookmark);
    }
    /** 
 * Method declaration.
 */
    public Void visitMethod(    MethodTree mt,    Void _){
      ExecutableElement e=(ExecutableElement)TreeUtil.getElement(mt);
      if (e != null) {
        addDecl(mt,e);
        ParsedType pt=getParsedType((TypeElement)e.getEnclosingElement());
        Set<Match> r=pt.findOverriddenMethods(elements,e);
        if (!r.isEmpty()) {
          addBookmark(mt,new OverriddenMethodsBookmark(r,linkResolver));
        }
        r=pt.findOverridingMethods(elements,e);
        if (!r.isEmpty()) {
          addBookmark(mt,new OverridingMethodsBookmark(r,linkResolver));
        }
      }
      return super.visitMethod(mt,_);
    }
    /** 
 * Class declaration.
 */
    public Void visitClass(    ClassTree ct,    Void _){
      TypeElement e=(TypeElement)TreeUtil.getElement(ct);
      if (e != null) {
        addDecl(ct,e);
        List<ParsedType> descendants=getParsedType(e).descendants;
        if (!descendants.isEmpty()) {
          addBookmark(ct,new SubClassBookmark(descendants,linkResolver));
        }
        if (e.getNestingKind() == NestingKind.ANONYMOUS) {
          scan(ct.getMembers());
          return _;
        }
      }
      return super.visitClass(ct,_);
    }
    /** 
 * All the symbols found in the source code.
 */
    public Void visitIdentifier(    IdentifierTree id,    Void _){
      if (!ReservedWords.LIST.contains(id.getName().toString())) {
        Element e=TreeUtil.getElement(id);
        if (e != null) {
          addRef(id,e);
        }
      }
      return super.visitIdentifier(id,_);
    }
    /** 
 * "exp.token"
 */
    public Void visitMemberSelect(    MemberSelectTree mst,    Void _){
      long ep=srcPos.getEndPosition(cu,mst);
      long sp=ep - mst.getIdentifier().length();
      Element e=TreeUtil.getElement(mst);
      if (e != null)       addRef(sp,ep,e);
      return super.visitMemberSelect(mst,_);
    }
    public Void visitNewClass(    NewClassTree nt,    Void _){
      long ep=srcPos.getEndPosition(cu,nt.getIdentifier());
      long sp=srcPos.getStartPosition(cu,nt.getIdentifier());
      Element e=TreeUtil.getElement(nt);
      if (e != null)       addRef(sp,ep,e);
      scan(nt.getEnclosingExpression());
      scan(nt.getArguments());
      scan(nt.getTypeArguments());
      scan(nt.getClassBody());
      return _;
    }
    /** 
 * Method invocation of the form "exp.method()"
 */
    public Void visitMethodInvocation(    MethodInvocationTree mi,    Void _){
      ExpressionTree ms=mi.getMethodSelect();
      Element e=TreeUtil.getElement(mi);
      if (e != null) {
        Name methodName=e.getSimpleName();
        long ep=srcPos.getEndPosition(cu,ms);
        if (ep >= 0)         addRef(ep - methodName.length(),ep,e);
      }
      return super.visitMethodInvocation(mi,_);
    }
    private void scan(    List<? extends Tree> list){
      for (      Tree t : list)       scan(t);
    }
    private void scan(    Tree t){
      scan(t,null);
    }
  }
.scan(cu,null);
  ExpressionTree packageName=cu.getPackageName();
  if (packageName != null) {
    new MarkerBuilder<String,Void>(cu,gen,linkResolver,srcPos,elements,types){
      /** 
 * For "a" of "a.b.c"
 */
      public String visitIdentifier(      IdentifierTree id,      Void _){
        String name=id.getName().toString();
        PackageElement pe=elements.getPackageElement(name);
        addRef(id,pe);
        return name;
      }
      public String visitMemberSelect(      MemberSelectTree mst,      Void _){
        String baseName=scan(mst.getExpression(),_);
        String name=mst.getIdentifier().toString();
        if (baseName.length() > 0)         name=baseName + '.' + name;
        PackageElement pe=elements.getPackageElement(name);
        long ep=srcPos.getEndPosition(cu,mst);
        long sp=ep - mst.getIdentifier().length();
        addRef(sp,ep,pe);
        return name;
      }
    }
.scan(packageName,null);
  }
}

Fixed version (ground truth):
/** 
 * Invoked by   {@link HtmlGenerator}'s constructor to complete the initialization. <p> This is where the actual annotation of the source code happens.
 */
protected void configure(final CompilationUnitTree cu,final HtmlGenerator gen) throws IOException {
  final LineMap lineMap=cu.getLineMap();
  final LinkResolver linkResolver=linkResolverFactory.create(cu,this);
  JavaLexer lexer=new JavaLexer(new StringReader(gen.sourceFile));
  lexer.setTabSize(tabWidth);
  try {
    while (true) {
      Token token=lexer.nextToken();
      int type=token.getType();
      if (type == JavaTokenTypes.EOF)       break;
      if (type == JavaTokenTypes.IDENT && ReservedWords.LIST.contains(token.getText()))       gen.add(new LexicalMarker(lineMap,token,"String_Node_Str"));
      if (type == JavaTokenTypes.ML_COMMENT || type == JavaTokenTypes.SL_COMMENT)       gen.add(new CommentMarker(lineMap,token));
    }
  }
 catch (  TokenStreamException e) {
  }
  new MarkerBuilder<Void,Void>(cu,gen,linkResolver,srcPos,elements,types){
    /** 
 * primitive types like int, long, void, etc.
 */
    public Void visitPrimitiveType(    PrimitiveTypeTree pt,    Void _){
      gen.add(new LexicalMarker(cu,srcPos,pt,"String_Node_Str"));
      return super.visitPrimitiveType(pt,_);
    }
    /** 
 * literal string, int, etc. Null.
 */
    public Void visitLiteral(    LiteralTree lit,    Void _){
      gen.add(new LexicalMarker(cu,srcPos,lit,"String_Node_Str"));
      return super.visitLiteral(lit,_);
    }
    /** 
 * Definition of a variable, such as parameter, field, and local variables.
 */
    public Void visitVariable(    VariableTree vt,    Void _){
      Element e=TreeUtil.getElement(vt);
      if (e != null) {
        if (e.getKind() != ElementKind.ENUM_CONSTANT) {
          addDecl(gen.findTokenAfter(vt.getType(),true,vt.getName().toString()),e);
        }
 else {
          addDecl(vt,e);
        }
      }
      return super.visitVariable(vt,_);
    }
    private void addBookmark(    Tree t,    Bookmark bookmark){
      gen.add(lineMap.getLineNumber(srcPos.getStartPosition(cu,t)),bookmark);
    }
    /** 
 * Method declaration.
 */
    public Void visitMethod(    MethodTree mt,    Void _){
      ExecutableElement e=(ExecutableElement)TreeUtil.getElement(mt);
      if (e != null) {
        Tree prev=mt.getReturnType();
        if (prev != null)         addDecl(gen.findTokenAfter(prev,true,mt.getName().toString()),e);
 else         addDecl(gen.findTokenAfter(mt,false,mt.getName().toString()),e);
        ParsedType pt=getParsedType((TypeElement)e.getEnclosingElement());
        Set<Match> r=pt.findOverriddenMethods(elements,e);
        if (!r.isEmpty()) {
          addBookmark(mt,new OverriddenMethodsBookmark(r,linkResolver));
        }
        r=pt.findOverridingMethods(elements,e);
        if (!r.isEmpty()) {
          addBookmark(mt,new OverridingMethodsBookmark(r,linkResolver));
        }
      }
      return super.visitMethod(mt,_);
    }
    /** 
 * Class declaration.
 */
    public Void visitClass(    ClassTree ct,    Void _){
      TypeElement e=(TypeElement)TreeUtil.getElement(ct);
      if (e != null) {
        addDecl(gen.findTokenAfter(ct,false,ct.getSimpleName().toString()),e);
        List<ParsedType> descendants=getParsedType(e).descendants;
        if (!descendants.isEmpty()) {
          addBookmark(ct,new SubClassBookmark(descendants,linkResolver));
        }
        if (e.getNestingKind() == NestingKind.ANONYMOUS) {
          scan(ct.getMembers());
          return _;
        }
      }
      return super.visitClass(ct,_);
    }
    /** 
 * All the symbols found in the source code.
 */
    public Void visitIdentifier(    IdentifierTree id,    Void _){
      if (!ReservedWords.LIST.contains(id.getName().toString())) {
        Element e=TreeUtil.getElement(id);
        if (e != null) {
          addRef(id,e);
        }
      }
      return super.visitIdentifier(id,_);
    }
    /** 
 * "exp.token"
 */
    public Void visitMemberSelect(    MemberSelectTree mst,    Void _){
      long ep=srcPos.getEndPosition(cu,mst);
      long sp=ep - mst.getIdentifier().length();
      Element e=TreeUtil.getElement(mst);
      if (e != null)       addRef(sp,ep,e);
      return super.visitMemberSelect(mst,_);
    }
    public Void visitNewClass(    NewClassTree nt,    Void _){
      long ep=srcPos.getEndPosition(cu,nt.getIdentifier());
      long sp=srcPos.getStartPosition(cu,nt.getIdentifier());
      Element e=TreeUtil.getElement(nt);
      if (e != null)       addRef(sp,ep,e);
      scan(nt.getEnclosingExpression());
      scan(nt.getArguments());
      scan(nt.getTypeArguments());
      scan(nt.getClassBody());
      return _;
    }
    /** 
 * Method invocation of the form "exp.method()"
 */
    public Void visitMethodInvocation(    MethodInvocationTree mi,    Void _){
      ExpressionTree ms=mi.getMethodSelect();
      Element e=TreeUtil.getElement(mi);
      if (e != null) {
        Name methodName=e.getSimpleName();
        long ep=srcPos.getEndPosition(cu,ms);
        if (ep >= 0)         addRef(ep - methodName.length(),ep,e);
      }
      return super.visitMethodInvocation(mi,_);
    }
    private void scan(    List<? extends Tree> list){
      for (      Tree t : list)       scan(t);
    }
    private void scan(    Tree t){
      scan(t,null);
    }
  }
.scan(cu,null);
  ExpressionTree packageName=cu.getPackageName();
  if (packageName != null) {
    new MarkerBuilder<String,Void>(cu,gen,linkResolver,srcPos,elements,types){
      /** 
 * For "a" of "a.b.c"
 */
      public String visitIdentifier(      IdentifierTree id,      Void _){
        String name=id.getName().toString();
        PackageElement pe=elements.getPackageElement(name);
        addRef(id,pe);
        return name;
      }
      public String visitMemberSelect(      MemberSelectTree mst,      Void _){
        String baseName=scan(mst.getExpression(),_);
        String name=mst.getIdentifier().toString();
        if (baseName.length() > 0)         name=baseName + '.' + name;
        PackageElement pe=elements.getPackageElement(name);
        long ep=srcPos.getEndPosition(cu,mst);
        long sp=ep - mst.getIdentifier().length();
        addRef(sp,ep,pe);
        return name;
      }
    }
.scan(packageName,null);
  }
}