ottlinger commented on code in PR #175:
URL: https://github.com/apache/creadur-rat/pull/175#discussion_r1421078868
##########
apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java:
##########
@@ -501,7 +501,7 @@ private void setExcludes(IgnoringDirectoryScanner ds)
throws MojoExecutionExcept
Collections.addAll(globExcludes, excludes);
}
if (!globExcludes.isEmpty()) {
- final String[] allExcludes = globExcludes.toArray(new
String[globExcludes.size()]);
+ final String[] allExcludes = globExcludes.toArray(new String[0]);
Review Comment:
Following
https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#toArray-T:A-
setting the array's size prevents creating a new one.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]