8130527: Serviceability tests fails with Can't attach to process
authorakulyakh
Thu, 30 Jul 2015 12:41:39 +0300
changeset 32071 90ad2be7c11c
parent 32070 8f5a14b884e2
child 32073 93ee8f24e0a6
child 32075 a94d2d18e04b
8130527: Serviceability tests fails with Can't attach to process Summary: A helper method changed to provide workaround for 8132539 Reviewed-by: jbachorik
hotspot/test/testlibrary/jdk/test/lib/Utils.java
--- a/hotspot/test/testlibrary/jdk/test/lib/Utils.java	Wed Jul 29 22:59:03 2015 -0400
+++ b/hotspot/test/testlibrary/jdk/test/lib/Utils.java	Thu Jul 30 12:41:39 2015 +0300
@@ -314,9 +314,8 @@
      */
     public static String fileAsString(String filename) throws IOException {
         Path filePath = Paths.get(filename);
-        return Files.exists(filePath)
-            ? Files.lines(filePath).collect(Collectors.joining(NEW_LINE))
-            : null;
+        if (!Files.exists(filePath)) return null;
+        return new String(Files.readAllBytes(filePath));
     }
 
     /**