Skip to content

[MNG-6847] Use diamond operator #11

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

Merged
merged 1 commit into from
Aug 19, 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 @@ -57,7 +57,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept

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

Set<String> required = new HashSet<String>();
Set<String> required = new HashSet<>();

required.add(archivePathFromProject(BASENAME, VERSION, "/pom.xml"));
required.add(archivePathFromChild(BASENAME, VERSION, "child1", "pom.xml"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept

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

Set<String> required = new HashSet<String>();
Set<String> required = new HashSet<>();

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

Set<String> banned = new HashSet<String>();
Set<String> banned = new HashSet<>();

banned.add(archivePathFromProject(BASENAME, VERSION, "/target/"));
banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/target/"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept

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

Set<String> required = new HashSet<String>();
Set<String> required = new HashSet<>();

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

Set<String> banned = new HashSet<String>();
Set<String> banned = new HashSet<>();

banned.add(archivePathFromProject(BASENAME, VERSION, "/target/"));
banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/target/"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept

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

Set<String> required = new HashSet<String>();
Set<String> required = new HashSet<>();

required.add(archivePathFromProject(BASENAME, VERSION, "/pom.xml"));
required.add(archivePathFromProject(BASENAME, VERSION, "/LICENSE"));
required.add(archivePathFromProject(BASENAME, VERSION, "/DEPENDENCIES"));
required.add(archivePathFromProject(BASENAME, VERSION, "/NOTICE"));

Set<String> banned = new HashSet<String>();
Set<String> banned = new HashSet<>();

banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/LICENSE"));
banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/DEPENDENCIES"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept

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

Set<String> banned = new HashSet<String>();
Set<String> banned = new HashSet<>();

banned.add(archivePathFromProject(BASENAME, VERSION, "/.classpath"));
banned.add(archivePathFromProject(BASENAME, VERSION, "/.project"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept

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

Set<String> banned = new HashSet<String>();
Set<String> banned = new HashSet<>();

banned.add(archivePathFromProject(BASENAME, VERSION, "/cobertura.ser"));
banned.add(archivePathFromProject(BASENAME, VERSION, "/release.properties"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept

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

Set<String> banned = new HashSet<String>();
Set<String> banned = new HashSet<>();

banned.add(archivePathFromProject(BASENAME, VERSION, "/.github"));
banned.add(archivePathFromProject(BASENAME, VERSION, "/Jenkinsfile"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept

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

Set<String> required = new HashSet<String>();
Set<String> required = new HashSet<>();

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

Set<String> banned = new HashSet<String>();
Set<String> banned = new HashSet<>();

banned.add(archivePathFromProject(BASENAME, VERSION, "/target/"));
banned.add(archivePathFromProject(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept

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

Set<String> required = new HashSet<String>();
Set<String> required = new HashSet<>();

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

Set<String> banned = new HashSet<String>();
Set<String> banned = new HashSet<>();

assertZipContents(required, banned, assembly);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void execute() throws VerificationException, IOException, URISyntaxExcept
File zipAssemblyFile = new File(testDir, "target/" + BASENAME + "-" + VERSION + "-source-release.zip");
Assert.assertTrue("zip assembly should have been created", zipAssemblyFile.exists());

Set<String> required = new HashSet<String>();
Set<String> required = new HashSet<>();

required.add(archivePathFromProject(BASENAME, VERSION, "/pom.xml"));
required.add(archivePathFromChild(BASENAME, VERSION, "child1", "pom.xml"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static void assertTarContents(Set<String> required, Set<String> banned, F
try {
tarFile = new GZipTarFile(assembly);

LinkedHashSet<String> pathSet = new LinkedHashSet<String>();
LinkedHashSet<String> pathSet = new LinkedHashSet<>();

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

LinkedHashSet<String> pathSet = new LinkedHashSet<String>();
LinkedHashSet<String> pathSet = new LinkedHashSet<>();

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

Set<String> missing = new HashSet<String>();
Set<String> missing = new HashSet<>();
for (String name : required) {
if (!contents.contains(name)) {
missing.add(name);
}
}

Set<String> banViolations = new HashSet<String>();
Set<String> banViolations = new HashSet<>();
for (String name : banned) {
if (contents.contains(name)) {
banViolations.add(name);
Expand Down