Skip to content

Commit

Permalink
Wrapped the OperationCanceledException in InterruptedException
Browse files Browse the repository at this point in the history
  • Loading branch information
amartya4256 committed Dec 4, 2023
1 parent 4b92b57 commit 7dd7436
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ public IWizardPage getNextPage() {
try {
renameTypeProcessor.initializeReferences(pm);
} catch (OperationCanceledException e1) {
throw new InterruptedException();
InterruptedException interruptedException = new InterruptedException(e1.getLocalizedMessage());
interruptedException.initCause(e1);
throw interruptedException;
} catch (CoreException e2) {
ExceptionHandler.handle(e2, RefactoringMessages.RenameTypeWizard_defaultPageTitle,
RefactoringMessages.RenameTypeWizard_unexpected_exception);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ public void configureJavaProject(String newProjectCompliance, IProgressMonitor m
BuildPathsBlock.addJavaNature(project, new SubProgressMonitor(monitor, 1));
getBuildPathsBlock().configureJavaProject(newProjectCompliance, new SubProgressMonitor(monitor, 5));
} catch (OperationCanceledException e) {
throw new InterruptedException();
InterruptedException interruptedException = new InterruptedException(e.getLocalizedMessage());
interruptedException.initCause(e);
throw interruptedException;
} finally {
monitor.done();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ public IRunnableWithProgress getRunnable() {
} catch (CoreException e1) {
throw new InvocationTargetException(e1);
} catch (OperationCanceledException e2) {
throw new InterruptedException();
InterruptedException interruptedException = new InterruptedException(e2.getLocalizedMessage());
interruptedException.initCause(e2);
throw interruptedException;
} finally {
monitor.done();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ public void run(IProgressMonitor monitor) throws InvocationTargetException, Inte
} catch (CoreException e) {
throw new InvocationTargetException(e);
} catch (OperationCanceledException e) {
throw new InterruptedException();
InterruptedException interruptedException = new InterruptedException(e.getLocalizedMessage());
interruptedException.initCause(e);
throw interruptedException;
} finally {
monitor.done();
}
Expand Down

0 comments on commit 7dd7436

Please sign in to comment.