Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » org.eclipse.swt.SWTException: Failed to execute runnable
org.eclipse.swt.SWTException: Failed to execute runnable [message #768658] Tue, 20 December 2011 15:02 Go to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 158
Registered: July 2009
Senior Member
Hi,

When doing refactor --> rename of a model class file --> the underlying version handling (Eclipse) plugin will be called in the following method.

Two calls are made to method for each change.

@Override
	public IStatus validateEdit(final IFile[] files, final FileModificationValidationContext context) {
		if (ClearCasePreferences.isCheckoutAutoNever())
			// FIXME: We need to inform user that Auto checkout is never
			// allowed.
			return CANCEL;
		// We are allowed to checkout file.
		System.out.println("Context is "+context.toString());
		final Shell shell = getShell(context);
		final boolean askForComment = ClearCasePreferences.isCommentCheckout() && !ClearCasePreferences.isCommentCheckoutNeverOnAuto();
		if (null == shell || !askForComment) {
			System.out.println("Shell is set to "+shell+" and askForComment is "+askForComment);
			return super.validateEdit(files, context);
		}

		try {
			this.validateEditLock.acquire();
			final IFile[] readOnlyFiles = getFilesToCheckout(files);
			if (readOnlyFiles.length == 0)
				return OK;
			final IStatus[] status = new IStatus[1];
			PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {

				public void run() {
					status[0] = checkout(readOnlyFiles, shell);
				}
			});
			if (null == status[0])
				return CANCEL;
			return status[0];
		} finally {
			this.validateEditLock.release();
		}
	}




This is super.validateEdit();

@Override
	public IStatus validateEdit(IFile[] files,
			FileModificationValidationContext context) {
		IFile[] readOnlyFiles = getFilesToCheckout(files);
		if (readOnlyFiles.length == 0)
			return OK;
		return checkout(readOnlyFiles);
	}


We have comments askForComment = false in both cases below.

When we run this in Eclipse:

1:st call Shell {*Wrong Thread*} ?
2:nd call Shell null

Both times the super.validateEdit() is called (checking out files).

3: This is the actual move operation.

And move operation is performed succsessfully.

When we run it in RSA:

1:st call Shell {Modeling - Rational Software Architect Standard Edition}
2:nd call Shell {Modeling - Rational Software Architect Standard Edition}

Both times the super.validateEdit() is called.

3: The actual move operation.

And move operation fails ( see attached log).

Context seems to matter in move operation but can I affect it or is context used in Eclipse internal move operation?

Anyone that can shed some light on this?

br,

//mike
Re: org.eclipse.swt.SWTException: Failed to execute runnable [message #774305 is a reply to message #768658] Tue, 03 January 2012 17:02 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
The exception is being triggered in
net.sourceforge.clearcase.ClearCaseCLIImpl.move(), which the stack says
does not have attached source, so it's difficult to really know what's
happening. It's presumably a bug in either the clearcase component
(most likely), or possibly in com.ibm.xtools.modeler. Either way, it's
not an swt issue, and I don't think this is the place to get further
insight on this. You should start by seeing if a bug that looks like
this has been logged with the clearcase component, and if not then see
if they can determine what is happening.

HTH,
Grant


On 12/20/2011 10:02 AM, Mikael Petterson wrote:
> Hi,
>
> When doing refactor --> rename of a model class file --> the underlying version handling (Eclipse) plugin will be called in the following method.
>
> Two calls are made to method for each change.
>
>
> @Override
> public IStatus validateEdit(final IFile[] files, final FileModificationValidationContext context) {
> if (ClearCasePreferences.isCheckoutAutoNever())
> // FIXME: We need to inform user that Auto checkout is never
> // allowed.
> return CANCEL;
> // We are allowed to checkout file.
> System.out.println("Context is "+context.toString());
> final Shell shell = getShell(context);
> final boolean askForComment = ClearCasePreferences.isCommentCheckout()&& !ClearCasePreferences.isCommentCheckoutNeverOnAuto();
> if (null == shell || !askForComment) {
> System.out.println("Shell is set to "+shell+" and askForComment is "+askForComment);
> return super.validateEdit(files, context);
> }
>
> try {
> this.validateEditLock.acquire();
> final IFile[] readOnlyFiles = getFilesToCheckout(files);
> if (readOnlyFiles.length == 0)
> return OK;
> final IStatus[] status = new IStatus[1];
> PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
>
> public void run() {
> status[0] = checkout(readOnlyFiles, shell);
> }
> });
> if (null == status[0])
> return CANCEL;
> return status[0];
> } finally {
> this.validateEditLock.release();
> }
> }
>
>
>
> This is super.validateEdit();
>
> @Override
> public IStatus validateEdit(IFile[] files,
> FileModificationValidationContext context) {
> IFile[] readOnlyFiles = getFilesToCheckout(files);
> if (readOnlyFiles.length == 0)
> return OK;
> return checkout(readOnlyFiles);
> }
>
> We have comments askForComment = false in both cases below.
>
> When we run this in Eclipse:
>
> 1:st call Shell {*Wrong Thread*} ?
> 2:nd call Shell null
>
> Both times the super.validateEdit() is called (checking out files).
>
> 3: This is the actual move operation.
>
> And move operation is performed succsessfully.
>
> When we run it in RSA:
>
> 1:st call Shell {Modeling - Rational Software Architect Standard Edition}
> 2:nd call Shell {Modeling - Rational Software Architect Standard Edition}
>
> Both times the super.validateEdit() is called.
>
> 3: The actual move operation.
>
> And move operation fails ( see attached log).
>
> Context seems to matter in move operation but can I affect it or is context used in Eclipse internal move operation?
>
> Anyone that can shed some light on this?
>
> br,
>
> //mike
>
Previous Topic:Where is Javadoc for SWT?
Next Topic:Limitation of SWT.MeasureItem for SWT tables resizing ?
Goto Forum:
  


Current Time: Tue Apr 16 11:36:20 GMT 2024

Powered by FUDForum. Page generated in 0.12717 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top