Bug 14852

Summary: Organize Import: missing import
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: akiezun, martinae
Version: 2.0   
Target Milestone: 2.0 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Dirk Baeumer CLA 2002-04-29 11:38:46 EDT
Build 20020425.3

- load AboutDialog from JUnit. 
- organize imports

observe: missing import Dialog
Comment 1 Martin Aeschlimann CLA 2002-04-30 05:21:14 EDT
Resolving the simple name 'Dialog' resolves in a TypeBinding to 
name= "junit.awtui.AboutDialog"
Comment 2 Martin Aeschlimann CLA 2002-04-30 07:44:36 EDT
20020425.JDTCore.04.30

	public void foo() throws IOException {
	}

IOExpception is resolved as method reference


This code looks wrong: DefaultBindingResolver.resolveName

		ASTNode parent = name.getParent();
		if (parent instanceof MethodDeclaration) {
			return this.resolveMethod((MethodDeclaration)parent);
		}
		if (parent instanceof TypeDeclaration) {
			return this.resolveType((TypeDeclaration)parent);
		}
<< should also test if name.equals((MethodDeclaration) parent).getName())
Comment 3 Olivier Thomann CLA 2002-04-30 10:18:15 EDT
Fixed and released in HEAD. Now Organize imports returns:
import java.awt.Button;
import 
java.awt.Dialog;
import java.awt.Font;
import java.awt.Frame;
import 
java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import 
java.awt.Insets;
import java.awt.Label;
import java.awt.event.ActionEvent;
import 
java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import 
java.awt.event.WindowEvent;

for the class junit.awtui.AboutDialog. The IOException in 
a throws clause is now returned as a ITypeBinding.
Comment 4 Martin Aeschlimann CLA 2002-04-30 10:57:14 EDT
is this in 20020430?
Comment 5 Olivier Thomann CLA 2002-04-30 11:01:59 EDT
I guess so. I didn't see the drop done yet, so it should be included in the today's drop.