Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311575 - TaskWizard#performFinish error handling assumes any exception is an error
Summary: TaskWizard#performFinish error handling assumes any exception is an error
Status: RESOLVED FIXED
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: 3.0.5   Edit
Hardware: PC Windows XP
: P2 trivial (vote)
Target Milestone: 3.2.2   Edit
Assignee: Angel Vera CLA
QA Contact: Angel Vera CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-04 11:49 EDT by Troy Bishop CLA
Modified: 2017-10-11 16:34 EDT (History)
0 users

See Also:


Attachments
possible patch. (1.13 KB, patch)
2010-05-04 11:52 EDT, Troy Bishop CLA
no flags Details | Diff

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