Bug 12205 - NPE in Extract Local Variable refactoring
Summary: NPE in Extract Local Variable refactoring
Status: RESOLVED DUPLICATE of bug 11622
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Erich Gamma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-25 09:08 EST by Ilja Preuss CLA
Modified: 2002-03-25 09:29 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ilja Preuss CLA 2002-03-25 09:08:01 EST
Given the code

public abstract class Test {

  public int[] foo() {
    return null;
  }  
  
  public void bar(Test test) {
    int[] i = test.foo(); // refactor this
  }

}

Extract Local Variable refactoring on "test.foo()" results in

java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.dom.Bindings.asPackageQualifiedName
(Bindings.java:52)
	at 
org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.addImpor
tIfNeeded(ExtractTempRefactoring.java:284)
	at 
org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.createCh
ange(ExtractTempRefactoring.java:266)
	at org.eclipse.jdt.internal.ui.refactoring.CreateChangeOperation.run
(CreateChangeOperation.java:97)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:98)
Comment 1 Adam Kiezun CLA 2002-03-25 09:29:13 EST
fixed when fixing bug 11537

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