jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template
--- a/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template Fri May 06 06:23:30 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template Mon May 09 12:39:41 2016 +0300
@@ -25,6 +25,7 @@
package java.lang.invoke;
import jdk.internal.misc.Unsafe;
+import jdk.internal.util.Preconditions;
import jdk.internal.vm.annotation.ForceInline;
import java.nio.ByteBuffer;
@@ -78,7 +79,7 @@
@ForceInline
static int index(byte[] ba, int index) {
- return Objects.checkIndex(index, ba.length - ALIGN, null);
+ return Preconditions.checkIndex(index, ba.length - ALIGN, null);
}
@ForceInline
@@ -297,14 +298,14 @@
@ForceInline
static int index(ByteBuffer bb, int index) {
- return Objects.checkIndex(index, UNSAFE.getInt(bb, BUFFER_LIMIT) - ALIGN, null);
+ return Preconditions.checkIndex(index, UNSAFE.getInt(bb, BUFFER_LIMIT) - ALIGN, null);
}
@ForceInline
static int indexRO(ByteBuffer bb, int index) {
if (UNSAFE.getBoolean(bb, BYTE_BUFFER_IS_READ_ONLY))
throw new ReadOnlyBufferException();
- return Objects.checkIndex(index, UNSAFE.getInt(bb, BUFFER_LIMIT) - ALIGN, null);
+ return Preconditions.checkIndex(index, UNSAFE.getInt(bb, BUFFER_LIMIT) - ALIGN, null);
}
@ForceInline