8155244: JVMCI: MemoryAccessProvider.readUnsafeConstant javadoc should be updated for null JavaKind case
Reviewed-by: twisti
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java Sat Apr 30 00:57:04 2016 -0700
+++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java Mon May 02 03:20:23 2016 +0300
@@ -146,6 +146,9 @@
@Override
public JavaConstant readUnsafeConstant(JavaKind kind, JavaConstant baseConstant, long displacement) {
+ if (kind == null) {
+ throw new IllegalArgumentException("null JavaKind");
+ }
if (kind == JavaKind.Object) {
Object o = readRawObject(baseConstant, displacement, runtime.getConfig().useCompressedOops);
return HotSpotObjectConstantImpl.forObject(o);
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java Sat Apr 30 00:57:04 2016 -0700
+++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java Mon May 02 03:20:23 2016 +0300
@@ -35,8 +35,8 @@
* @param displacement the displacement within the object in bytes
* @return the read value encapsulated in a {@link JavaConstant} object, or {@code null} if the
* value cannot be read.
- * @throws IllegalArgumentException if {@code kind} is {@link JavaKind#Void} or not
- * {@linkplain JavaKind#isPrimitive() primitive} kind
+ * @throws IllegalArgumentException if {@code kind} is {@code null}, {@link JavaKind#Void} or
+ * not {@linkplain JavaKind#isPrimitive() primitive} kind
*/
JavaConstant readUnsafeConstant(JavaKind kind, JavaConstant base, long displacement) throws IllegalArgumentException;