Project: JDT
Bug 39859 extract method: NPE [refactoring]
Reported: 2003-07-10 06:41:00 | Status: resolved fixed

20030703+latest 0709 public class A { void f(){ int i= 0; int j= 1; int k= i+j; int i1= 0; int j1= 1; int k1= i+j; } } select i+j type 'add' as method name change arg name from i to arg1 change arg name from j to arg2 'preview' java.lang.reflect.InvocationTargetException: java.lang.NullPointerException at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at java.lang.NullPointerException.<init>(NullPointerException.java:63) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring.create CallNodes(ExtractMethodRefactoring.java:513) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring.replac eDuplicates(ExtractMethodRefactoring.java:569) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring.create Change(ExtractMethodRefactoring.java:367) at org.eclipse.jdt.internal.ui.refactoring.CreateChangeOperation.run (CreateChangeOperation.java:104) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:101)

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/duplicates_in/A_test950.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/duplicates_in/A_test951.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/duplicates_in/A_test952.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/duplicates_in/A_test953.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/duplicates_in/A_test954.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/duplicates_out/A_test950.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/duplicates_out/A_test951.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/duplicates_out/A_test952.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/duplicates_out/A_test953.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/duplicates_out/A_test954.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTestSetup.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/SnippetFinder.java