gnodet commented on code in PR #1080:
URL: https://github.com/apache/maven/pull/1080#discussion_r1158888542
##########
maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java:
##########
@@ -90,7 +88,9 @@ private String loadMavenVersion() {
@Override
public boolean isMavenVersion(String versionRange) {
- Validate.notBlank(versionRange, "versionRange can neither be null,
empty nor blank");
+ if (!(versionRange != null && !versionRange.isEmpty())) {
+ throw new IllegalArgumentException("versionRange can neither be
null nor empty");
Review Comment:
I've always disliked throwing NPE explicitly and this will complicate the
code as the test need to be split... Imho, in all cases, those are illegal
arguments...
I'm going to commit the following:
```
if (Objects.requireNonNull(versionRange, "versionRange cannot be
null").isEmpty()) {
throw new IllegalArgumentException("versionRange cannot be
empty");
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]