Community
Participate
Working Groups
see bug 3248: Fixed but can't relase due to the mentioned hierarchy problem. Jerome, can you have a look at it? My fix for the NewTypeWizardPage is attached here. Attachment 2129 [details] Replace the existing code from HEAD or 20021009 with this one. - Set a breakpoint in createInheritedMethods at ITypeHierarchy hierarchy= type.newSupertypeHierarchy(monitor); - Create a new class in the wizard, add e.g. 'MouseListener' as interface, check 'inherited abstract methods' - The type passed in createInheritedMethods is from a woking copy which is complete (type + superinterfaces + import) The original CU only contains a package statement. I suspect that this causes the problem. see also bug 24522
Pls investigate.
The contents of the working copy at this point is: /** * @author jeromel * * To change this generated comment edit the template variable "typecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of type comments go to * Window>Preferences>Java>Code Generation. */ public class A implements MouseListener{ } Note there are no imports, thus MouseListener cannot be resolved. Martin, please confirm this is a problem on your side.
I was sure the import was there. Will look again.
I just checked. The import is there. (20021008 + head jdt-ui + jcore update 10/09 - I replace NewTypeWizardPage with the one in the attachment (package statement is missing, sorry) - Set a breakpoint in createInheritedMethods - create class AX in default package, interface: MouseListener - breakpoint reached, in display view: display 'hierarchy.getSuperInterfaces(type)' (org.eclipse.jdt.core.IType[]) [] display 'type.getCompilationUnit().getSource()' (java.lang.String) package pack1; import java.awt.event.MouseListener; /** * @author maeschlimann * * To change this generated comment edit the template variable "typecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of type comments go to * Window>Preferences>Java>Code Generation. */ public class AX implements MouseListener{ }
I can see the import now. But the working copy is not consistent: 'type.getCompilationUnit().isConsistent()' returns false. You need to reconcile it after you updated its buffer. I did 'type.getCompilationUnit().reconcile()' in the debugger, and after that the hierarchy was correct.
*** Bug 24522 has been marked as a duplicate of this bug. ***
that's it. added the reconcile, works now! thanks a lot! ok to close.
Closing