Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 579168

Summary: Java refactoring broken
Product: [Eclipse Project] JDT Reporter: Ralf Naujokat <bugzilla>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: normal    
Priority: P3 CC: abczww, antoniogmc, dirk.henkel, Dirk.Steinkamp, eclipse-bugs, f.gabrus, filippo.rossoni, horvoje, ionescu.s.c, jarthana, loskutov, lrozenblyum, mariorassy, pyvesdev, radoslaw.adamiak, rosen.eitan, serhii.pylypenko.0, sp.titan, tmarko
Version: 4.23   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Ralf Naujokat CLA 2022-03-09 11:07:14 EST
What steps will reproduce the problem?
1. In java source file
2. select method parameter or local var
3. use context menu (secondary mouse click)
4. select Refactor > Rename
5. refactoring is not executed


-- Error Details --
Date: Wed Mar 09 16:57:47 CET 2022
Message: Unhandled event loop exception
Severity: Error
Product: Eclipse IDE 4.23.0.20220303-1200 (org.eclipse.epp.package.jee.product)
Plugin: org.eclipse.ui
Exception Stack Trace:
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 0008 2cb8 016b b02b
    0000010: b601 06b6 00f6 3e1d 101e 9f00 0f1d 100a
    0000020: 9f00 091d 1012 a000 32bb 00d0 59b7 00d2
    0000030: 3a04 bb01 0959 2b19 04b7 010b 3a05 2a19
    0000040: 05b6 00d8 1904 1904 b600 dcbd 0107 b600
    0000050: dfc0 010e b801 6bb0 04bd 0107 5903 2b53
    0000060: b801 6bb0                              
  Stackmap Table:
    append_frame(@15,Object[#270])
    append_frame(@41,Integer)
    same_frame(@88)

	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.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
	at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4579)
	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.notifyListeners(Widget.java:1325)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4365)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3941)
	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:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	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)
Comment 1 Andi Huber CLA 2022-03-12 00:53:03 EST
I do see the exact same stacktrace. Was able to verify that this error only happens when using Lombok as a javaagent ...

That is when using eclipse.ini
...
-vmargs
-javaagent:xxx\eclipse\lombok-1.18.22.jar
...

Was testing this on Windows 11 with eclipse build
https://download.eclipse.org/eclipse/downloads/drops4/S-4.23RC2a-202203080310/

Cheers Andi H.
Comment 2 Andi Huber CLA 2022-03-12 01:18:50 EST
I did file a bug report at Lombok
https://github.com/projectlombok/lombok/issues/3134
Comment 3 Alois Zoitl CLA 2022-03-12 05:54:39 EST
I'm forwarding this to JDT as you submitted for Eclipse 4diac.
Comment 4 Dirk Steinkamp CLA 2022-03-13 09:00:50 EDT
Issue seems to be gotten fixed on the lombok side: https://github.com/projectlombok/lombok/issues/3134
Comment 5 Ralf Naujokat CLA 2022-03-15 10:41:39 EDT
@Andi Huber:
In the lombok ticket you wrote, fix worked for you.
Where did you download the fixed lombok.jar?

BTW: Thanks for sorting it out, that lombok was involved.
I wasn't really aware, that lombok was installed for my eclipse.
But with Eclipse 2021-12 everything was fine with that old lombok version...
Comment 6 Andi Huber CLA 2022-03-15 10:53:08 EDT
(In reply to Ralf Naujokat from comment #5)
> @Andi Huber:
> In the lombok ticket you wrote, fix worked for you.
> Where did you download the fixed lombok.jar?
> 
> BTW: Thanks for sorting it out, that lombok was involved.
> I wasn't really aware, that lombok was installed for my eclipse.
> But with Eclipse 2021-12 everything was fine with that old lombok version...

@Ralf Naujokat: I did build my lombok.jar from sources. There is currently no official snapshot build for public download, but you can build your own following instructions at https://projectlombok.org/contributing/contributing

Cheers Andi
Comment 7 Ralf Naujokat CLA 2022-03-15 12:29:12 EDT
Thanks, worked for me. ;-)
Comment 8 Andrey Loskutov CLA 2022-03-17 12:34:35 EDT
*** Bug 579300 has been marked as a duplicate of this bug. ***
Comment 9 Radek Adamiak CLA 2022-03-18 17:38:39 EDT
*** Bug 579321 has been marked as a duplicate of this bug. ***
Comment 10 Andrey Loskutov CLA 2022-03-21 10:35:51 EDT
*** Bug 579352 has been marked as a duplicate of this bug. ***
Comment 11 Andrey Loskutov CLA 2022-03-21 10:36:22 EDT
*** Bug 579339 has been marked as a duplicate of this bug. ***
Comment 12 Andrey Loskutov CLA 2022-03-21 10:38:23 EDT
Removed target, it's not in Eclipse project code, we can't fix that.
Comment 13 Andrey Loskutov CLA 2022-03-22 12:23:45 EDT
*** Bug 579366 has been marked as a duplicate of this bug. ***
Comment 14 Andrey Loskutov CLA 2022-03-22 12:24:19 EDT
*** Bug 579367 has been marked as a duplicate of this bug. ***
Comment 15 Andrey Loskutov CLA 2022-03-22 12:25:00 EDT
*** Bug 579365 has been marked as a duplicate of this bug. ***
Comment 16 Andrey Loskutov CLA 2022-03-23 02:40:10 EDT
*** Bug 579373 has been marked as a duplicate of this bug. ***
Comment 17 Andrey Loskutov CLA 2022-03-23 07:58:00 EDT
*** Bug 579380 has been marked as a duplicate of this bug. ***
Comment 18 Andrey Loskutov CLA 2022-03-23 11:14:31 EDT
*** Bug 579389 has been marked as a duplicate of this bug. ***
Comment 19 Andrey Loskutov CLA 2022-03-23 11:18:08 EDT
*** Bug 579316 has been marked as a duplicate of this bug. ***
Comment 20 Antonio Munoz CLA 2022-03-23 11:49:31 EDT
You can download a official snapshot build here: https://projectlombok.org/download-edge

It worked to me.
Comment 21 Andrey Loskutov CLA 2022-03-24 05:22:12 EDT
*** Bug 579400 has been marked as a duplicate of this bug. ***
Comment 22 Andrey Loskutov CLA 2022-03-25 01:37:55 EDT
*** Bug 579411 has been marked as a duplicate of this bug. ***
Comment 23 Andrey Loskutov CLA 2022-04-01 05:37:03 EDT
*** Bug 579539 has been marked as a duplicate of this bug. ***
Comment 24 Andrey Loskutov CLA 2022-04-04 11:38:02 EDT
*** Bug 579569 has been marked as a duplicate of this bug. ***
Comment 25 Andrey Loskutov CLA 2022-04-07 07:14:55 EDT
*** Bug 579613 has been marked as a duplicate of this bug. ***
Comment 26 Ihor Lavryniuk CLA 2022-04-27 08:47:49 EDT
After Update Lombok from  1.18.22 to 1.18.24
Renaming/refactoring in Eclipse work good
https://projectlombok.org/download