File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
main/java/org/apache/maven/plugins/javadoc
test/java/org/apache/maven/plugins/javadoc Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 5757import java .util .regex .Matcher ;
5858import java .util .regex .Pattern ;
5959import java .util .regex .PatternSyntaxException ;
60+ import java .util .stream .Collectors ;
6061
6162import org .apache .http .HttpHeaders ;
6263import org .apache .http .HttpHost ;
@@ -223,12 +224,12 @@ protected static List<String> getExcludedPackages(
223224 protected static String quotedArgument (String value ) {
224225 String arg = value ;
225226
227+ List <String > list = Arrays .stream (arg .split ("\n " )).map (String ::trim ).collect (Collectors .toList ());
228+ arg = String .join ("" , list );
229+
226230 if (arg != null && !arg .isEmpty ()) {
227231 arg = arg .replace ("'" , "\\ '" );
228232 arg = "'" + arg + "'" ;
229-
230- // To prevent javadoc error
231- arg = arg .replace ("\n " , " " );
232233 }
233234
234235 return arg ;
Original file line number Diff line number Diff line change @@ -675,4 +675,19 @@ private void stopSilently(Server server) {
675675 // ignored
676676 }
677677 }
678+
679+ public void testQuotedArgument () throws Exception {
680+
681+ String value = " org.apache.uima.analysis_component:\n " +
682+ " org.apache.uima.analysis_engine\n " ;
683+
684+ String arg = JavadocUtil .quotedArgument (value );
685+ assertThat (arg ).isEqualTo ("'org.apache.uima.analysis_component:org.apache.uima.analysis_engine'" );
686+
687+ value = "org.apache.uima.analysis_component:org.apache.uima.analysis_engine" ;
688+
689+ arg = JavadocUtil .quotedArgument (value );
690+ assertThat (arg ).isEqualTo ("'org.apache.uima.analysis_component:org.apache.uima.analysis_engine'" );
691+
692+ }
678693}
You can’t perform that action at this time.
0 commit comments