Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled event loop exception during Refactor Rename #51

Closed
MahatmaFatalError opened this issue May 13, 2022 · 2 comments
Closed

Unhandled event loop exception during Refactor Rename #51

MahatmaFatalError opened this issue May 13, 2022 · 2 comments
Labels
question Further information is requested

Comments

@MahatmaFatalError
Copy link

Out of a sudden, Refactor > Rename... of a java class name, field name, method etc. does not work anymore but produces the following Unhandled event loop exception message in the error log.

java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/eclipse/jdt/internal/corext/dom/LinkedNodeFinder.findByNode(Lorg/eclipse/jdt/core/dom/ASTNode;Lorg/eclipse/jdt/core/dom/Name;)[Lorg/eclipse/jdt/core/dom/Name; @11: invokestatic
  Reason:
    Type '[Lorg/eclipse/jdt/core/dom/Name;' (current frame, stack[0]) is not assignable to '[Lorg/eclipse/jdt/core/dom/SimpleName;'
  Current Frame:
    bci: @11
    flags: { }
    locals: { 'org/eclipse/jdt/core/dom/ASTNode', 'org/eclipse/jdt/core/dom/Name', '[Lorg/eclipse/jdt/core/dom/Name;' }
    stack: { '[Lorg/eclipse/jdt/core/dom/Name;' }
  Bytecode:
    0000000: 2a2b b801 044d 2cc6 000b 2cb8 016b b801
    0000010: 6bb0 2bb6 0106 b600 f63e 1d10 1e9f 000f
    0000020: 1d10 0a9f 0009 1d10 12a0 0035 bb00 d059
    0000030: b700 d23a 04bb 0109 592b 1904 b701 0b3a
    0000040: 052a 1905 b600 d819 0419 04b6 00dc bd01
    0000050: 07b6 00df c001 0eb8 016b b801 6bb0 04bd
    0000060: 0107 5903 2b53 b801 6bb8 016b b0       
  Stackmap Table:
    append_frame(@18,Object[#270])
    append_frame(@44,Integer)
    same_frame(@94)

	at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameLinkedMode.start(RenameLinkedMode.java:238)
	at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:250)
	at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.doRun(RenameJavaElementAction.java:190)
	at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:162)
	at org.eclipse.jdt.ui.actions.RenameAction.run(RenameAction.java:121)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:278)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:252)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
	at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:121)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
	at jdk.internal.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:317)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:251)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:308)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:580)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:647)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:439)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:96)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1170)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4574)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1524)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1547)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1532)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1561)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1557)
	at org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:522)
	at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:614)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6260)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:236)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2162)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2487)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6380)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5628)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5767)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:117)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3938)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1467)

eclipse.buildId=4.14.1.202204250734
java.version=11.0.9.1
java.vendor=SAP SE
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_DE
Framework arguments: -product org.springframework.boot.ide.branding.sts4

@jjohnstn jjohnstn added the question Further information is requested label May 13, 2022
@jjohnstn
Copy link
Contributor

Hello, your build id doesn't look right. Perhaps you manually entered this and put 14 instead of 24? Otherwise, you have a 2022 build of 4.14 which is quite old. The actual current code in question should not cause the problem you are seeing. Around line 238, the current code has:

		if (! (selectedNode instanceof Name)) {
			return; // TODO: show dialog
		} else if (this.fJavaElement != null &&
				this.fJavaElement.getElementType() ==  IJavaElement.JAVA_MODULE) {
			nameNode = (Name) selectedNode;
			ASTNode parent = nameNode.getParent();
			while(parent instanceof Name) {
				nameNode = (Name) parent;
				parent = nameNode.getParent();
			}
			fOriginalName= nameNode.getFullyQualifiedName();
			pos= nameNode.getStartPosition();
		} else if (! (selectedNode instanceof SimpleName)) {
			return; // TODO: show dialog
		} else {
			nameNode = (SimpleName)selectedNode;
			fOriginalName = ((SimpleName)nameNode).getIdentifier();
			pos = nameNode.getStartPosition();
		}

SimpleName extends Name and nameNode is of type Name. If the selectedNode (type ASTNode) is not a Name, we return. If we are dealing with a module, we only use selectedNode as a Name. Otherwise, if selectedNode is not a SimpleName, we return. Finally selectedNode must be a SimpleName and we are free to cast it to SimpleName and assign it to it's superclass: Name.

If you are using I-builds, try updating to latest I-build from download.eclipse.org. You could also try a different JVM if that doesn't solve the issue to see if the problem lies there.

@iloveeclipse
Copy link
Member

AFAIK I's lombok that incompatible with Eclipse 4.23. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=579168 and projectlombok/lombok#3134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants