Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311575

Summary: TaskWizard#performFinish error handling assumes any exception is an error
Product: [WebTools] WTP ServerTools Reporter: Troy Bishop <tjbishop>
Component: wst.serverAssignee: Angel Vera <arvera>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: trivial    
Priority: P2    
Version: 3.0.5   
Target Milestone: 3.2.2   
Hardware: PC   
OS: Windows XP   
See Also: https://git.eclipse.org/r/108984
Whiteboard:
Attachments:
Description Flags
possible patch. none

Description Troy Bishop CLA 2010-05-04 11:49:42 EDT
Build Identifier: 3.0.5 patches

The following code within org.eclipse.wst.server.ui.internal.wizard.TaskWizard#performFinish() assumes that any Exception that is thrown by the run() call is an error:

Throwable t = null;
try {
	if (getContainer() != null)
		getContainer().run(true, true, new WorkspaceRunnableAdapter(runnable));
	else
		runnable.run(new NullProgressMonitor());
	return true;
} catch (InvocationTargetException te) {
	Trace.trace(Trace.SEVERE, "Error finishing task wizard", te);
	t = te.getCause();
} catch (Exception e) {
	Trace.trace(Trace.SEVERE, "Error finishing task wizard 2", e);
	t = e;
}

If the Exception that is thrown is a java.lang.InterruptedException than a message is logged to the workspace .log file saying "Error finishing task wizard 2".  This is not correct as the logic that was executed was canceled so there was no error and no entry should exist in the .log file, like the following:


!MESSAGE Error finishing task wizard 2
!STACK 0
java.lang.InterruptedException
at org.eclipse.jface.operation.ModalContext.run(Unknown Source)
at org.eclipse.jface.wizard.WizardDialog.run(Unknown Source)
at org.eclipse.wst.server.ui.internal.wizard.TaskWizard.performFinish(Unknown Source)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(Unknown Source) 
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(Unknown Source)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Unknown Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.eclipse.jface.window.Window.runEventLoop(Unknown Source)
at org.eclipse.jface.window.Window.open(Unknown Source)
at org.eclipse.wst.server.ui.internal.view.servers.ModuleSloshAction.perform(Unknown Source)
...

Reproducible: Always
Comment 1 Troy Bishop CLA 2010-05-04 11:52:54 EDT
Created attachment 166976 [details]
possible patch.
Comment 2 Angel Vera CLA 2010-08-23 14:36:15 EDT
changes committed to 32M
Comment 3 Angel Vera CLA 2010-08-23 17:22:18 EDT
Changes committed and released to 32M and HEAD(3.3)
Comment 4 Angel Vera CLA 2010-08-24 14:16:44 EDT
Fixed.
Comment 5 Eclipse Genie CLA 2017-10-11 16:34:31 EDT
New Gerrit change created: https://git.eclipse.org/r/108984