You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2026/01/27 13:03:43 UTC

(maven-compiler-plugin) branch dep created (now 1b0ac44)

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a change to branch dep
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git


      at 1b0ac44  Reorder cases to avoid skipping

This branch includes the following new commits:

     new 1b0ac44  Reorder cases to avoid skipping

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(maven-compiler-plugin) 01/01: Reorder cases to avoid skipping

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch dep
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git

commit 1b0ac44dc65d45b5b810fe9a5db7c35991114db4
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Tue Jan 27 08:03:28 2026 -0500

    Reorder cases to avoid skipping
---
 src/main/java/org/apache/maven/plugin/compiler/Options.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/compiler/Options.java b/src/main/java/org/apache/maven/plugin/compiler/Options.java
index 74e664e..bc34e66 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/Options.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/Options.java
@@ -320,13 +320,13 @@ public final class Options {
         if (expected == count) {
             warning = null;
             return true;
-        } else if (expected < 1) {
+        } else if (expected == 0) {
+            warning = "The '" + option + "' option does not expect any argument.";
+        } else if (expected < 0) {
             if (checker instanceof ForkedCompiler) {
                 return true; // That implementation actually knows nothing about which options are supported.
             }
             warning = "The '" + option + "' option is not supported.";
-        } else if (expected == 0) {
-            warning = "The '" + option + "' option does not expect any argument.";
         } else if (expected == 1) {
             warning = "The '" + option + "' option expects a single argument.";
         } else {