We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Affects PMD Version: 7.0-rc1 when upgrading from 6.55
Rule: ExceptionAsFlowControl
Description: A multi-catch block that rethrows the exception prior to other catches which would wrap it.
Code Sample demonstrating the issue:
public ImmutableMap<K, V> getAll(Iterable<? extends K> keys) throws ExecutionException { try { // ... } catch (NullPointerException | InvalidCacheLoadException e) { throw e; // <-- Violation } catch (CacheLoaderException e) { throw new ExecutionException(e.getCause()); } catch (Exception e) { throw new UncheckedExecutionException(e); } catch (Error e) { throw new ExecutionError(e); } }
Expected outcome:
PMD reports a violation when the alternative is worse (instanceof checks within a catch clause).
Running PMD through: Gradle This requires workaround in gradle/gradle#24502
The text was updated successfully, but these errors were encountered:
296d259
[doc] Update release notes for rc3 (pmd#4434, pmd#4549) [skip ci]
8b952c2
oowekyala
Successfully merging a pull request may close this issue.
Affects PMD Version:
7.0-rc1 when upgrading from 6.55
Rule:
ExceptionAsFlowControl
Description:
A multi-catch block that rethrows the exception prior to other catches which would wrap it.
Code Sample demonstrating the issue:
Expected outcome:
PMD reports a violation when the alternative is worse (instanceof checks within a catch clause).
Running PMD through: Gradle
This requires workaround in gradle/gradle#24502
The text was updated successfully, but these errors were encountered: