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

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 9d342af7 Fix -linkoffline comma-path splitting for JDK 11
9d342af7 is described below

commit 9d342af72030253cd19c253e73a668207cd036bc
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Tue Nov 10 23:25:10 2026 +0100

    Fix -linkoffline comma-path splitting for JDK 11
    
    The -linkoffline option combined URL and location into a single argument
    with splitValue=true (default), causing StringTokenizer to split the
    combined value on commas. When the location path contains a comma
    (e.g., /unit/commapath,test), JDK 11 misparses the options file and
    fails with errors like 'Error reading file: -quiet/element-list'.
    
    This mirrors the fix applied to -d in PR #1413 (commit 88ca852), which
    passed splitValue=false to prevent comma tokenization. -linkoffline now
    uses the same pattern, matching how single-value options (-bottom,
    -doctitle, etc.) are already handled.
    
    Fixes testCommaPath failure on JDK 11 exposed by PR #1441.
---
 .../java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java 
b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
index fd1a69ee..8338a324 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -3683,11 +3683,15 @@ public abstract class AbstractJavadocMojo extends 
AbstractMojo {
                 continue;
             }
             if (isValidJavadocLink(location, false)) {
+                // Use splitValue=false to prevent tokenizing on commas,
+                // since -linkoffline takes exactly one URL and one location 
(single path, not a list).
+                // JDK 11 misparses comma-containing paths in argument files 
when they are split.
                 addArgIfNotEmpty(
                         arguments,
                         "-linkoffline",
                         JavadocUtil.quotedPathArgument(url) + " " + 
JavadocUtil.quotedPathArgument(location),
-                        true);
+                        true,
+                        false);
             }
         }
     }

Reply via email to