diff --git a/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java b/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java index be52f1f5d..669c90c13 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java +++ b/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java @@ -24,7 +24,6 @@ import java.util.LinkedHashSet; import java.util.Set; -import org.apache.commons.lang3.StringUtils; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugins.dependency.fromConfiguration.ArtifactItem; import org.apache.maven.plugins.dependency.utils.DependencyUtil; @@ -284,7 +283,7 @@ public boolean isArtifactIncluded(ArtifactItem item) throws ArtifactFilterExcept } File destFile; - if (StringUtils.isEmpty(item.getDestFileName())) { + if (item.getDestFileName() == null || item.getDestFileName().isEmpty()) { String formattedFileName = DependencyUtil.getFormattedFileName( artifact, removeVersion, prependGroupId, useBaseVersion, removeClassifier); destFile = new File(destFolder, formattedFileName); @@ -298,13 +297,13 @@ public boolean isArtifactIncluded(ArtifactItem item) throws ArtifactFilterExcept } /** - * Using simply {@code File.getLastModified} will return sometimes a wrong value see JDK bug for details. + * {@code File.getLastModified} sometimes returns a wrong value. See JDK bug for details. *
* https://bugs.openjdk.java.net/browse/JDK-8177809 * * @param file {@link File} * @return the last modification time in milliseconds. - * @throws ArtifactFilterException in case of a IO Exception. + * @throws ArtifactFilterException in case of an IOException */ private long getLastModified(File file) throws ArtifactFilterException { try { diff --git a/src/main/java/org/apache/maven/plugins/dependency/utils/markers/UnpackFileMarkerHandler.java b/src/main/java/org/apache/maven/plugins/dependency/utils/markers/UnpackFileMarkerHandler.java index 00c7be06e..396f39fc5 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/utils/markers/UnpackFileMarkerHandler.java +++ b/src/main/java/org/apache/maven/plugins/dependency/utils/markers/UnpackFileMarkerHandler.java @@ -20,7 +20,6 @@ import java.io.File; -import org.apache.commons.lang3.StringUtils; import org.apache.maven.plugins.dependency.fromConfiguration.ArtifactItem; /** @@ -52,22 +51,22 @@ public UnpackFileMarkerHandler(ArtifactItem artifactItem, File markerFilesDirect protected File getMarkerFile() { /* * Build a hash of all include/exclude strings, to determine if an artifactItem has been unpacked using the - * include/exclude parameters, this will allow an artifact to be included multiple times with different - * include/exclude parameters + * include/exclude parameters. This allows an artifact to be included multiple times with different + * include/exclude parameters. */ File markerFile; if (this.artifactItem == null - || (StringUtils.isEmpty(this.artifactItem.getIncludes()) - && StringUtils.isEmpty(this.artifactItem.getExcludes()))) { + || this.artifactItem.getIncludes().isEmpty() + && this.artifactItem.getExcludes().isEmpty()) { markerFile = super.getMarkerFile(); } else { int includeExcludeHash = 0; - if (StringUtils.isNotEmpty(this.artifactItem.getIncludes())) { + if (!this.artifactItem.getIncludes().isEmpty()) { includeExcludeHash += this.artifactItem.getIncludes().hashCode(); } - if (StringUtils.isNotEmpty(this.artifactItem.getExcludes())) { + if (!this.artifactItem.getExcludes().isEmpty()) { includeExcludeHash += this.artifactItem.getExcludes().hashCode(); }