Bug 147079 - [rename] wizard won't show if the Internal Web Browser View is open
Summary: [rename] wizard won't show if the Internal Web Browser View is open
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatbug
: 152703 153559 157771 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-06-14 12:26 EDT by Andreas K. CLA
Modified: 2006-09-25 06:47 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas K. CLA 2006-06-14 12:26:04 EDT
When the Internal Web Browser View is open, the Rename-Type
refactoring wizard won't show. After a click on the Refactor->Rename
context menu entry, nothing happens.

Steps to Reproduce:
1. Create a new Java Project e.g. TestProject
2. Create a new class in the default package, e.g. TestClass
3. Open the Internal Web Browser View via the Window -> Show View ->
Other -> General -> Internal Web Browser menu.
4. Open TestClass.java with the Java Editor.
5. Select the class name, and select Refactor -> Rename from the context menu.

When the Internal Web Browser View is closed, the Rename-Type wizard
will open again.

Im using Eclipse SDK 3.2 RC7
Build id: I20060602-1317
Comment 1 Martin Aeschlimann CLA 2006-06-15 11:59:02 EDT
Problem is that that site.getSelectionProvider() from the Internal Web Browser View is null and the refactoring initialziation routine isn't testing this. This is allowed by spec but very uncommon.

There's no workaround to do a rename except for closing the Internal Web Browser. Bring it to the background is not working. That means the browser could somewhere in the background and you have no idea why rename isn't showing a wizard.

Philippe, I think this is a late 3.2 candidate. I can't say how often the Internal Web Browser View is used, but maybe other views have the same behaviour with site.getSelectionProvider().
As the fix is trivial and safe (add a null check) I'd be happy if you could bring this up in discussion with the PMC.

Interstingly is the bug in the code for over 3 years. We haven't heard from this problem at all (good catch, Andreas).

java.lang.NullPointerException
	at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameUserInterfaceStarter$SelectionState.consider(RenameUserInterfaceStarter.java:83)
	at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameUserInterfaceStarter$SelectionState.init(RenameUserInterfaceStarter.java:65)
	at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameUserInterfaceStarter$SelectionState.<init>(RenameUserInterfaceStarter.java:53)
	at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameUserInterfaceStarter.activate(RenameUserInterfaceStarter.java:150)
	at org.eclipse.jdt.ui.refactoring.RenameSupport.openDialog(RenameSupport.java:114)
	at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startRenameRefactoring(RefactoringExecutionStarter.java:382)
	at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:172)
	at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:102)
	at org.eclipse.jdt.ui.actions.RenameAction.run(RenameAction.java:108)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:267)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:243)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	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:585)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 2 Martin Aeschlimann CLA 2006-08-03 12:41:44 EDT
*** Bug 152703 has been marked as a duplicate of this bug. ***
Comment 3 Markus Keller CLA 2006-08-07 09:40:28 EDT
Fixed in HEAD for 3.3 M1.
Comment 4 Markus Keller CLA 2006-08-07 12:49:15 EDT
Fixed in R3_2_maintenance.
Comment 5 Paul Webster CLA 2006-08-14 08:37:14 EDT
*** Bug 153559 has been marked as a duplicate of this bug. ***
Comment 6 Dani Megert CLA 2006-08-31 06:23:07 EDT
Starting verification...
Comment 7 Benno Baumgartner CLA 2006-08-31 06:24:47 EDT
verifying...
Comment 8 Benno Baumgartner CLA 2006-08-31 06:27:29 EDT
...sorry Dani, it's all yours...
Comment 9 Dani Megert CLA 2006-08-31 07:01:00 EDT
Verified in M20060830-0800.
Comment 10 Martin Aeschlimann CLA 2006-09-25 06:47:22 EDT
*** Bug 157771 has been marked as a duplicate of this bug. ***