Community
Participate
Working Groups
Running 200208270833 This code IWorkspace ws = testcasesPlugin.getWorkspace(); IWorkspaceRoot root = ws.getRoot(); IProject project = root.getProjects()[0]; IJavaProject jp = JavaCore.create(project); CompilationUnit cu = AST.parseCompilationUnit( "public class Class {/** Method theMethod.*/ void theMethod() {} }".toCharArray(), "Class", jp); cu.accept(new ASTVisitor() { public boolean visit(TypeDeclaration node) { Javadoc doc = node.getJavadoc(); // Javadoc must start before the type name! if (node.getName().getStartPosition() < doc.getStartPosition()) { System.out.println("Incorrect javadoc associated with type"); } return true; } }); produces Incorrect javadoc associated with type The problem is that ASTConverter.setJavaDocComment finds the *first* javadoc in the type - if the type doesn't have javadoc but a member does then that'll be returned as the type's doc. I think ASTConverter.setJavaDocComment should stop searching for javadoc once it finds a token other than a comment or whitespace. Thanks Mark
Thank you for all your nice reports. Fixed and released in 2.1 stream.
*** Bug 23264 has been marked as a duplicate of this bug. ***
Verified.
Regression test added (test0381)
Backported to 2.0.x stream. Regression test added in 2.0.x stream.
*** Bug 31626 has been marked as a duplicate of this bug. ***