8080042: can't build nashorn.jar from jdk9-dev/nashorn using jdk8 installation as JAVA_HOME
authorsundar
Mon, 11 May 2015 22:57:24 +0530
changeset 30512 aa86a08c6625
parent 30412 8ffdeabc7c2b
child 30513 14cefab8350f
8080042: can't build nashorn.jar from jdk9-dev/nashorn using jdk8 installation as JAVA_HOME Reviewed-by: lagergren, jlaskey
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArrayBuffer.java
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat32Array.java
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat64Array.java
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt16Array.java
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt32Array.java
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt8Array.java
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint16Array.java
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint32Array.java
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8Array.java
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArrayBuffer.java	Wed Jul 05 20:32:48 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArrayBuffer.java	Mon May 11 22:57:24 2015 +0530
@@ -28,6 +28,7 @@
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
 
 import java.nio.ByteBuffer;
+
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Constructor;
 import jdk.nashorn.internal.objects.annotations.Function;
@@ -226,10 +227,10 @@
     }
 
     ByteBuffer getBuffer(final int offset) {
-        return nb.duplicate().position(offset);
+        return (ByteBuffer)nb.duplicate().position(offset);
     }
 
     ByteBuffer getBuffer(final int offset, final int length) {
-        return getBuffer(offset).limit(length);
+        return (ByteBuffer)getBuffer(offset).limit(length);
     }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat32Array.java	Wed Jul 05 20:32:48 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat32Array.java	Mon May 11 22:57:24 2015 +0530
@@ -81,7 +81,7 @@
         private static final MethodHandle SET_ELEM = specialCall(MethodHandles.lookup(), Float32ArrayData.class, "setElem", void.class, int.class, double.class).methodHandle();
 
         private Float32ArrayData(final FloatBuffer nb, final int start, final int end) {
-            super(nb.position(start).limit(end).slice(), end - start);
+            super(((FloatBuffer)nb.position(start).limit(end)).slice(), end - start);
         }
 
         @Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat64Array.java	Wed Jul 05 20:32:48 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat64Array.java	Mon May 11 22:57:24 2015 +0530
@@ -81,7 +81,7 @@
         private static final MethodHandle SET_ELEM = specialCall(MethodHandles.lookup(), Float64ArrayData.class, "setElem", void.class, int.class, double.class).methodHandle();
 
         private Float64ArrayData(final DoubleBuffer nb, final int start, final int end) {
-            super(nb.position(start).limit(end).slice(), end - start);
+            super(((DoubleBuffer)nb.position(start).limit(end)).slice(), end - start);
         }
 
         @Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt16Array.java	Wed Jul 05 20:32:48 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt16Array.java	Mon May 11 22:57:24 2015 +0530
@@ -82,7 +82,7 @@
         private static final MethodHandle SET_ELEM = specialCall(MethodHandles.lookup(), Int16ArrayData.class, "setElem", void.class, int.class, int.class).methodHandle();
 
         private Int16ArrayData(final ShortBuffer nb, final int start, final int end) {
-            super(nb.position(start).limit(end).slice(), end - start);
+            super(((ShortBuffer)nb.position(start).limit(end)).slice(), end - start);
         }
 
         @Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt32Array.java	Wed Jul 05 20:32:48 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt32Array.java	Mon May 11 22:57:24 2015 +0530
@@ -81,7 +81,7 @@
         private static final MethodHandle SET_ELEM = specialCall(MethodHandles.lookup(), Int32ArrayData.class, "setElem", void.class, int.class, int.class).methodHandle();
 
         private Int32ArrayData(final IntBuffer nb, final int start, final int end) {
-            super(nb.position(start).limit(end).slice(), end - start);
+            super(((IntBuffer)nb.position(start).limit(end)).slice(), end - start);
         }
 
         @Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt8Array.java	Wed Jul 05 20:32:48 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt8Array.java	Mon May 11 22:57:24 2015 +0530
@@ -80,7 +80,7 @@
         private static final MethodHandle SET_ELEM = specialCall(MethodHandles.lookup(), Int8ArrayData.class, "setElem", void.class, int.class, int.class).methodHandle();
 
         private Int8ArrayData(final ByteBuffer nb, final int start, final int end) {
-            super(nb.position(start).limit(end).slice(), end - start);
+            super(((ByteBuffer)nb.position(start).limit(end)).slice(), end - start);
         }
 
         @Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint16Array.java	Wed Jul 05 20:32:48 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint16Array.java	Mon May 11 22:57:24 2015 +0530
@@ -81,7 +81,7 @@
         private static final MethodHandle SET_ELEM = specialCall(MethodHandles.lookup(), Uint16ArrayData.class, "setElem", void.class, int.class, int.class).methodHandle();
 
         private Uint16ArrayData(final CharBuffer nb, final int start, final int end) {
-            super(nb.position(start).limit(end).slice(), end - start);
+            super(((CharBuffer)nb.position(start).limit(end)).slice(), end - start);
         }
 
         @Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint32Array.java	Wed Jul 05 20:32:48 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint32Array.java	Mon May 11 22:57:24 2015 +0530
@@ -82,7 +82,7 @@
         private static final MethodHandle SET_ELEM = specialCall(MethodHandles.lookup(), Uint32ArrayData.class, "setElem", void.class, int.class, int.class).methodHandle();
 
         private Uint32ArrayData(final IntBuffer nb, final int start, final int end) {
-            super(nb.position(start).limit(end).slice(), end - start);
+            super(((IntBuffer)nb.position(start).limit(end)).slice(), end - start);
         }
 
         @Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8Array.java	Wed Jul 05 20:32:48 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8Array.java	Mon May 11 22:57:24 2015 +0530
@@ -81,7 +81,7 @@
         private static final MethodHandle SET_ELEM = specialCall(MethodHandles.lookup(), Uint8ArrayData.class, "setElem", void.class, int.class, int.class).methodHandle();
 
         private Uint8ArrayData(final ByteBuffer nb, final int start, final int end) {
-            super(nb.position(start).limit(end).slice(), end - start);
+            super(((ByteBuffer)nb.position(start).limit(end)).slice(), end - start);
         }
 
         @Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java	Wed Jul 05 20:32:48 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java	Mon May 11 22:57:24 2015 +0530
@@ -85,7 +85,7 @@
         private static final MethodHandle CLAMP_LONG = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "clampLong", long.class, long.class).methodHandle();
 
         private Uint8ClampedArrayData(final ByteBuffer nb, final int start, final int end) {
-            super(nb.position(start).limit(end).slice(), end - start);
+            super(((ByteBuffer)nb.position(start).limit(end)).slice(), end - start);
         }
 
         @Override