Skip to content

Commit

Permalink
[MJAVADOC-570] --add-modules expects comma-separated arguments
Browse files Browse the repository at this point in the history
Avoid converting separator characters into newline.
  • Loading branch information
rfscholte committed Jan 29, 2019
2 parents 8e7b265 + 9761d15 commit c2681a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Expand Up @@ -4964,7 +4964,8 @@ private void addJavadocOptions( File javadocOutputDirectory,
additionalModules.add( moduleName );

addArgIfNotEmpty( arguments, "--patch-module", moduleName + '='
+ JavadocUtil.quotedPathArgument( getSourcePath( projectSourcepaths.getValue() ) ) );
+ JavadocUtil.quotedPathArgument( getSourcePath( projectSourcepaths.getValue() ) ),
false, false );

Path modulePath = moduleSourceDir.resolve( moduleName );
if ( !Files.isDirectory( modulePath ) )
Expand Down Expand Up @@ -5076,7 +5077,8 @@ else if ( resolvePathResult != null )
additionalModules.addAll( addModules );

String addModulesLine = StringUtils.join( addModules.iterator(), "," );
addArgIfNotEmpty( arguments, "--add-modules", JavadocUtil.quotedPathArgument( addModulesLine ) );
addArgIfNotEmpty( arguments, "--add-modules", JavadocUtil.quotedPathArgument( addModulesLine ),
false, false );
}

request.setAdditionalModules( additionalModules );
Expand Down Expand Up @@ -5106,11 +5108,13 @@ else if ( resolvePathResult != null )
}

String classpath = StringUtils.join( classPathElements.iterator(), File.pathSeparator );
addArgIfNotEmpty( arguments, "--class-path", JavadocUtil.quotedPathArgument( classpath ) );
addArgIfNotEmpty( arguments, "--class-path", JavadocUtil.quotedPathArgument( classpath ), false,
false );

String modulepath =
StringUtils.join( modulePathElements.iterator(), File.pathSeparator );
addArgIfNotEmpty( arguments, "--module-path", JavadocUtil.quotedPathArgument( modulepath ) );
addArgIfNotEmpty( arguments, "--module-path", JavadocUtil.quotedPathArgument( modulepath ), false,
false );
}
catch ( IOException e )
{
Expand All @@ -5120,7 +5124,7 @@ else if ( resolvePathResult != null )
else
{
String classpath = StringUtils.join( getPathElements().iterator(), File.pathSeparator );
addArgIfNotEmpty( arguments, "-classpath", JavadocUtil.quotedPathArgument( classpath ) );
addArgIfNotEmpty( arguments, "-classpath", JavadocUtil.quotedPathArgument( classpath ) , false, false );
}

if ( StringUtils.isNotEmpty( doclet ) )
Expand Down Expand Up @@ -5176,7 +5180,7 @@ else if ( resolvePathResult != null )
else
{
addArgIfNotEmpty( arguments, "-sourcepath",
JavadocUtil.quotedPathArgument( getSourcePath( sourcePaths ) ) );
JavadocUtil.quotedPathArgument( getSourcePath( sourcePaths ) ), false, false );
}


Expand Down
Expand Up @@ -394,7 +394,7 @@ public void testCustomConfiguration()
assertTrue( str.toUpperCase().contains( "SAMPLE BOTTOM CONTENT" ) );

// offlineLinks
if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore( "12" ) )
if ( JavaVersion.JAVA_VERSION.isBefore( "11.0.2" ) )
{
assertTrue( str.toLowerCase().contains( "href=\"http://java.sun.com/j2se/1.4.2/docs/api/java/lang/string.html" ) );
}
Expand Down

0 comments on commit c2681a4

Please sign in to comment.