Skip to content

Commit

Permalink
[MNG-6847] Use diamond operator
Browse files Browse the repository at this point in the history
  • Loading branch information
2 people authored and slachiewicz committed Sep 13, 2023
1 parent 0062083 commit 34348ec
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public BuildingDependencyNodeVisitor() {
public BuildingDependencyNodeVisitor(DependencyNodeVisitor visitor) {
this.visitor = visitor;

parentNodes = new Stack<DependencyNode>();
parentNodes = new Stack<>();
}

// DependencyNodeVisitor methods ------------------------------------------
Expand All @@ -90,7 +90,7 @@ public boolean visit(DependencyNode node) {
node.getOptional(),
node.getExclusions(),
node.toNodeString());
newNode.setChildren(new ArrayList<DependencyNode>());
newNode.setChildren(new ArrayList<>());

if (parentNodes.empty()) {
rootNode = newNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void testNoTransitive() throws Exception {

public void testExcludeType() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getTypedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.excludeTypes = "jar";
mojo.execute();

Expand All @@ -170,7 +170,7 @@ public void testExcludeType() throws Exception {

public void testIncludeType() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getTypedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());

mojo.includeTypes = "jar";
mojo.excludeTypes = "jar";
Expand Down Expand Up @@ -198,7 +198,7 @@ public void testIncludeType() throws Exception {

public void testExcludeArtifactId() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getArtifactArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.excludeArtifactIds = "one";
mojo.execute();

Expand All @@ -212,7 +212,7 @@ public void testExcludeArtifactId() throws Exception {

public void testIncludeArtifactId() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getArtifactArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());

mojo.includeArtifactIds = "one";
mojo.excludeArtifactIds = "one";
Expand Down Expand Up @@ -240,7 +240,7 @@ public void testIncludeArtifactId() throws Exception {

public void testIncludeGroupId() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getGroupIdArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.includeGroupIds = "one";
mojo.excludeGroupIds = "one";
// shouldn't get anything
Expand All @@ -267,7 +267,7 @@ public void testIncludeGroupId() throws Exception {

public void testExcludeGroupId() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getGroupIdArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.excludeGroupIds = "one";
mojo.execute();

Expand All @@ -282,7 +282,7 @@ public void testExcludeGroupId() throws Exception {

public void testExcludeMultipleGroupIds() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getGroupIdArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.excludeGroupIds = "one,two";
mojo.execute();

Expand All @@ -298,7 +298,7 @@ public void testExcludeMultipleGroupIds() throws Exception {

public void testExcludeClassifier() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getClassifiedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.excludeClassifiers = "one";
mojo.execute();

Expand All @@ -312,7 +312,7 @@ public void testExcludeClassifier() throws Exception {

public void testIncludeClassifier() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getClassifiedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());

mojo.includeClassifiers = "one";
mojo.excludeClassifiers = "one";
Expand Down Expand Up @@ -340,7 +340,7 @@ public void testIncludeClassifier() throws Exception {

public void testSubPerType() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getTypedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.useSubDirectoryPerType = true;
mojo.execute();

Expand Down Expand Up @@ -555,7 +555,7 @@ public void testGetDependencies() throws MojoExecutionException {

public void testExcludeProvidedScope() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getScopedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.excludeScope = "provided";
// mojo.silent = false;

Expand All @@ -573,7 +573,7 @@ public void testExcludeProvidedScope() throws Exception {

public void testExcludeSystemScope() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getScopedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.excludeScope = "system";
// mojo.silent = false;

Expand All @@ -591,7 +591,7 @@ public void testExcludeSystemScope() throws Exception {

public void testExcludeCompileScope() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getScopedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.excludeScope = "compile";
mojo.execute();
ScopeArtifactFilter saf = new ScopeArtifactFilter(mojo.excludeScope);
Expand All @@ -607,7 +607,7 @@ public void testExcludeCompileScope() throws Exception {

public void testExcludeTestScope() throws IOException, MojoFailureException {
mojo.getProject().setArtifacts(stubFactory.getScopedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.excludeScope = "test";

try {
Expand All @@ -620,7 +620,7 @@ public void testExcludeTestScope() throws IOException, MojoFailureException {

public void testExcludeRuntimeScope() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getScopedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.excludeScope = "runtime";
mojo.execute();
ScopeArtifactFilter saf = new ScopeArtifactFilter(mojo.excludeScope);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected void setUp() throws Exception {

public void testCopyDependenciesMojoIncludeCompileScope() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getScopedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.includeScope = "compile";

mojo.execute();
Expand All @@ -100,7 +100,7 @@ public void testCopyDependenciesMojoIncludeCompileScope() throws Exception {

public void testCopyDependenciesMojoIncludeTestScope() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getScopedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.includeScope = "test";

mojo.execute();
Expand All @@ -118,7 +118,7 @@ public void testCopyDependenciesMojoIncludeTestScope() throws Exception {

public void testCopyDependenciesMojoIncludeRuntimeScope() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getScopedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.includeScope = "runtime";

mojo.execute();
Expand All @@ -136,7 +136,7 @@ public void testCopyDependenciesMojoIncludeRuntimeScope() throws Exception {

public void testCopyDependenciesMojoIncludeprovidedScope() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getScopedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.includeScope = "provided";

mojo.execute();
Expand All @@ -152,7 +152,7 @@ public void testCopyDependenciesMojoIncludeprovidedScope() throws Exception {

public void testCopyDependenciesMojoIncludesystemScope() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getScopedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.includeScope = "system";

mojo.execute();
Expand Down Expand Up @@ -183,7 +183,7 @@ public void testSubPerArtifact() throws Exception {

public void testSubPerArtifactAndType() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getTypedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.useSubDirectoryPerArtifact = true;
mojo.useSubDirectoryPerType = true;

Expand All @@ -201,7 +201,7 @@ public void testSubPerArtifactAndType() throws Exception {

public void testSubPerArtifactAndScope() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getTypedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.useSubDirectoryPerArtifact = true;
mojo.useSubDirectoryPerScope = true;

Expand Down Expand Up @@ -322,7 +322,7 @@ public void testSubPerArtifactRemoveVersion() throws Exception {

public void testSubPerArtifactAndTypeRemoveVersion() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getTypedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.useSubDirectoryPerArtifact = true;
mojo.useSubDirectoryPerType = true;
mojo.stripVersion = true;
Expand Down Expand Up @@ -357,7 +357,7 @@ public void testSubPerArtifactRemoveType() throws Exception {

public void testSubPerArtifactAndTypeRemoveType() throws Exception {
mojo.getProject().setArtifacts(stubFactory.getTypedArtifacts());
mojo.getProject().setDependencyArtifacts(new HashSet<Artifact>());
mojo.getProject().setDependencyArtifacts(new HashSet<>());
mojo.useSubDirectoryPerArtifact = true;
mojo.useSubDirectoryPerType = true;
mojo.stripType = true;
Expand Down
Loading

0 comments on commit 34348ec

Please sign in to comment.