Bug 543202 - Method rename does not work
Summary: Method rename does not work
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.10   Edit
Hardware: PC Linux
: P3 major with 1 vote (vote)
Target Milestone: 4.11 M3   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2019-01-07 00:43 EST by Lyor Goldstein CLA
Modified: 2019-01-22 18:00 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lyor Goldstein CLA 2019-01-07 00:43:51 EST
I have started using Eclipse 2018-12 and it does not execute a method rename re-factoring. Here is the scenario:

* Select a (public) method
* Use ALT+SHIFT+R (refactor - rename) - the UI changes to allow method name editing
* Change the method name and press ENTER

=> The IDE shows a wait clock and then "succeeds" (no error reported) but nothing is renamed - the original method reverts to its original name.

I have tried using the refactor menu instead of the key shortcut combination - same result.

I have tried running it with and without - 'export SWT_GTK3=0' but nothing helps

(My environment is Fedora 27)
Comment 1 Andrey Loskutov CLA 2019-01-07 00:46:35 EST
Any errors in the log?
Comment 2 Dani Megert CLA 2019-01-07 06:04:24 EST
This works for me using https://download.eclipse.org/eclipse/downloads/drops4/R-4.10-201812060815/ on Windows 7.

Please try with that build and a new workspace.
Comment 3 Thiago Ramos CLA 2019-01-17 16:04:01 EST
I have the same error as well on Windows. The stacktrace is:

java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:401)
	at org.eclipse.ui.internal.WorkbenchWindow.lambda$4(WorkbenchWindow.java:2249)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2247)
	at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper.perform(RefactoringExecutionHelper.java:197)
	at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper.perform(RefactoringExecutionHelper.java:156)
	at org.eclipse.jdt.ui.refactoring.RenameSupport.perform(RenameSupport.java:201)
	at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameLinkedMode.doRename(RenameLinkedMode.java:371)
	at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameLinkedMode$EditorSynchronizer.left(RenameLinkedMode.java:125)
	at org.eclipse.jface.text.link.LinkedModeModel.exit(LinkedModeModel.java:338)
	at org.eclipse.jface.text.link.LinkedModeUI.lambda$2(LinkedModeUI.java:1174)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3919)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3550)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:636)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:563)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:151)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	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(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1474)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/corext/refactoring/tagging/IReferenceUpdating
	at org.jboss.tools.common.model.refactoring.RenameProcessorRunner.updateReferences(RenameProcessorRunner.java:52)
	at org.jboss.tools.jsf.model.handlers.bean.JSFRenameFieldParticipant.updateReferences(JSFRenameFieldParticipant.java:121)
	at org.jboss.tools.jsf.model.handlers.bean.JSFRenameFieldParticipant.createChange(JSFRenameFieldParticipant.java:61)
	at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:309)
	at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper$Operation.run(RefactoringExecutionHelper.java:102)
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:41)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:736)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2295)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2322)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5857)
	at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:108)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.corext.refactoring.tagging.IReferenceUpdating cannot be found by org.jboss.tools.common.model_3.10.1.v20180802-1505
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:511)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 12 more
Comment 4 Stephan Herrmann CLA 2019-01-17 17:27:32 EST
(In reply to Thiago Ramos from comment #3)
> Caused by: java.lang.NoClassDefFoundError:
> org/eclipse/jdt/internal/corext/refactoring/tagging/IReferenceUpdating
> 	at
> org.jboss.tools.common.model.refactoring.RenameProcessorRunner.
> updateReferences(RenameProcessorRunner.java:52)

This appears to be an error in org.jboss.tools, not JDT. Apparently they are illegally accessing an internal type from JDT. Please report the issue to them or check if they have a newer version that matches the installed version of JDT.
Comment 5 Stephan Herrmann CLA 2019-01-22 18:00:55 EST
Closing, since one instance (comment 3) appears to be caused by org.jboss.tools.

If the issue from comment 0 is not related to an exception similar to comment 3, then we'd need more information from Lyor.