Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.apache.maven.reporting.AbstractMavenReport;
import org.apache.maven.reporting.MavenReportException;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;

/**
* Base class for the PMD reports.
Expand Down Expand Up @@ -390,7 +389,7 @@ private boolean isDirectoryExcluded(Collection<File> excludedRootFiles, File sou
/**
* Gets the comma separated list of effective include patterns.
*
* @return The comma separated list of effective include patterns, never <code>null</code>.
* @return the comma separated list of effective include patterns, never <code>null</code>.
*/
private String getIncludes() {
Collection<String> patterns = new LinkedHashSet<>();
Expand All @@ -400,20 +399,20 @@ private String getIncludes() {
if (patterns.isEmpty()) {
patterns.add("**/*.java");
}
return StringUtils.join(patterns.iterator(), ",");
return String.join(",", patterns);
}

/**
* Gets the comma separated list of effective exclude patterns.
*
* @return The comma separated list of effective exclude patterns, never <code>null</code>.
* @return the comma separated list of effective exclude patterns, never <code>null</code>.
*/
private String getExcludes() {
Collection<String> patterns = new LinkedHashSet<>(FileUtils.getDefaultExcludesAsList());
if (excludes != null) {
patterns.addAll(excludes);
}
return StringUtils.join(patterns.iterator(), ",");
return String.join(",", patterns);
}

protected boolean isXml() {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.codehaus.plexus.resource.loader.FileResourceCreationException;
import org.codehaus.plexus.resource.loader.FileResourceLoader;
import org.codehaus.plexus.resource.loader.ResourceNotFoundException;
import org.codehaus.plexus.util.StringUtils;

/**
* Creates a PMD site report based on the rulesets and configuration set in the plugin.
Expand Down Expand Up @@ -492,7 +491,7 @@ private String determineAuxClasspath() throws MavenReportException {

getLog().debug("Using aux classpath: " + classpath);
}
return StringUtils.join(classpath.iterator(), File.pathSeparator);
return String.join(File.pathSeparator, classpath);
} catch (Exception e) {
throw new MavenReportException(e.getMessage(), e);
}
Expand Down