[jbosstools-issues] [JBoss JIRA] (JBIDE-10719) WizardUtils#runInWizard returns a Future<IStatus> but is process synchronously (not asynchronously as the signature would suggest)

Andre Dietisheim (JIRA) jira-events at lists.jboss.org
Thu Jan 26 07:34:50 EST 2012


     [ https://issues.jboss.org/browse/JBIDE-10719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andre Dietisheim resolved JBIDE-10719.
--------------------------------------

    Resolution: Done


committed to TRUNK (Beta1)
                
> WizardUtils#runInWizard returns a Future<IStatus> but is process synchronously (not asynchronously as the signature would suggest)
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-10719
>                 URL: https://issues.jboss.org/browse/JBIDE-10719
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: openshift
>    Affects Versions: 3.3.0.M5
>            Reporter: Andre Dietisheim
>            Assignee: Andre Dietisheim
>             Fix For: 3.3.0.Beta1
>
>
> WizardUtils#runInWizard is returning a Future<IStatus> as if the method would not wait for it's job to get finished. This is actually not the case. The job is joined and the method is only returning when the job was executed.
> {code}
> public static Future<IStatus> runInWizard(final Job job, final DelegatingProgressMonitor delegatingMonitor,
> 		IWizardContainer container) throws InvocationTargetException, InterruptedException {
> 	JobResultFuture future = new JobResultFuture(job);
> 	container.run(true, false, new IRunnableWithProgress() {
> 		@Override
> 		public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException 
> 			if (delegatingMonitor == null) {
> 				monitor.beginTask(job.getName(), IProgressMonitor.UNKNOWN);
> 			} else {
> 				delegatingMonitor.add(monitor);
> 				delegatingMonitor.beginTask(job.getName(), IProgressMonitor.UNKNOWN);
> 			}
> 			job.schedule();
> 			job.join();
> 			if (delegatingMonitor == null) {
> 				monitor.done();
> 			} else {
> 				delegatingMonitor.done();
> 			}
> 		}
> 	});
> 	return future;
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list