Summary: | Organize Import: missing import | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dirk Baeumer <dirk_baeumer> |
Component: | Core | Assignee: | 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
2002-04-29 11:38:46 EDT
Resolving the simple name 'Dialog' resolves in a TypeBinding to name= "junit.awtui.AboutDialog" 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()) 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. is this in 20020430? I guess so. I didn't see the drop done yet, so it should be included in the today's drop. |