Project: JDT
Bug 67314 Refactoring - NPE when extracting interface [refactoring]
Reported: 2004-06-15 13:43:34 | Status: verified fixed

build 3.0RC2 1) create X.java public class X { public void foo(int i){} public void foo(int i){} } 2) select the second method 'foo' 3) do Refactor>Extract interface 4) name the interface 'I' and select at least one method 5) do OK an error window appear and an NPE occur java.lang.NullPointerException at org.eclipse.jdt.internal.corext.codemanipulation.ImportsStructure.addImport (ImportsStructure.java:424) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceRefactori ng.addImportsToTypesReferencedInMethodDeclarations (ExtractInterfaceRefactoring.java:628) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceRefactori ng.addImportsToNewCu(ExtractInterfaceRefactoring.java:488) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceRefactori ng.createExtractedInterfaceCUSource(ExtractInterfaceRefactoring.java:481) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceRefactori ng.createExtractedInterface(ExtractInterfaceRefactoring.java:445) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceRefactori ng.createChange(ExtractInterfaceRefactoring.java:276) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run (CreateChangeOperation.java:117) at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run (PerformChangeOperation.java:182) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1673) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run (WorkbenchRunnableAdapter.java:58) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:101)

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ReferenceFinderUtil.java