[ 
https://issues.apache.org/jira/browse/MJAVADOC-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17899047#comment-17899047
 ] 

ASF GitHub Bot commented on MJAVADOC-814:
-----------------------------------------

olamy commented on code in PR #337:
URL: 
https://github.com/apache/maven-javadoc-plugin/pull/337#discussion_r1845727649


##########
src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java:
##########
@@ -221,14 +221,17 @@ protected static List<String> getExcludedPackages(
      * @return quoted option-argument
      */
     protected static String quotedArgument(String value) {
+        if (value == null) {
+            return null;
+        }
         String arg = value;
 
+        List<String> list = 
Arrays.stream(arg.split("\n")).map(String::trim).collect(Collectors.toList());
+        arg = String.join("", list);

Review Comment:
   > try to avoid reusing variables as it's bug prone
   > 
   yup please look at the context of the code (the full code) yes it's not idea 
but it;s how the rest of the code is and I don't want to change everything this 
could be part of another PR if you like.
   
   > Also, this is combining lines with no space in between one line and the 
next. Is that what you want?
   
   





> Ability to split grouped packages over multiple lines
> -----------------------------------------------------
>
>                 Key: MJAVADOC-814
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-814
>             Project: Maven Javadoc Plugin
>          Issue Type: New Feature
>          Components: javadoc
>    Affects Versions: 3.10.0
>            Reporter: Richard Eckart de Castilho
>            Assignee: Olivier Lamy
>            Priority: Major
>
> When configuring groups, the packages in the group need to be written on a 
> single line separated with colons.
> {noformat}
> <groups>
>   <group>
>     <title>Core</title>
>     <packages>
>       org.apache.uima.analysis_component:org.apache.uima.analysis_engine
>     </packages>
>   </group>
> </groups>
> {noformat}
> If there are many packages that can not easily be captured using a prefix 
> pattern, this yields a very long line.
> It would be greate if one could split the packages over multiple lines such as
> {noformat}
> <groups>
>   <group>
>     <title>Core</title>
>     <packages>
>       org.apache.uima.analysis_component:
>       org.apache.uima.analysis_engine
>     </packages>
>   </group>
> </groups>
> {noformat}
> The code internally already calls 
> {{org.apache.maven.plugins.javadoc.JavadocUtil.quotedArgument(String)}} to 
> sanitze the line breaks away, but it seems the whitespace still breaks it and 
> javadoc tool in the end only recognizes the first package in the multi-line 
> group. 
> Even nicer may be.
> {noformat}
> <groups>
>   <group>
>     <title>Core</title>
>     <packages>
>       <package>org.apache.uima.analysis_component</package>
>       <package>org.apache.uima.analysis_engine</package>
>     </packages>
>   </group>
> </groups>
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to