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

mboehm7 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git

commit c3f13c82fd0898fd46d7951be7d1f5f1726f8e1e
Author: Matthias Boehm <mboe...@gmail.com>
AuthorDate: Thu Apr 18 14:55:40 2024 +0200

    [MINOR] Cleanup code quality issues (imports, other warnings)
---
 .../apache/sysds/runtime/matrix/data/LibMatrixDNN.java  |  1 -
 .../org/apache/sysds/runtime/util/CommonThreadPool.java |  2 --
 .../org/apache/sysds/runtime/util/LocalFileUtils.java   | 17 ++++++-----------
 .../java/org/apache/sysds/test/AutomatedTestBase.java   |  3 ---
 4 files changed, 6 insertions(+), 17 deletions(-)

diff --git 
a/src/main/java/org/apache/sysds/runtime/matrix/data/LibMatrixDNN.java 
b/src/main/java/org/apache/sysds/runtime/matrix/data/LibMatrixDNN.java
index 540bebde8b..050c83776f 100644
--- a/src/main/java/org/apache/sysds/runtime/matrix/data/LibMatrixDNN.java
+++ b/src/main/java/org/apache/sysds/runtime/matrix/data/LibMatrixDNN.java
@@ -20,7 +20,6 @@ package org.apache.sysds.runtime.matrix.data;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
diff --git a/src/main/java/org/apache/sysds/runtime/util/CommonThreadPool.java 
b/src/main/java/org/apache/sysds/runtime/util/CommonThreadPool.java
index 0ffc91f550..a3af05fd6d 100644
--- a/src/main/java/org/apache/sysds/runtime/util/CommonThreadPool.java
+++ b/src/main/java/org/apache/sysds/runtime/util/CommonThreadPool.java
@@ -37,8 +37,6 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.sysds.runtime.DMLRuntimeException;
 import 
org.apache.sysds.runtime.controlprogram.parfor.stat.InfrastructureAnalyzer;
 
-import scala.NotImplementedError;
-
 /**
  * This common thread pool provides an abstraction to obtain a shared thread 
pool.
  * 
diff --git a/src/main/java/org/apache/sysds/runtime/util/LocalFileUtils.java 
b/src/main/java/org/apache/sysds/runtime/util/LocalFileUtils.java
index 2b4f56f3e9..c7e2f4b040 100644
--- a/src/main/java/org/apache/sysds/runtime/util/LocalFileUtils.java
+++ b/src/main/java/org/apache/sysds/runtime/util/LocalFileUtils.java
@@ -234,23 +234,18 @@ public class LocalFileUtils
         * @throws IOException if IOException occurs
         */
        public static void writeWritableToLocal(String fname, Writable mb, 
boolean doubleBuffering) throws IOException {
-               final FastBufferedDataOutputStream out = //
-                       new FastBufferedDataOutputStream(getOut(fname, 
doubleBuffering), BUFFER_SIZE);
+               OutputStream fout = doubleBuffering ?
+                       new DoubleBufferingOutputStream(new 
FileOutputStream(fname), 2, BUFFER_SIZE) :
+                       new FileOutputStream(fname);
+               FastBufferedDataOutputStream dout = new 
FastBufferedDataOutputStream(fout, BUFFER_SIZE);
                try {
-                       mb.write(out);
+                       mb.write(dout);
                }
                finally {
-                       IOUtilFunctions.closeSilently(out);
+                       IOUtilFunctions.closeSilently(dout);
                }
        }
 
-       private static OutputStream getOut(String fname, boolean 
doubleBuffering) throws IOException{
-               if(doubleBuffering)
-                       return new DoubleBufferingOutputStream(new 
FileOutputStream(fname), 2, BUFFER_SIZE);
-               else
-                       return new FileOutputStream(fname);
-       }
-
        public static void writeByteArrayToLocal( String fname, byte[] data )
                throws IOException
        {       
diff --git a/src/test/java/org/apache/sysds/test/AutomatedTestBase.java 
b/src/test/java/org/apache/sysds/test/AutomatedTestBase.java
index 1ee4df4628..30118ce7ca 100644
--- a/src/test/java/org/apache/sysds/test/AutomatedTestBase.java
+++ b/src/test/java/org/apache/sysds/test/AutomatedTestBase.java
@@ -37,9 +37,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
 import org.apache.commons.io.FileUtils;

Reply via email to