Community
Participate
Working Groups
On code like: public class Outer { public class Inner { /** * Does something. * * @see #outerFunc */ public void innerFunc() {} } public void outerFunc() {} } turning the preference Java > Compiler > Javadoc > Malformed Javadoc comments to Warning causes a spurious "outerFunc cannot be resolved or is not a field" error on the @see tag. The javadoc tool handles this just fine. Eclipse should too. (On 3.0RC1)
Created attachment 11542 [details] Patch files for fix and its tests Problem came from the fact that we always used scope.getMethod(...) while resolving javadoc message send binding, even when this is an implicit reference. Fix by using scope.getImplicitMethod(...) when the receiver type is an implicit javadoc type reference. Fix also similar problem while resolving javadoc field references which fails (returns a ProblemFieldBinding) when javadoc was in a nested type. In this case, enlarge search with scope.getBinding(...) to see whether we have an extra chance to get a valid binding in enclosing type.
Created attachment 11588 [details] Update patch for tests While running AllJDTCore tests, Compliance_1_3 failed due to the fact that tests 77 assume that error was not reported in Javadoc. With current fix, we know report this error, so test was modified accordingly. Patch pass all tests: - AllJDTCore - JDT/UI: Automated + Refactoring - Massive: ASTConverterJavadoc + DefaultCommentMapper Note that all tests were run with global patch including also fixes for bug 65174, bug 65253 and bug 65288
Fixed. Method and field javadoc references are now resolved in inner classes. [jdt-core-internal] See patch file for changes. Test case added in JavadocTestMixed. Also modify some existing test cases in Compiler_1_3 and JavaSearchJavadocTests impacted by the changes...
Verified for 3.0RC2
I am still seeing this on RC2 (200406111814), in the code that I originally posted as a sample. Am I missing something?
Yes, you're missing parenthesis in your reference... You should have: public class Outer { public class Inner { /** * Does something. * * @see #outerFunc() */ public void innerFunc() {} } public void outerFunc() {} } to see the warning disappearing... Method reference without parenthesis are infered when there's only one corresponding method in class, but it's only possible for top classes, not for inner class... As it was said in bug 51911, this inference is a luxary solution and unfortunately has some currently some limitation... Please set as VERIFIED if you agree... thx
Verified in 3.0 final