Bug 55478 - Unused import not reported in IDE
Summary: Unused import not reported in IDE
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M8   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 55039 55499 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-21 09:56 EST by Nick Edgar CLA
Modified: 2004-04-15 10:19 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2004-03-21 09:56:17 EST
build I20040318-1131

I noticed that the build results from the last nightly build were reporting
unused import warnings in org.eclipse.ui.internal.CyclePartAction (in plugin
org.eclipse.ui.workbench).

In my IDE, this is not getting reported, either as a warning or an error, even
though I have this compiler option set to error, and other unused imports are
getting properly reported in other projects.

Tried rebuilding the project first, then rebuild all, but neither caused it to
show up.
Checked project compiler properties, and they're set to use workspace options,
not project options.
Comment 1 Nick Edgar CLA 2004-03-21 09:57:07 EST
The unused import is for org.eclipse.jface.action.Action, which is an indirect
superclass of this CU, but is not referenced directly within the CU.
Comment 2 Nick Edgar CLA 2004-03-21 10:06:03 EST
The problem must be due to the recent change to check Javadoc refs, or different
defaults in releng vs. my setup.

CyclePartAction hsa a ref in its Javadoc:
	/**
	 * @see Action#run()
	 */

If this is removed, then the missing import error appears.
Comment 3 Nick Edgar CLA 2004-03-21 10:13:42 EST
Seems like, in this case, my IDE did the right thing, and that the releng
compiler version should be upgraded, or its settings changed to consider refs
from Javadoc comments.

In my compiler options, on the Javadoc page, I have Process Javadoc comment
checked, but the 3 options below it set to Ignore.  If I uncheck it, I get the
same behaviour as the build.
Comment 4 Olivier Thomann CLA 2004-03-22 09:15:46 EST
I suspect this is a consequence of bug 52264.
The ant adapter is not using the same default options.
Comment 5 Sonia Dimitrov CLA 2004-03-22 09:25:15 EST
*** Bug 55499 has been marked as a duplicate of this bug. ***
Comment 6 Philipe Mulet CLA 2004-03-22 11:58:49 EST
The batch compiler and its Ant adapter versions are not allowing to process 
Javadocs independantly from reporting errors in them. Until it does, you need 
to enable the option -warn:javadoc so as to cause references from within 
Javadocs to be taken into consideration by the unused import diagnosis.

We don't want to make this a default for the command line tool, as no compiler 
tool is expected to raise errors if references in Javadocs are not resolved. 
We will add a separate option to enable Javadoc (-enableJavadoc or -ej?) 
without having it report errors in there.
Comment 7 Olivier Thomann CLA 2004-03-24 12:16:43 EST
The batch compiler has been updated.
Fixed and released in HEAD.
The ant adapter has not been modified. You need to use the compiler arg nested
element with -enableJavadoc to activate the javadoc support.
Comment 8 Frederic Fusier CLA 2004-03-25 06:15:37 EST
Verified for 3.0 using build I200403250010 + patch jdt-core.
Comment 9 Frederic Fusier CLA 2004-04-15 10:19:33 EDT
*** Bug 55039 has been marked as a duplicate of this bug. ***