Project: JDT
Bug 82330 IAE exception in Inline Method [refactoring]
Reported: 2005-01-06 11:09:06 | Status: resolved fixed

20050104: Steps to reproduce: private static boolean isEF(IField iField) throws JavaModelException { return JdtFlags.isPublic(iField) && JdtFlags.isStatic(iField) && JdtFlags.isFinal(iField); } private static boolean isEMe(IMember iMember) throws JavaModelException { switch (iMember.getElementType()) { case IJavaElement.METHOD: return isEM((IMethod) iMember); case IJavaElement.FIELD: return isEF((IField) iMember); default: return false; } } private static boolean isEM(IMethod iMethod) throws JavaModelException { return JdtFlags.isPublic(iMethod) && !JdtFlags.isStatic (iMethod) && !iMethod.isConstructor(); } - Inline either isEM or isEF Stack trace: java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.getListRewrite (ASTRewrite.java:332) at org.eclipse.jdt.internal.corext.refactoring.code.CallInliner.addNewLocals (CallInliner.java:550) at org.eclipse.jdt.internal.corext.refactoring.code.CallInliner.perform (CallInliner.java:467) at org.eclipse.jdt.internal.corext.refactoring.code.InlineMethodRefactoring.checkF inalConditions(InlineMethodRefactoring.java:229) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run (CheckConditionsOperation.java:84) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run (CreateChangeOperation.java:114) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1688) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run (WorkbenchRunnableAdapter.java:58) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:111)

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/controlStatement_in/TestEnhancedForOne.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/controlStatement_in/TestEnhancedForTwo.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/controlStatement_out/TestEnhancedForOne.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/controlStatement_out/TestEnhancedForTwo.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/simple_in/TestCatchClause.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/simple_out/TestCatchClause.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/CallInliner.java