Community
Participate
Working Groups
build i0316:1300 Interesting scenerio. I have unused imports set to show as a compiler warning. I have a class loaded in my workspace and I have no warnings. But there are warnings in the log for today's integration build. Looking at the class further, there are no code references but there is a reference in the javadoc. When I delete the javadoc reference, the warning appears that my import is unused. org.eclipse.core.resources.ResourcesPlugin (v20040316a)
Note that hitting ctrl-shift-o to organize imports brings the import statement back into the file.
I thought this was fixed with bug 52264.
Questions about your test case: 1) have you Javadoc global option activated in your workspace or on the project of the offending class? 2) did you hit Ctrl-Shift-O to organize import after having removed the reference in javadoc or before?
Where is this Global javadoc option? I didn't set anything so I would presume that it would be the default value. I did ctrl-shift-o both before and after removing the reference in the javadoc. When I removed the reference the organize import was fine.
The javadoc global option is on Preference->Java->Compiler->Javadoc tab. If this option is not set then you only have one check-bock ("Process Javadoc comments") to set on this compiler tab. Otherwise, if the check-box is checked, then you have access to other Javadoc options on this tab: - Malformed Javadoc comments - Missing Javadoc tags - Missing Javadoc comments My assumption is that this global option is set in your workspace. This would explain why you have no warnings in your workspace: when this option is set, javadoc comments are parsed, so reference to your class is seen, then the import is used :) But during the integration the global is not set, so the javadoc is not parsed, the reference is not seen, then the import is not used... This problem was noticed by bug 55478 and fixed. So, could you please change your ant script to include new Main compiler option (-enableJavadoc) to enable javadoc option during your build and let me know if it fixes this issue?
Adding Sonia to the CC list for comment. Recommend that we add the "-enableJavadoc" command-line compiler arg to the build process.
The N20040331 build ran with this flag. Any way to verify that it had the desired effect from the compile logs?
DJ, could oyu let me know if this problem is fixed with the proposed solution? thx
I've changed org.eclipse.core.resources.ResourcesPlugin to use the short names in the javadoc and add the import statements. I released this to HEAD so we can check the results in the next nightly build.
The unused imports are still listed as problems with build i0413:1110.
Patch received, to verify in the N20040415 build (compilerArg set to - enableJavadoc in our outermost script).
DJ, It seems to be fixed as I didn't see any compiler warning for resources component :) Do you agree if I close this bug as duplicate of bug 55478? Sonia, I think this option should be also set for jdt-core projects: - org.eclipse.jdt.core - org.eclipse.jdt.core.tests.compiler - org.eclipse.jdt.core.tests.model - org.eclipse.jdt.core.tests.builder I've seen in N20040415 results that jdt.core.tests.model has similar errors which will be fixed when this option will be set. TIA
Sonia, Sorry, the warnings in org.eclipse.jdt.core.tests.model project were not due to missing -enableJavadoc option, they were "real" unused imports and I've fixed them...
yes, this can be marked as fixed or a dup.
*** This bug has been marked as a duplicate of 55478 ***