Skip to content

Commit 1780dc3

Browse files
timtebeekTeamModerne
authored andcommitted
[MNG-6847] Use diamond operator
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.staticanalysis.UseDiamondOperator?organizationId=QXBhY2hlIE1hdmVu Co-authored-by: Moderne <[email protected]>
1 parent 5771781 commit 1780dc3

11 files changed

+19
-19
lines changed

source-release/src/test/java/org/apache/its/IT_000_BasicArchiveCreation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
5757

5858
File assembly = new File(testDir, "target/" + BASENAME + "-" + VERSION + "-source-release.zip");
5959

60-
Set<String> required = new HashSet<String>();
60+
Set<String> required = new HashSet<>();
6161

6262
required.add(archivePathFromProject(BASENAME, VERSION, "/pom.xml"));
6363
required.add(archivePathFromChild(BASENAME, VERSION, "child1", "pom.xml"));

source-release/src/test/java/org/apache/its/IT_001_ExcludeBuildOutputDirectory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
5151

5252
File assembly = new File(testDir, "target/" + BASENAME + "-" + VERSION + "-source-release.zip");
5353

54-
Set<String> required = new HashSet<String>();
54+
Set<String> required = new HashSet<>();
5555

5656
required.add(archivePathFromProject(BASENAME, VERSION, "/pom.xml"));
5757
required.add(archivePathFromChild(BASENAME, VERSION, "child1", "pom.xml"));
@@ -62,7 +62,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
6262
required.add(
6363
archivePathFromChild(BASENAME, VERSION, "child2", "/src/main/java/org/apache/assembly/it/App.java"));
6464

65-
Set<String> banned = new HashSet<String>();
65+
Set<String> banned = new HashSet<>();
6666

6767
banned.add(archivePathFromProject(BASENAME, VERSION, "/target/"));
6868
banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/target/"));

source-release/src/test/java/org/apache/its/IT_002_IncludeSrcDirWithBuildOutputDirName.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
5151

5252
File assembly = new File(testDir, "target/" + BASENAME + "-" + VERSION + "-source-release.zip");
5353

54-
Set<String> required = new HashSet<String>();
54+
Set<String> required = new HashSet<>();
5555

5656
required.add(archivePathFromProject(BASENAME, VERSION, "/pom.xml"));
5757
required.add(archivePathFromChild(BASENAME, VERSION, "child1", "/pom.xml"));
@@ -61,7 +61,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
6161
required.add(archivePathFromChild(BASENAME, VERSION, "child1", "/src/main/java/target/App.java"));
6262
required.add(archivePathFromChild(BASENAME, VERSION, "child2", "/src/main/java/target/App.java"));
6363

64-
Set<String> banned = new HashSet<String>();
64+
Set<String> banned = new HashSet<>();
6565

6666
banned.add(archivePathFromProject(BASENAME, VERSION, "/target/"));
6767
banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/target/"));

source-release/src/test/java/org/apache/its/IT_003_SharedResourceInclusion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
5151

5252
File assembly = new File(testDir, "target/" + BASENAME + "-" + VERSION + "-source-release.zip");
5353

54-
Set<String> required = new HashSet<String>();
54+
Set<String> required = new HashSet<>();
5555

5656
required.add(archivePathFromProject(BASENAME, VERSION, "/pom.xml"));
5757
required.add(archivePathFromProject(BASENAME, VERSION, "/LICENSE"));
5858
required.add(archivePathFromProject(BASENAME, VERSION, "/DEPENDENCIES"));
5959
required.add(archivePathFromProject(BASENAME, VERSION, "/NOTICE"));
6060

61-
Set<String> banned = new HashSet<String>();
61+
Set<String> banned = new HashSet<>();
6262

6363
banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/LICENSE"));
6464
banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/DEPENDENCIES"));

source-release/src/test/java/org/apache/its/IT_004_IdeExcludes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
5454

5555
Set<String> required = Collections.emptySet();
5656

57-
Set<String> banned = new HashSet<String>();
57+
Set<String> banned = new HashSet<>();
5858

5959
banned.add(archivePathFromProject(BASENAME, VERSION, "/.classpath"));
6060
banned.add(archivePathFromProject(BASENAME, VERSION, "/.project"));

source-release/src/test/java/org/apache/its/IT_005_MiscellaneousExcludes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
5454

5555
Set<String> required = Collections.emptySet();
5656

57-
Set<String> banned = new HashSet<String>();
57+
Set<String> banned = new HashSet<>();
5858

5959
banned.add(archivePathFromProject(BASENAME, VERSION, "/cobertura.ser"));
6060
banned.add(archivePathFromProject(BASENAME, VERSION, "/release.properties"));

source-release/src/test/java/org/apache/its/IT_006_CiExcludes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
5353

5454
Set<String> required = Collections.emptySet();
5555

56-
Set<String> banned = new HashSet<String>();
56+
Set<String> banned = new HashSet<>();
5757

5858
banned.add(archivePathFromProject(BASENAME, VERSION, "/.github"));
5959
banned.add(archivePathFromProject(BASENAME, VERSION, "/Jenkinsfile"));

source-release/src/test/java/org/apache/its/IT_ExcludeSrcDirWithinBuildOutputDir.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
5151

5252
File assembly = new File(testDir, "target/" + BASENAME + "-" + VERSION + "-source-release.zip");
5353

54-
Set<String> required = new HashSet<String>();
54+
Set<String> required = new HashSet<>();
5555

5656
required.add(archivePathFromProject(BASENAME, VERSION, "/pom.xml"));
5757
required.add(archivePathFromChild(BASENAME, VERSION, "child1", "/pom.xml"));
@@ -64,7 +64,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
6464
required.add(archivePathFromChild(
6565
BASENAME, VERSION, "child2", "/src/test/resources/project/src/main/resources/test.properties"));
6666

67-
Set<String> banned = new HashSet<String>();
67+
Set<String> banned = new HashSet<>();
6868

6969
banned.add(archivePathFromProject(BASENAME, VERSION, "/target/"));
7070
banned.add(archivePathFromProject(

source-release/src/test/java/org/apache/its/IT_IncludeIdeFilesWithinSrcDir.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
5151

5252
File assembly = new File(testDir, "target/" + BASENAME + "-" + VERSION + "-source-release.zip");
5353

54-
Set<String> required = new HashSet<String>();
54+
Set<String> required = new HashSet<>();
5555

5656
required.add(archivePathFromProject(BASENAME, VERSION, "/pom.xml"));
5757
required.add(archivePathFromChild(BASENAME, VERSION, "child1", "/pom.xml"));
@@ -84,7 +84,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
8484
required.add(archivePathFromChild(BASENAME, VERSION, "child1", "/src/test/resources/release.properties"));
8585
required.add(archivePathFromChild(BASENAME, VERSION, "child1", "/src/test/resources/pom.xml.releaseBackup"));
8686

87-
Set<String> banned = new HashSet<String>();
87+
Set<String> banned = new HashSet<>();
8888

8989
assertZipContents(required, banned, assembly);
9090
}

source-release/src/test/java/org/apache/its/IT_ZipAndTarCreation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
5959
File zipAssemblyFile = new File(testDir, "target/" + BASENAME + "-" + VERSION + "-source-release.zip");
6060
Assert.assertTrue("zip assembly should have been created", zipAssemblyFile.exists());
6161

62-
Set<String> required = new HashSet<String>();
62+
Set<String> required = new HashSet<>();
6363

6464
required.add(archivePathFromProject(BASENAME, VERSION, "/pom.xml"));
6565
required.add(archivePathFromChild(BASENAME, VERSION, "child1", "pom.xml"));

source-release/src/test/java/org/apache/its/util/TestUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static void assertTarContents(Set<String> required, Set<String> banned, F
6262
try {
6363
tarFile = new GZipTarFile(assembly);
6464

65-
LinkedHashSet<String> pathSet = new LinkedHashSet<String>();
65+
LinkedHashSet<String> pathSet = new LinkedHashSet<>();
6666

6767
for (@SuppressWarnings("unchecked") Enumeration<ArchiveEntry> enumeration = tarFile.getEntries();
6868
enumeration.hasMoreElements(); ) {
@@ -84,7 +84,7 @@ public static void assertZipContents(Set<String> required, Set<String> banned, F
8484
try {
8585
zf = new ZipFile(assembly);
8686

87-
LinkedHashSet<String> pathSet = new LinkedHashSet<String>();
87+
LinkedHashSet<String> pathSet = new LinkedHashSet<>();
8888

8989
for (Enumeration<? extends ZipEntry> enumeration = zf.entries(); enumeration.hasMoreElements(); ) {
9090
pathSet.add(enumeration.nextElement().getName());
@@ -100,14 +100,14 @@ public static void assertZipContents(Set<String> required, Set<String> banned, F
100100
private static void assertArchiveContents(
101101
Set<String> required, Set<String> banned, String assemblyName, Set<String> contents) {
102102

103-
Set<String> missing = new HashSet<String>();
103+
Set<String> missing = new HashSet<>();
104104
for (String name : required) {
105105
if (!contents.contains(name)) {
106106
missing.add(name);
107107
}
108108
}
109109

110-
Set<String> banViolations = new HashSet<String>();
110+
Set<String> banViolations = new HashSet<>();
111111
for (String name : banned) {
112112
if (contents.contains(name)) {
113113
banViolations.add(name);

0 commit comments

Comments
 (0)