Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-6847] Use diamond operator #335

Merged
merged 1 commit into from
Sep 13, 2023
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 @@ -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
Loading