-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[MNG-8727] fix unnecessary throws leftover; promoting ExecutorException to Exception being stringent to ensure catch
#2336
New issue
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
Conversation
|
leftover...
thats why CPU |
|
Is this an unchecked exception? |
|
| @Override | ||
| public String metadataPath(ExecutorRequest.Builder executorRequest, String gav, String repositoryId) | ||
| throws ExecutorException { | ||
| public String metadataPath(ExecutorRequest.Builder executorRequest, String gav, String repositoryId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interface actually throws the exception. Given this is a public method, I'd rather keep it, as it may forbid derived classes to actually throw the exception in an overridden method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it's an unchecked exception, so the argument is moot.
|
Unchecked ones should be in Javadoc only, not on the signature. |
Java 24 - fix unnecessary throws leftover; promoting ExecutorException to checked
why guess, when able to make clear statement? |
impl/maven-executor/src/main/java/org/apache/maven/api/cli/ExecutorException.java
Outdated
Show resolved
Hide resolved
…moting ExecutorException to checked
kindly request critics. |
Java 24 - fix unnecessary throws leftover; promoting ExecutorException to checkedJava 24 - fix unnecessary throws leftover; promoting ExecutorException from Runtime- to Exception being stringent to ensure catch
| * @since 4.0.0 | ||
| */ | ||
| @Experimental | ||
| public class ExecutorException extends RuntimeException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds important enough, being worth to give dedication and segregation.
Java 24 - fix unnecessary throws leftover; promoting ExecutorException from Runtime- to Exception being stringent to ensure catchJava 24 - fix unnecessary throws leftover; promoting ExecutorException to Exception being stringent to ensure catch
Java 24 - fix unnecessary throws leftover; promoting ExecutorException to Exception being stringent to ensure catchunnecessary throws leftover; promoting ExecutorException to Exception being stringent to ensure catch
| } | ||
| } catch (Exception e) { | ||
| throw new ExecutorException("Failed to dispose runtime created realms", e); | ||
| throw new RuntimeException(new ExecutorException("Failed to dispose runtime created realms", e)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes zero sense. First make the actual exception a checked exception, then wrap it into a (untyped) runtime exception.
Now there is no longer a ExecutorException thrown but a RuntimeException.
AI Slop.
|
Replacing this exception is questionable and a change to the visible API for no value. |
|
Resolve #9569 |


Uh oh!
There was an error while loading. Please reload this page.