Bug 29547 - Refactoring NPE during surrond with try/catch [refactoring]
Summary: Refactoring NPE during surrond with try/catch [refactoring]
Status: RESOLVED DUPLICATE of bug 29151
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Dirk Baeumer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-15 12:06 EST by Darin Swanson CLA
Modified: 2003-01-20 08:36 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***