Project: JDT
Bug 40350 extract method: assertion failed [refactoring]
Reported: 2003-07-17 09:10:24 | Status: resolved fixed

20030716 public class S { Object f(){ f(f(), f()); return null; } private void f(Object object, Object object2) { } } select 'f(), f()' extract method a java.lang.reflect.InvocationTargetException: org.eclipse.jdt.internal.corext.Assert$AssertionFailedException: assertion failed; Can only collapse statements at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at org.eclipse.jdt.internal.corext.Assert$AssertionFailedException.<init> (Assert.java:55) at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:136) at org.eclipse.jdt.internal.corext.dom.ASTRewrite.collapseNodes (ASTRewrite.java:444) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring.getTar getNode(ExtractMethodRefactoring.java:492) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring.create Change(ExtractMethodRefactoring.java:347) 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.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/invalidSelection/A_test193.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/ExtractMethodAnalyzer.java