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
--- 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);
+ }
+ }
}
- }
- }
}
});