Project: JDT
Bug 40320 extract method: NPE (dup code replacement) [refactoring]
Reported: 2003-07-17 07:00:14 | Status: resolved fixed

20030716 class S{ void f(){ f(); f(); f(); f(); } } select the first 2 calls to f() extract method, choose name OK 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.getTar getNode(ExtractMethodRefactoring.java:492) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring.replac eDuplicates(ExtractMethodRefactoring.java:568) 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 (Unknown Source)

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