Summary: | ASTParser is returning incorrect TypeDeclaration | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Jeffrey Liu <jeffliu> |
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> |
Status: | RESOLVED WORKSFORME | QA Contact: | |
Severity: | major | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1 M6 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Jeffrey Liu
2005-03-16 12:22:32 EST
Can you make a try using ASTView 1.0.4 and let us know if the TypeDeclaration is also incorrect in this view? You can find this utility on following page: http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-ui-home/main.html Thx In fact ASTView page location is: http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-ui-home/plugins/org.eclipse.jdt.astview/index.html Type declaration seems to be correct using ASTView. Perhaps a problem with your visitor? Can you attach it to this bug? Here's my visitor (inner class): private class MyJavadocVisitor extends ASTVisitor { public MyJavadocVisitor(String pkg) { } public boolean visit(TypeDeclaration node) { String name = node.getName().getFullyQualifiedName(); Javadoc javadoc = node.getJavadoc(); if (javadoc != null) System.out.println(name + " has javadoc"); else System.out.println("Warning! " + name + " does not have any javadoc!!!"); return true; } public boolean visit(MethodDeclaration node) { return true; } } The console output: Warning! IOptionalTask does not have any javadoc!!! For some reason, the blank line trick no longer work. But in any event, I removed all the field declaration and the javadocs for the field. Rerun my visistor, and here's the console output: IOptionalTask has javadoc IOptionalTask!!!??? I cannot se it in sample provided in comment 0... Are you sure of your test case? Cannot reproduce with your visitor *and* sample of comment 0. I get following output: IRuntimeTargetHandler has javadoc Warning! IRuntime does not have any javadoc!!! Warning! IRuntimeType does not have any javadoc!!! Two last lines are due to the fact that I've added two lines to your sample to avoid compiler errors: interface IRuntime {} interface IRuntimeType {} Please verify your test case and reopen when sure of the error, thanks Sorry, I realized that IOptionalTask comes from bug 88206... However, I still cannot reproduce neither this bug nor bug 88206. With IOptionalTask, I get: IOptionalTask has javadoc Warning! ITask does not have any javadoc!!! (I've also added interface ITask {} at the end of your sample to avoid compiler error) Does your project is a plugin with dependency on org.eclipse.jdt.core? Please reopen while provindg requested info and if you find a reproduceable test case, thanks |