Bug 29547

Summary: Refactoring NPE during surrond with try/catch [refactoring]
Product: [Eclipse Project] JDT Reporter: Darin Swanson <Darin_Swanson>
Component: UIAssignee: Dirk Baeumer <dirk_baeumer>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P2    
Version: 2.1   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Darin Swanson CLA 2003-01-15 12:06:05 EST
In a main method, I have two lines:
     System.out.println("GEyte");
     throw new NullPointerException();
Select the throw statement
Source-> Surrond with try/catch block
Click yes

Problem: the progress monitor is null

Thread [main] (Suspended (exception NullPointerException))
	CompilationUnitChange(TextFileChange).perform(ChangeContext, 
IProgressMonitor) line: 194
	PerformChangeOperation$1.run(IProgressMonitor) line: 173
	BatchOperation.executeOperation() line: 34
	BatchOperation(JavaModelOperation).execute() line: 326
	BatchOperation(JavaModelOperation).run(IProgressMonitor) line: 626
	Workspace.run(IWorkspaceRunnable, IProgressMonitor) line: 1564
	JavaCore.run(IWorkspaceRunnable, IProgressMonitor) line: 2571
	PerformChangeOperation.executeChange(IProgressMonitor) line: 183
	PerformChangeOperation.run(IProgressMonitor) line: 151
	BusyIndicatorRunnableContext$BusyRunnable.internalRun(boolean, 
IRunnableWithProgress) line: 107
	BusyIndicatorRunnableContext$BusyRunnable.run() line: 74
	BusyIndicator.showWhile(Display, Runnable) line: 65
	BusyIndicatorRunnableContext.run(boolean, boolean, 
IRunnableWithProgress) line: 120
	SurroundWithTryCatchAction.run(ITextSelection) line: 110
	SurroundWithTryCatchAction(SelectionDispatchAction).dispatchRun
(ISelection) line: 193
	SurroundWithTryCatchAction(SelectionDispatchAction).run() line: 169
	SurroundWithTryCatchAction(Action).runWithEvent(Event) line: 769
	ActionContributionItem.handleWidgetSelection(Event) line: 411
	ActionContributionItem.handleWidgetEvent(Event) line: 365
	ActionContributionItem.access$0(ActionContributionItem, Event) line: 356
	ActionContributionItem$ActionListener.handleEvent(Event) line: 48
	EventTable.sendEvent(Event) line: 77
	MenuItem(Widget).sendEvent(Event) line: 825
	Display.runDeferredEvents() line: 1692
	Display.readAndDispatch() line: 1410
	Workbench.runEventLoop() line: 1467
	Workbench.run(Object) line: 1450
	InternalBootLoader.run(String, URL, String, String[], Runnable) line: 
845
	BootLoader.run(String, URL, String, String[], Runnable) line: 462
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not 
available [native method]
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 [local 
variables unavailable]
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 [local 
variables unavailable]
	Method.invoke(Object, Object[]) line: 324 [local variables unavailable]
	Main.basicRun(String[]) line: 247
	Main.run(String[]) line: 703
	Main.main(String[]) line: 539
Comment 1 Dirk Baeumer CLA 2003-01-20 08:36:55 EST

*** This bug has been marked as a duplicate of 29151 ***