You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/12/01 19:40:26 UTC

[commons-compress] branch master updated: Format.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


The following commit(s) were added to refs/heads/master by this push:
     new 891dbe4  Format.
891dbe4 is described below

commit 891dbe4cb56fc8373563139c64d18e3487ce7fc3
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Dec 1 14:40:24 2021 -0500

    Format.
---
 .../apache/commons/compress/compressors/XZTestCase.java   | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/test/java/org/apache/commons/compress/compressors/XZTestCase.java b/src/test/java/org/apache/commons/compress/compressors/XZTestCase.java
index 9b31e2a..0c03748 100644
--- a/src/test/java/org/apache/commons/compress/compressors/XZTestCase.java
+++ b/src/test/java/org/apache/commons/compress/compressors/XZTestCase.java
@@ -34,14 +34,13 @@ import org.junit.Test;
 public final class XZTestCase extends AbstractTestCase {
 
     @Test
-    public void testXZCreation()  throws Exception {
+    public void testXZCreation() throws Exception {
         final long max = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax();
-        System.out.println("XZTestCase: HeapMax="+max+" bytes "+(double)max/(1024*1024)+" MB");
+        System.out.println("XZTestCase: HeapMax=" + max + " bytes " + (double) max / (1024 * 1024) + " MB");
         final File input = getFile("test1.xml");
         final File output = new File(dir, "test1.xml.xz");
         try (OutputStream out = Files.newOutputStream(output.toPath())) {
-            try (CompressorOutputStream cos = new CompressorStreamFactory()
-                    .createCompressorOutputStream("xz", out)) {
+            try (CompressorOutputStream cos = new CompressorStreamFactory().createCompressorOutputStream("xz", out)) {
                 Files.copy(input.toPath(), cos);
             }
         }
@@ -52,9 +51,8 @@ public final class XZTestCase extends AbstractTestCase {
         final File input = getFile("bla.tar.xz");
         final File output = new File(dir, "bla.tar");
         try (InputStream is = Files.newInputStream(input.toPath())) {
-            try (CompressorInputStream in = new CompressorStreamFactory()
-                    .createCompressorInputStream("xz", is);
-                    OutputStream out = Files.newOutputStream(output.toPath())) {
+            try (CompressorInputStream in = new CompressorStreamFactory().createCompressorInputStream("xz", is);
+                OutputStream out = Files.newOutputStream(output.toPath())) {
                 IOUtils.copy(in, out);
             }
         }
@@ -64,8 +62,7 @@ public final class XZTestCase extends AbstractTestCase {
     public void testConcatenatedStreamsReadFirstOnly() throws Exception {
         final File input = getFile("multiple.xz");
         try (InputStream is = Files.newInputStream(input.toPath())) {
-            try (CompressorInputStream in = new CompressorStreamFactory()
-                    .createCompressorInputStream("xz", is)) {
+            try (CompressorInputStream in = new CompressorStreamFactory().createCompressorInputStream("xz", is)) {
                 assertEquals('a', in.read());
                 assertEquals(-1, in.read());
             }