Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 129691

Summary: IFile added to list of imports but is not required
Product: [Eclipse Project] JDT Reporter: Lawrence Mandel <lmandel>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: martinae
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Lawrence Mandel CLA 2006-02-27 17:53:32 EST
While developing the WSDL validator in WTP I noticed that whenever I organize the imports of a certain class org.eclipse.core.IFile is added even though it is not required. This leads to a compile warning in the build (that does not show up in my development environment).

The class in question is org.eclipse.wst.wsdl.validation.internal.xml.DefaultXMLValidator.

The problem can be seen first hand by extracting /wst/components/wsdl/plugins/org.eclipse.wst.wsdl.validation
into a workspace from dev.eclipse.org /cvsroot/webtools
Comment 1 Lawrence Mandel CLA 2006-02-27 17:55:33 EST
This was found on 3.2M5a, although I've seen the problem on older drivers.
Comment 2 Martin Aeschlimann CLA 2006-03-01 06:04:37 EST
When I do this I get the new import, but it is not marked as unnecessary.
It is in fact used in a @see tag of a Javadoc comment.
When I remove the import again, I get a 'unknown' type warning on 'IFile'

What are your settings on the 'Java > Compiler > Javadoc' preference page?

Moving to jdt.core as it seems a wrongly reported unnecessary import.

Comment 3 Olivier Thomann CLA 2006-03-01 09:49:34 EST
You need to pass the -enableJavadoc option in a batch compile.
In your environment you are processing comments in order to resolve references, this is why the import is added.
In your batch compile, you don't trigger the javadoc processing and this is why the import is reported as unused.
Use a compilearg nested element in your javac ant task to fix this.
Closing as INVALID.
Please reopen if you do have the -enableJavadoc option set.
Comment 4 Lawrence Mandel CLA 2006-03-01 11:58:54 EST
Thanks for clearing up the misunderstanding. I've cleaned up the comment and will take a look at my workspace settings.