Skip to content

Commit de7751b

Browse files
committed
Simplify expression
1 parent b773e4c commit de7751b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/main/java/org/apache/maven/plugins/dependency/DisplayAncestorsMojo.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import java.util.ArrayList;
2222
import java.util.List;
23-
import java.util.Locale;
2423

2524
import org.apache.maven.plugin.AbstractMojo;
2625
import org.apache.maven.plugin.MojoExecutionException;
@@ -62,14 +61,8 @@ private ArrayList<String> collectAncestors() {
6261

6362
MavenProject currentAncestor = project.getParent();
6463
while (currentAncestor != null) {
65-
final String gav = String.format(
66-
Locale.US,
67-
"%s:%s:%s",
68-
currentAncestor.getGroupId(),
69-
currentAncestor.getArtifactId(),
70-
currentAncestor.getVersion());
71-
72-
ancestors.add(gav);
64+
ancestors.add(currentAncestor.getGroupId() + ":" + currentAncestor.getArtifactId() + ":"
65+
+ currentAncestor.getVersion());
7366

7467
currentAncestor = currentAncestor.getParent();
7568
}

0 commit comments

Comments
 (0)