hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java
changeset 10251 71b8938a2821
parent 5547 f4b087cbb361
child 13728 882756847a04
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java	Wed Jul 20 18:04:17 2011 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java	Thu Jul 21 08:38:25 2011 -0700
@@ -53,6 +53,9 @@
   public boolean isTypeArray()         { return true; }
 
   public byte getByteAt(long index) {
+    if (index < 0 || index >= getLength()) {
+      throw new ArrayIndexOutOfBoundsException(index + " " + getLength());
+    }
     long offset = baseOffsetInBytes(BasicType.T_BYTE) + index * getHeap().getByteSize();
     return getHandle().getJByteAt(offset);
   }