Bug 420263 - [rename] Refactorings stopped working (Internal Error)
Summary: [rename] Refactorings stopped working (Internal Error)
Status: CLOSED DUPLICATE of bug 320986
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3.1   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2013-10-24 07:50 EDT by Michal Borek CLA
Modified: 2018-07-21 11:45 EDT (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 Michal Borek CLA 2013-10-24 07:50:29 EDT

    
Comment 1 Michal Borek CLA 2013-10-24 07:51:46 EDT
Then renaming variable using refactoring I have following error, and refactoring is not performed. Generally no refactoring works properly.

Using Jdk 1.7.0_45
Eclipse for RCP decelopers 4.3.1 .


java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
	at org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindow.java:1818)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1815)
	at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper.perform(RefactoringExecutionHelper.java:191)
	at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper.perform(RefactoringExecutionHelper.java:151)
	at org.eclipse.jdt.ui.refactoring.RenameSupport.perform(RenameSupport.java:198)
	at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameLinkedMode.doRename(RenameLinkedMode.java:362)
	at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameLinkedMode$EditorSynchronizer.left(RenameLinkedMode.java:119)
	at org.eclipse.jface.text.link.LinkedModeModel.exit(LinkedModeModel.java:341)
	at org.eclipse.jface.text.link.LinkedModeUI$4.run(LinkedModeUI.java:1193)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4145)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3762)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenameAnalyzeUtil$ProblemNodeFinder.getProblemNodes(RenameAnalyzeUtil.java:84)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenameAnalyzeUtil.analyzeLocalRenames(RenameAnalyzeUtil.java:437)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenameLocalVariableProcessor.doCheckFinalConditions(RenameLocalVariableProcessor.java:273)
	at org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor.checkFinalConditions(JavaRenameProcessor.java:48)
	at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:224)
	at org.eclipse.ltk.core.refactoring.Refactoring.checkAllConditions(Refactoring.java:162)
	at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper$Operation.run(RefactoringExecutionHelper.java:80)
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5331)
	at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 2 Michal Borek CLA 2013-10-24 08:32:59 EDT
I've noticed that the cause of that was lack of dependency of annotation which was indirectly dependant (I think there's another bug for this).
Comment 3 Srikanth Sankaran CLA 2013-10-24 08:54:47 EDT
Move to UI team for comment, please move back if we have our fingers in the pie.
Comment 4 Martin Mathew CLA 2013-10-24 09:35:31 EDT
Can you give us a testcase or code snippet on which the refactoring was performed? In the stack trace I can see a NPE:
Caused by: java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenameAnalyzeUtil$ProblemNodeFinder.getProblemNodes(RenameAnalyzeUtil.java:84)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenameAnalyzeUtil.analyzeLocalRenames(RenameAnalyzeUtil.java:437)

Bug 320986 was reported with similar stack trace.
Comment 5 Michal Borek CLA 2013-10-24 10:33:05 EDT
Manju Mathew I'll try to create something that will reproduce bug but honestly, it may be hard since the test case is very specific:

1. I had constant defined in class (let's say a LOGGER)
2. I had used a method (@MethodApi Parameters.getParameters()), and @MethodApi was defined in a bundle that was not included as a dependency in current bundle, that had error "indirect reference", but when the constant from point 1. was in a class the error was not appearing.


So:
1. When I removed LOGGER, the error about @MethodApi appeared.
2. When I added a dependency that removed lack of @MethodApi error, whole problem disappeared.

Tomorrow I'll try to create a simple test case for that but I cannot promise I'll be able to make generic test case at all.
Comment 6 Martin Mathew CLA 2013-10-31 04:51:05 EDT
(In reply to Michal Borek from comment #5)
> Tomorrow I'll try to create a simple test case for that but I cannot promise
> I'll be able to make generic test case at all.

Any luck creating the test case?
Comment 7 Dani Megert CLA 2013-11-08 03:32:24 EST
Michal, please reopen if you have more data. So far, we cannot reproduce the problem using 4.4 M3 [1].

[1] http://download.eclipse.org/eclipse/downloads/drops4/S-4.4M3-201310302000/

*** This bug has been marked as a duplicate of bug 320986 ***
Comment 8 David M. Karr CLA 2018-07-18 13:10:48 EDT
I'm seeing this exact stack trace today with latest photon release.  From Eclipse, I try to rename a variable, and it finishes and then reverts my change. One of the ways I tried to do this presented an error dialog, which led me to the log, which showed this same stacktrace.
Comment 9 Dani Megert CLA 2018-07-21 11:45:29 EDT
(In reply to David M. Karr from comment #8)
> I'm seeing this exact stack trace today with latest photon release.  From
> Eclipse, I try to rename a variable, and it finishes and then reverts my
> change. One of the ways I tried to do this presented an error dialog, which
> led me to the log, which showed this same stacktrace.

See bug 320986 comment 6.