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 @@ -383,7 +383,7 @@ private boolean checkDependencies() throws MojoExecutionException {
logDependencyWarning("Used undeclared dependencies found:");

if (verbose) {
logArtifacts(usedUndeclaredWithClasses, true);
logArtifacts(usedUndeclaredWithClasses);
} else {
logArtifacts(usedUndeclaredWithClasses.keySet(), true);
}
Expand Down Expand Up @@ -464,24 +464,17 @@ private void logArtifacts(Set<Artifact> artifacts, boolean warn) {
}
}

private void logArtifacts(Map<Artifact, Set<String>> artifacts, boolean warn) {
private void logArtifacts(Map<Artifact, Set<String>> artifacts) {
if (artifacts.isEmpty()) {
getLog().info(" None");
} else {
for (Map.Entry<Artifact, Set<String>> entry : artifacts.entrySet()) {
// called because artifact will set the version to -SNAPSHOT only if I do this. MNG-2961
entry.getKey().isSnapshot();

if (warn) {
logDependencyWarning(" " + entry.getKey());
for (String clazz : entry.getValue()) {
logDependencyWarning(" class " + clazz);
}
} else {
getLog().info(" " + entry.getKey());
for (String clazz : entry.getValue()) {
getLog().info(" class " + clazz);
}
logDependencyWarning(" " + entry.getKey());
for (String clazz : entry.getValue()) {
logDependencyWarning(" class " + clazz);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected List<ArtifactItem> getProcessedArtifactItems(ProcessArtifactItemsReque

boolean removeClassifier = processArtifactItemsRequest.isRemoveClassifier();

if (artifactItems == null || artifactItems.size() < 1) {
if (artifactItems == null || artifactItems.isEmpty()) {
throw new MojoExecutionException("There are no artifactItems configured.");
}

Expand All @@ -182,7 +182,7 @@ protected List<ArtifactItem> getProcessedArtifactItems(ProcessArtifactItemsReque
artifactItem.setArtifact(this.getArtifact(artifactItem));

if (artifactItem.getDestFileName() == null
|| artifactItem.getDestFileName().length() == 0) {
|| artifactItem.getDestFileName().isEmpty()) {
artifactItem.setDestFileName(DependencyUtil.getFormattedFileName(
artifactItem.getArtifact(), removeVersion, prependGroupId, useBaseVersion, removeClassifier));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected void doExecute() throws MojoExecutionException {
sb.append(System.lineSeparator());
sb.append("The following plugins have been resolved:");
sb.append(System.lineSeparator());
if (plugins == null || plugins.isEmpty()) {
if (plugins.isEmpty()) {
sb.append(" none");
sb.append(System.lineSeparator());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public boolean visit(DependencyNode node) {
* @param node the node to write
*/
private void writeRootNode(DependencyNode node) {
Set<DependencyNode> visited = new HashSet<DependencyNode>();
Set<DependencyNode> visited = new HashSet<>();
int indent = 2;
StringBuilder sb = new StringBuilder();
sb.append("{").append("\n");
Expand Down