This is an automated email from the ASF dual-hosted git repository. ebourg pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-compress.git
commit 4c46384d395419798147d9d3a34cb1bb03323043 Author: Emmanuel Bourg <ebo...@apache.org> AuthorDate: Mon Jul 19 15:00:17 2021 +0200 Use the diamond operator --- .../apache/commons/compress/archivers/tar/TarUtilsTest.java | 10 +++++----- .../commons/compress/compressors/pack200/Pack200UtilsTest.java | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java index e820c06..b2c9cf1 100644 --- a/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java @@ -416,7 +416,7 @@ public class TarUtilsTest { public void readSimplePaxHeader() throws Exception { final Map<String, String> headers = TarUtils.parsePaxHeaders( new ByteArrayInputStream("30 atime=1321711775.972059463\n".getBytes(StandardCharsets.UTF_8)), - null, new HashMap<String, String>()); + null, new HashMap<>()); assertEquals(1, headers.size()); assertEquals("1321711775.972059463", headers.get("atime")); } @@ -424,7 +424,7 @@ public class TarUtilsTest { @Test public void secondEntryWinsWhenPaxHeaderContainsDuplicateKey() throws Exception { final Map<String, String> headers = TarUtils.parsePaxHeaders(new ByteArrayInputStream("11 foo=bar\n11 foo=baz\n" - .getBytes(StandardCharsets.UTF_8)), null, new HashMap<String, String>()); + .getBytes(StandardCharsets.UTF_8)), null, new HashMap<>()); assertEquals(1, headers.size()); assertEquals("baz", headers.get("foo")); } @@ -433,7 +433,7 @@ public class TarUtilsTest { public void paxHeaderEntryWithEmptyValueRemovesKey() throws Exception { final Map<String, String> headers = TarUtils .parsePaxHeaders(new ByteArrayInputStream("11 foo=bar\n7 foo=\n" - .getBytes(StandardCharsets.UTF_8)), null, new HashMap<String, String>()); + .getBytes(StandardCharsets.UTF_8)), null, new HashMap<>()); assertEquals(0, headers.size()); } @@ -441,7 +441,7 @@ public class TarUtilsTest { public void readPaxHeaderWithEmbeddedNewline() throws Exception { final Map<String, String> headers = TarUtils .parsePaxHeaders(new ByteArrayInputStream("28 comment=line1\nline2\nand3\n" - .getBytes(StandardCharsets.UTF_8)), null, new HashMap<String, String>()); + .getBytes(StandardCharsets.UTF_8)), null, new HashMap<>()); assertEquals(1, headers.size()); assertEquals("line1\nline2\nand3", headers.get("comment")); } @@ -452,7 +452,7 @@ public class TarUtilsTest { final String line = "11 path="+ ae + "\n"; assertEquals(11, line.getBytes(StandardCharsets.UTF_8).length); final Map<String, String> headers = TarUtils - .parsePaxHeaders(new ByteArrayInputStream(line.getBytes(StandardCharsets.UTF_8)), null, new HashMap<String, String>()); + .parsePaxHeaders(new ByteArrayInputStream(line.getBytes(StandardCharsets.UTF_8)), null, new HashMap<>()); assertEquals(1, headers.size()); assertEquals(ae, headers.get("path")); } diff --git a/src/test/java/org/apache/commons/compress/compressors/pack200/Pack200UtilsTest.java b/src/test/java/org/apache/commons/compress/compressors/pack200/Pack200UtilsTest.java index b408566..cff494c 100644 --- a/src/test/java/org/apache/commons/compress/compressors/pack200/Pack200UtilsTest.java +++ b/src/test/java/org/apache/commons/compress/compressors/pack200/Pack200UtilsTest.java @@ -38,8 +38,7 @@ public final class Pack200UtilsTest extends AbstractTestCase { final File input = getFile("bla.jar"); final File[] output = createTempDirAndFile(); try { - Pack200Utils.normalize(input, output[1], - new HashMap<String, String>()); + Pack200Utils.normalize(input, output[1], new HashMap<>()); try (InputStream is = Files.newInputStream(output[1].toPath())) { final ArchiveInputStream in = ArchiveStreamFactory.DEFAULT .createArchiveInputStream("jar", is);