Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public URI getCatalogUri() {
try {
return catalogUrl.toURI();
} catch (URISyntaxException e) {
throw new IllegalStateException(NLS.bind("URL of catalog {0} cannot be converted to URI", catalogUrl.toString())); //$NON-NLS-1$
throw new IllegalStateException(NLS.bind("URL of catalog {0} cannot be converted to URI", catalogUrl.toString()), e); //$NON-NLS-1$
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ public void run() {
} catch (SWTException e) {
// If the build was cancelled while in syncExec() it will throw an SWTException
if (monitor.isCanceled()) {
throw new OperationCanceledException();
throw new OperationCanceledException(); // NOPMD PreserveStackTrace - SWTException is just the cancellation signal
} else {
throw e;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ public void run() {
page = workbench.showPerspective("com.avaloq.ice.perspectives.Development", window);
} catch (final WorkbenchException second) {
// Both perspectives are missing
throw new AssertionFailedException("Could not switch to Avaloq Perspective: " + exception.getLocalizedMessage());
second.addSuppressed(exception);
throw new IllegalStateException("Could not switch to Avaloq Perspective", second);
}
}
if (page != null) {
Expand Down Expand Up @@ -418,7 +419,7 @@ public void run() {
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(id);
} catch (final PartInitException exception) {
throw new AssertionFailedException("Could not open change view: " + exception.getLocalizedMessage());
throw new IllegalStateException("Could not open change view: " + exception.getLocalizedMessage(), exception);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public LoadResult next() {
try {
resource = parent.getResource(uri, true);
} catch (WrappedException e) {
throw new LoadOperationException(uri, e.exception());
throw new LoadOperationException(uri, e.exception()); // NOPMD PreserveStackTrace - intentional unwrap of WrappedException
// CHECKSTYLE:OFF
} catch (Exception e) {
// CHECKSTYLE:ON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void setup(final Iterable<? extends TestSource> initialSources) {
IResourcesSetupUtil.waitForBuild();
createPluginProject(injector, TEST_PROJECT_NAME);
} catch (CoreException e) {
throw new IllegalStateException("Failed to create plugin project");
throw new IllegalStateException("Failed to create plugin project", e);
}
}

Expand Down Expand Up @@ -145,7 +145,7 @@ protected void execute(final IProgressMonitor monitor) throws CoreException {
} catch (InvocationTargetException e) {
LOGGER.error(e.getCause().getMessage());
} catch (InterruptedException e) {
throw new AssertionError("Interrupted");
throw new AssertionError("Interrupted", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public synchronized EObject getEObject(final String uriFragment) {
} catch (FastLazyURIEncoder.DecodingError err) {
RuntimeException cause = err.getCause();
getErrors().add(new ExceptionDiagnostic(cause));
throw new WrappedException(cause);
throw new WrappedException(cause); // NOPMD PreserveStackTrace - intentional unwrap of DecodingError transport wrapper
} catch (WrappedException e) {
boolean logged = false;
try {
Expand Down
1 change: 0 additions & 1 deletion ddk-configuration/pmd/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
<exclude name="UnitTestShouldUseBeforeAnnotation"/><!--Checkstyle-->
<exclude name="UnitTestShouldUseTestAnnotation"/>
<exclude name="NonExhaustiveSwitch"/>
<exclude name="PreserveStackTrace"/><!--TODO-->
<exclude name="UnnecessaryWarningSuppression"/> <!--Experimental, too many false positives-->
<exclude name="UnusedLocalVariable"/><!--Checkstyle-->
<exclude name="UseTryWithResources"/><!--TODO-->
Expand Down