Commit c05f028f authored by Mark Evenson's avatar Mark Evenson Committed by GitHub

Merge pull request #150 from easye/easye/20200310c

Correctly find methods for fixnums losslessly narrowed to byte
parents 1b838b7d 5e2eb9dd
......@@ -1122,8 +1122,8 @@ public final class Java
return true;
}
if (Byte.class.equals(to)
&& Byte.MAX_VALUE >= v
&& v >= Byte.MIN_VALUE) {
&& 255 >= v
&& v >= 0) {
return true;
}
// Java 8 introduces BigInteger.longValueExact() which will make the following much easier
......
......@@ -54,11 +54,11 @@
(prove:plan 1)
(prove:is
(handler-case
(let ((buffer (jstatic-raw "allocate" "java.nio.ByteBuffer" 1024))
(let ((buffer (jstatic-raw "allocate" "java.nio.ByteBuffer" 1))
(value #xf0)) ;; a "byte" between 127 and 255
(jcall "put" buffer value)
(= value
(jcall "get" buffer)))
(+ 256 (jcall "get" buffer 0))))
(error (e)
nil))
t
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment