< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -360,15 +360,11 @@
             } else if (dataType == BasicType.getTChar()) {
                 // char[] is returned as a String
                 str = new String(charArrayValue());
             } else if (dataType == BasicType.getTByte()) {
                 // byte[] is returned as a String
-                try {
-                    str = new String(byteArrayValue(), "US-ASCII");
-                } catch (java.io.UnsupportedEncodingException e) {
-                    str = "can't decode string : " + e.getMessage();
-                }
+                str = CStringUtilities.getString(addr.addOffsetTo(dataOffset()));
             } else if (dataType == BasicType.getTShort()) {
                 short[] res = shortArrayValue();
                 StringBuffer buf = new StringBuffer();
                 buf.append('[');
                 for (int i = 0; i < res.length; i++) {
< prev index next >