Bug 89047 - Missing class shows up as unused import
Summary: Missing class shows up as unused import
Status: RESOLVED DUPLICATE of bug 95909
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-24 16:47 EST by Tod Creasey CLA
Modified: 2005-05-20 04:50 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2005-03-24 16:47:02 EST
I20050324-1400

When I loaded org.eclipse.ui.workbench from HEAD the class
org.eclipse.ui.actions.BaseNewWizardMenu had two missing class references:

import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.dynamicHelpers.IExtensionChangeHandler;

For these we got unused import errors - they are in use just not resolved.

When we loaded runtime we were fine - no error.
Comment 1 Philipe Mulet CLA 2005-03-25 02:26:29 EST
Please describe exact steps to reproduce. What did your workspace contain
initially ?

In original case, if removing the imports, is any error diagnosed ? If not, why
do  you think they are useful ?
Comment 2 Philipe Mulet CLA 2005-03-25 02:27:30 EST
Or are you saying that originally you had 2 unresolved imports, which also got
flagged as unused ?
Comment 3 Michael Fraenkel CLA 2005-03-25 10:14:53 EST
The complaint is that in the Java Editor it is flagged as an unused import when
later on its known as an unresolved class.
In the problems view, there is an error for the unused import as well as errors
within the source that the type cannot be found.

The import org.eclipse.core.runtime.dynamicHelpers.IExtensionChangeHandler
cannot be resolved (line 24)
IExtensionChangeHandler cannot be resolved to a type (line 58)

My personal view is that this boils down to cascading errors.  Since the type in
the code can't be resolved, the import is flagged unused.
Comment 4 Tod Creasey CLA 2005-03-28 08:24:41 EST
Exactly. I had two unresolved references that showed up as unused imports. As
these were the first errors displayed it was confusing as to what was going on.
Comment 5 Philipe Mulet CLA 2005-05-20 04:50:58 EDT
Agreed. The check for unused imports was only disabled in presence of syntax
errors. But in certain situations, some errors may hinder its accuracy.
Changed check to only perform if after resolution no error got detected.

*** This bug has been marked as a duplicate of 95909 ***