Bug 15698 - NPE undo rename resource
Summary: NPE undo rename resource
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Dirk Baeumer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-09 21:11 EDT by Kristine Heaton CLA
Modified: 2002-05-17 06:06 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kristine Heaton CLA 2002-05-09 21:11:20 EDT
Steps to recreate:  
1. using a web project, selected (web content) directory
2. from menu pulldown selected Refactor ->Rename
3. typed in web content2 and rename was successful
4. from menu pulldown selected Undo rename 

Received message internal error in undo manager. 
Log shows: 

java.lang.NullPointerException
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.UndoManagerAction.run(UndoManage
rAction.java:115)
	at 
org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:202)
	at 
org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:162)
	at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionCont
ributionItem.java:407)
	at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContribu
tionItem.java:361)
	at 
org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.
java:352)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(Actio
nContributionItem.java:47)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled 
Code))
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637)
	at 
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled 
Code))
	at 
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code))
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:848)
	at 
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:77
7)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:190)
	at org.eclipse.core.launcher.Main.run(Main.java:549)
	at org.eclipse.core.launcher.Main.main(Main.java:390)
Comment 1 Adam Kiezun CLA 2002-05-10 05:05:43 EDT
which build are you using?
the 'version' field indicates 1.0 - is it really 1.0? 
Comment 2 Dirk Baeumer CLA 2002-05-13 10:25:30 EDT
Line 115 now contains a comment, since this part got recoded since 1.0.


Comment 3 Kristine Heaton CLA 2002-05-13 16:14:44 EDT
My apologies, error reported in in M5 build (jdt 2.0).  Thanks, Kristine
Comment 4 Dirk Baeumer CLA 2002-05-15 10:02:31 EDT
From the old code the problem seems to be that the preflight status is null 
when checking if it has a fatal error.
Comment 5 Dirk Baeumer CLA 2002-05-15 10:35:13 EDT
The code has changed since M5. Fixed by putting a guard in front of 
fPreflightStatus.hasError(). 

In the new code there is only one case were the preflight status can be null: 
if a previous error has occured. If this is the case then the error is catched 
by the try/catch block right in front of the line if (fPreflightStatus.hasError
());

Waiting for WSAD driver to ensure that this fixes the problem



Comment 6 Dirk Baeumer CLA 2002-05-17 06:06:41 EDT
The new code fixes the NPE but it reveals another problem. Opened bug 16226 for 
new problem.