elharo commented on a change in pull request #34: [MJAVADOC-628] - add 
javadoc.io link pattern when <detectLink> option is …
URL: 
https://github.com/apache/maven-javadoc-plugin/pull/34#discussion_r405424838
 
 

 ##########
 File path: 
src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
 ##########
 @@ -6543,6 +6557,38 @@ private static String getJavadocLink( MavenProject p )
         return url + "/" + destDir;
     }
 
+    /**
+     * @param groupId not null
+     * @param artifactId not null
+     * @param version not null
+     * @return the javadoc link based on the project javadoc.io url
+     *         i.e. 
<code>https://www.javadoc.io/doc/${group_id}/${artifact_id}/${version_id}/package-list</code>
+     */
+    static String getJavadocIOLink( String groupId, String artifactId, String 
version )
+    {
+        String baseUrl = "https://javadoc.io/doc/";;
+        return baseUrl + urlEncode( groupId ) + "/" + urlEncode( artifactId ) 
+ "/" + urlEncode( version );
+    }
+
+    static String urlEncode( String s )
+    {
+        if ( s == null )
 
 Review comment:
   don't need this check if your nonnull claims above are true. also this 
method should never return null

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to