[MJAVADOC-825] Prefer NullPointerExceptions for null arguments#350
[MJAVADOC-825] Prefer NullPointerExceptions for null arguments#350
Conversation
| * @throws NullPointerException if the output is null | ||
| * @throws IllegalArgumentException if the output is empty | ||
| */ | ||
| protected static String extractJavadocVersion(String output) throws IllegalArgumentException { |
There was a problem hiding this comment.
Given IAEx being declared as thrown by, perhaps NPEx could also be added for style consistency?
Or IAEx declaration removed?
There was a problem hiding this comment.
Both have @throws clauses. Or did you mean something else?
There was a problem hiding this comment.
IllegalArgumentException is RTEx (as NPEx is). And is declared as being thrown by this method. Thus - let's add NullPointerException to the throws list.
Or remove throws.
Here, and in the second modified method.
There was a problem hiding this comment.
But that's already done in this PR. Are you looking at the left side (old code) instead of the right side (new code)?
There was a problem hiding this comment.
I see this:
protected static String extractJavadocVersion(String output) throws IllegalArgumentException {I'd like to see this instead:
protected static String extractJavadocVersion(String output) throws IllegalArgumentException, NullPointerException {or this:
protected static String extractJavadocVersion(String output) {There was a problem hiding this comment.
Good spot. That should go the other way per guidelines. Removed both.
|
Resolve #1204 |
No description provided.