You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2024/12/05 11:37:49 UTC

[PR] Prefer NullPointerExceptions for null arguments [maven-javadoc-plugin]

elharo opened a new pull request, #350:
URL: https://github.com/apache/maven-javadoc-plugin/pull/350

   (no comment)


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [MJAVADOC-825] Prefer NullPointerExceptions for null arguments [maven-javadoc-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #350:
URL: https://github.com/apache/maven-javadoc-plugin/pull/350#discussion_r1871307752


##########
src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java:
##########
@@ -534,11 +534,16 @@ protected static JavaVersion getJavadocVersion(File javadocExe)
      * @return the version of the javadoc for the output, only digits and dots
      * @throws PatternSyntaxException if the output doesn't match with the output pattern
      *             {@code (?s).*?[^a-zA-Z]([0-9]+\\.?[0-9]*)(\\.([0-9]+))?.*}.
-     * @throws IllegalArgumentException if the output is null
+     * @throws NullPointerException if the output is null
+     * @throws IllegalArgumentException if the output is empty
      */
     protected static String extractJavadocVersion(String output) throws IllegalArgumentException {

Review Comment:
   Good spot. That should go the other way per guidelines. Removed both. 



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [MJAVADOC-825] Prefer NullPointerExceptions for null arguments [maven-javadoc-plugin]

Posted by "pzygielo (via GitHub)" <gi...@apache.org>.
pzygielo commented on code in PR #350:
URL: https://github.com/apache/maven-javadoc-plugin/pull/350#discussion_r1871272485


##########
src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java:
##########
@@ -534,11 +534,16 @@ protected static JavaVersion getJavadocVersion(File javadocExe)
      * @return the version of the javadoc for the output, only digits and dots
      * @throws PatternSyntaxException if the output doesn't match with the output pattern
      *             {@code (?s).*?[^a-zA-Z]([0-9]+\\.?[0-9]*)(\\.([0-9]+))?.*}.
-     * @throws IllegalArgumentException if the output is null
+     * @throws NullPointerException if the output is null
+     * @throws IllegalArgumentException if the output is empty
      */
     protected static String extractJavadocVersion(String output) throws IllegalArgumentException {

Review 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.
   



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [MJAVADOC-825] Prefer NullPointerExceptions for null arguments [maven-javadoc-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo merged PR #350:
URL: https://github.com/apache/maven-javadoc-plugin/pull/350


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [MJAVADOC-825] Prefer NullPointerExceptions for null arguments [maven-javadoc-plugin]

Posted by "pzygielo (via GitHub)" <gi...@apache.org>.
pzygielo commented on code in PR #350:
URL: https://github.com/apache/maven-javadoc-plugin/pull/350#discussion_r1871298115


##########
src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java:
##########
@@ -534,11 +534,16 @@ protected static JavaVersion getJavadocVersion(File javadocExe)
      * @return the version of the javadoc for the output, only digits and dots
      * @throws PatternSyntaxException if the output doesn't match with the output pattern
      *             {@code (?s).*?[^a-zA-Z]([0-9]+\\.?[0-9]*)(\\.([0-9]+))?.*}.
-     * @throws IllegalArgumentException if the output is null
+     * @throws NullPointerException if the output is null
+     * @throws IllegalArgumentException if the output is empty
      */
     protected static String extractJavadocVersion(String output) throws IllegalArgumentException {

Review Comment:
   I see this:
   ```java
   protected static String extractJavadocVersion(String output) throws IllegalArgumentException {
   ```
   I'd like to see this instead:
   ```java
   protected static String extractJavadocVersion(String output) throws IllegalArgumentException, NullPointerException {
   ```
   or this:
   ```java
   protected static String extractJavadocVersion(String output) {
   ```



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [MJAVADOC-825] Prefer NullPointerExceptions for null arguments [maven-javadoc-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #350:
URL: https://github.com/apache/maven-javadoc-plugin/pull/350#discussion_r1871266857


##########
src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java:
##########
@@ -534,11 +534,16 @@ protected static JavaVersion getJavadocVersion(File javadocExe)
      * @return the version of the javadoc for the output, only digits and dots
      * @throws PatternSyntaxException if the output doesn't match with the output pattern
      *             {@code (?s).*?[^a-zA-Z]([0-9]+\\.?[0-9]*)(\\.([0-9]+))?.*}.
-     * @throws IllegalArgumentException if the output is null
+     * @throws NullPointerException if the output is null
+     * @throws IllegalArgumentException if the output is empty
      */
     protected static String extractJavadocVersion(String output) throws IllegalArgumentException {

Review Comment:
   Both have @throws clauses. Or did you mean something else?



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [MJAVADOC-825] Prefer NullPointerExceptions for null arguments [maven-javadoc-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on PR #350:
URL: https://github.com/apache/maven-javadoc-plugin/pull/350#issuecomment-2957403885

   Resolve #1204


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [MJAVADOC-825] Prefer NullPointerExceptions for null arguments [maven-javadoc-plugin]

Posted by "pzygielo (via GitHub)" <gi...@apache.org>.
pzygielo commented on code in PR #350:
URL: https://github.com/apache/maven-javadoc-plugin/pull/350#discussion_r1871242308


##########
src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java:
##########
@@ -534,11 +534,16 @@ protected static JavaVersion getJavadocVersion(File javadocExe)
      * @return the version of the javadoc for the output, only digits and dots
      * @throws PatternSyntaxException if the output doesn't match with the output pattern
      *             {@code (?s).*?[^a-zA-Z]([0-9]+\\.?[0-9]*)(\\.([0-9]+))?.*}.
-     * @throws IllegalArgumentException if the output is null
+     * @throws NullPointerException if the output is null
+     * @throws IllegalArgumentException if the output is empty
      */
     protected static String extractJavadocVersion(String output) throws IllegalArgumentException {

Review Comment:
   Given `IAEx` being declared as thrown by, perhaps `NPEx` could also be added for style consistency?
   Or `IAEx` declaration removed?



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [MJAVADOC-825] Prefer NullPointerExceptions for null arguments [maven-javadoc-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #350:
URL: https://github.com/apache/maven-javadoc-plugin/pull/350#discussion_r1871280290


##########
src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java:
##########
@@ -534,11 +534,16 @@ protected static JavaVersion getJavadocVersion(File javadocExe)
      * @return the version of the javadoc for the output, only digits and dots
      * @throws PatternSyntaxException if the output doesn't match with the output pattern
      *             {@code (?s).*?[^a-zA-Z]([0-9]+\\.?[0-9]*)(\\.([0-9]+))?.*}.
-     * @throws IllegalArgumentException if the output is null
+     * @throws NullPointerException if the output is null
+     * @throws IllegalArgumentException if the output is empty
      */
     protected static String extractJavadocVersion(String output) throws IllegalArgumentException {

Review 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)?



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org