7107018: sun.jvm.hotspot.utilities.soql.JSJavaHeap.forEachClass incorrect test
authordsamersoff
Wed, 09 Nov 2016 09:30:27 +0300
changeset 42547 815cfbe4878b
parent 42546 e8389f5c926e
child 42548 5ba95648287f
child 42549 154099b110df
7107018: sun.jvm.hotspot.utilities.soql.JSJavaHeap.forEachClass incorrect test Summary: Correction for incorrect double checking of ‘k’ not being null. Reviewed-by: dsamersoff, rehn Contributed-by: jini.george@oracle.com
hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java	Mon Nov 07 17:02:46 2016 +0100
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java	Wed Nov 09 09:30:27 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, 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
@@ -177,14 +177,14 @@
                         JSJavaObject k = jk.getJSJavaClass();
                         JSJavaObject l = factory.newJSJavaObject(loader);
                         if (k != null) {
-                         if (k != null) {
-                       try {
-                               finalFunc.call(new Object[] { k, l });
-                       } catch (ScriptException exp) {
-                         throw new RuntimeException(exp);
+                          if (l != null) {
+                            try {
+                              finalFunc.call(new Object[] { k, l });
+                            } catch (ScriptException exp) {
+                              throw new RuntimeException(exp);
+                            }
+                          }
                        }
-                           }
-                        }
                     }
                 });