rfscholte commented on a change in pull request #10: [JXR-110] Use equivalent
css/images of javadoc
URL: https://github.com/apache/maven-jxr/pull/10#discussion_r212820177
##########
File path:
maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java
##########
@@ -479,6 +552,66 @@ protected void executeReport( Locale locale )
}
}
+
+ /**
+ * Determine the templateDir to use, given javadocTemplatesVersion
+ *
+ * @return
+ */
+ private String getTemplateDir()
+ {
+ // Check if overridden
+ if ( StringUtils.isEmpty( templateDir ) )
+ {
+ if ( javadocTemplatesVersion.isAtLeast( "8" ) )
+ {
+ return "templates/jdk8";
+ }
+ else if ( javadocTemplatesVersion.isAtLeast( "7" ) )
+ {
+ return "templates/jdk7";
+ }
+ else if ( javadocTemplatesVersion.isAtLeast( "4" ) )
+ {
+ return "templates/jdk4";
+ }
+ else
+ {
+ getLog().warn( "Unsupported javadocVersion: " +
javadocTemplatesVersion + ". Fallback to original" );
+ return "templates";
+ }
+ }
+ // use value specified by user
+ return templateDir;
+ }
+
+ /**
+ * Set a new value for <code>javadocTemplatesVersion</code>
+ *
+ * @throws MavenReportException if not found
+ */
+ private void setJavadocTemplatesVersion()
+ throws MavenReportException
+ {
+ JavaVersion javaVersion = JavaVersion.JAVA_SPECIFICATION_VERSION;
+
+ if ( StringUtils.isNotEmpty( javadocVersion ) )
+ {
+ try
+ {
+ javadocTemplatesVersion = JavaVersion.parse( javadocVersion );
+ }
+ catch ( NumberFormatException e )
Review comment:
This exception will never occur (here). `JavaVersion.parse()` is a lazy
evaluator. Only during comparison the value is evaluated. The evaluator is also
aware of dashes, underscores and classifiers like `ea`.
Hence this method will never throw an exception.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services