[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: javadocs null for duplicate fields and methods

Seems to be a bug. Could you please file it at
https://bugs.eclipse.org/bugs/
for JDT/Core?

Note that the comments are available via CompilationUnit#getCommentList() in both cases.

Thanks,
Markus


Toan wrote:
When using the ASTParser, if the resolve bindings is turned on
(.setResolveBindings(true)) the javadoc for any duplicate fields or methods
are null.

For example, when using ASTParser with the following source:

public class A {
 /**
  * my field javadoc comment
  */
 private int myField;

 /**
  * my duplicated field javadoc comment
  */
 private int myField;

 /**
  * my method javadoc comment
  */
 private void myMethod() {
 }

 /**
  * my duplicated method javadoc comment
  */
 private void myMethod() {
 }
}

If the resolve binding is on, the FieldDeclaration.getJavadoc() for both fields named "myField" and the MethodDeclaration.getJavadoc() for both methods named "myMethod" will return null.
However, if resolve binding is off, the javadoc returned is non-null.


Why would having resolve bindings set on set all duplicate fields' and methods' javadocs to null?

Note that duplicate classes in the same java file do not have this problem.