changeset 1231:3387560164f9

7901434: Utils.tryWith ignores the negative error code
author shade
date Tue, 26 May 2015 08:49:12 +0300
parents 10560d7513f4
children 1de24c774498
files jmh-core/src/main/java/org/openjdk/jmh/util/Utils.java
diffstat 1 files changed, 3 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/util/Utils.java	Fri May 22 13:41:28 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/util/Utils.java	Tue May 26 08:49:12 2015 +0300
@@ -26,12 +26,7 @@
 
 import sun.misc.Unsafe;
 
-import java.io.ByteArrayOutputStream;
-import java.io.Console;
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
+import java.io.*;
 import java.lang.management.ManagementFactory;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
@@ -39,11 +34,7 @@
 import java.nio.charset.Charset;
 import java.nio.charset.IllegalCharsetNameException;
 import java.nio.charset.UnsupportedCharsetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
@@ -337,7 +328,7 @@
             errDrainer.join();
             outDrainer.join();
 
-            if (err > 0) {
+            if (err != 0) {
                 messages.add(baos.toString());
             }
         } catch (IOException ex) {