changeset 1385:2e94f4ff263b

7901851: perfasm profiler AIOOBEs on newer JDK 9
author shade
date Thu, 01 Dec 2016 12:23:24 +0100
parents b5cccfc59265
children eba61e9f1d2a
files jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractPerfAsmProfiler.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractPerfAsmProfiler.java	Tue Nov 29 18:46:20 2016 +0100
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractPerfAsmProfiler.java	Thu Dec 01 12:23:24 2016 +0100
@@ -829,7 +829,13 @@
                         HashMap<String, String> map = new HashMap<>();
                         for (String kv : kvs) {
                             String[] pair = kv.split("=");
-                            map.put(pair[0], pair[1]);
+
+                            // Guard against "key=''"
+                            if (pair.length == 2) {
+                                map.put(pair[0], pair[1]);
+                            } else {
+                                map.put(pair[0], null);
+                            }
                         }
 
                         // Record the starting address for the method