Project: JDT
Bug 31601 JME when changing method signature
Reported: 2003-02-11 17:30:43 | Status: resolved fixed

20030206 - JUnit setup - select Assert.assertNotNull(String, Object) in Outliner - activate Change Method Signature - swap arguments - OK You get the following exception in the log. Java Model Exception: Java Model Status [assertNull [in Assert [in [Working copy] Assert.java [in junit.framework [in [project root] [in JUnit]]]]] does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:482) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:511) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:296) at org.eclipse.jdt.internal.core.SourceMethod.getSignature (SourceMethod.java:133) at org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureRefactoring .getInitialReturnTypeName(ChangeSignatureRefactoring.java:132) at org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureRefactoring .<init>(ChangeSignatureRefactoring.java:122) at org.eclipse.jdt.ui.actions.ModifyParametersAction.shouldAcceptElement (ModifyParametersAction.java:156) at org.eclipse.jdt.ui.actions.ModifyParametersAction.canEnable (ModifyParametersAction.java:130) at org.eclipse.jdt.ui.actions.ModifyParametersAction.selectionChanged (ModifyParametersAction.java:88) at org.eclipse.jdt.ui.actions.ModifyParametersAction.run (ModifyParametersAction.java:108) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun (SelectionDispatchAction.java:191) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run (SelectionDispatchAction.java:169) at org.eclipse.jface.action.Action.runWithEvent(Action.java:804) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:450) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:398) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:392) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:72) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1692) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1410) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1289) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1272) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539) IMO the problem is that selectionChanged is called with the original element which signature got changed.

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