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

   ## Summary
   
   Fixes `-linkoffline` comma-path splitting on JDK 11, mirroring the `-d` fix 
from PR #1413 (commit 88ca852).
   
   ## Problem
   
   When the javadoc location path contains a comma (e.g., 
/unit/commapath,test), the `-linkoffline` argument value (URL + location 
combined) is tokenized by StringTokenizer on commas because addArgIfNotEmpty 
defaults to splitValue=true. JDK 11's javadoc argument file parser then 
misreads the options file, causing failures like:
   
   javadoc: error - Error reading file: -quiet/element-list
   
   This was exposed by PR #1441's testCommaPath test 
(@Basedir("/unit/commapath,test")) and is a pre-existing JDK 11 limitation 
unrelated to the plexus-java bump.
   
   ## Root Cause
   
   AbstractJavadocMojo.addLinkofflineArguments() calls:
   addArgIfNotEmpty(arguments, "-linkoffline", url + " " + location, true);
   
   The 4-arg overload defaults splitValue=true, which tokenizes on commas. A 
directory like commapath,test gets split into two fragments, corrupting the 
options file.
   
   ## Fix
   
   Pass splitValue=false for -linkoffline, exactly matching the -d fix from PR 
#1413:
   addArgIfNotEmpty(arguments, "-linkoffline", url + " " + location, true, 
false);
   
   -linkoffline takes exactly one URL and one location (a single path, not a 
list), so comma tokenization is inappropriate — just like -bottom, -doctitle, 
and -d.
   
   ## Testing
   
   - testCommaPath passes on JDK 11 (was failing) and JDK 27
   - All 40 JavadocReportTest tests pass (8 skipped as expected; pre-existing 
testJavadocResourcesWithExcludes failure unrelated)
   
   ## Related
   
   - Issue #372: Issues with directories that have a comma in them (fixed -d 
only)
   - PR #1413: Fixed -d but missed -linkoffline
   - PR #1441: Exposed the -linkoffline issue via testCommaPath on JDK 11


-- 
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]

Reply via email to