Re: JDK-8217735: Q: Should jint be jboolean ?
Thanks David, that's a good thought, so yes jboolean looks right form that. Cheers Andrew Leonard Java Runtimes Development IBM Hursley IBM United Kingdom Ltd Phone internal: 245913, external: 01962 815913 internet email: andrew_m_leon...@uk.ibm.com From: David Holmes To: Andrew Leonard , core-libs-dev Date: 04/03/2019 12:52 Subject:Re: JDK-8217735: Q: Should jint be jboolean ? On 4/03/2019 9:30 pm, Andrew Leonard wrote: > Hi, > > This bug raised a missmatch between the Java and JNI definition for a > native method, where Java specifies "boolean" and the JNI jint. Which is > right, should they match? > https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.openjdk.java.net_browse_JDK-2D8217735=DwICaQ=jf_iaSHvJObTbx-siA1ZOg=NaV8Iy8Ld-vjpXZFDdTbgGlRTghGHnwM75wUPd5_NUQ=KoeDVOc0vzvP0wizDDykj53gxMU5Zcop2nu4FsOonUQ=H_SBb8AJvNppMzFArFxWqfF-ss0W3le6MVndHorE7qU= Old javah generates jboolean > cat Native.java public class Native { public native boolean isTrue(boolean b); } > cat Native.h /* DO NOT EDIT THIS FILE - it is machine generated */ #include /* Header for class Native */ #ifndef _Included_Native #define _Included_Native #ifdef __cplusplus extern "C" { #endif /* * Class: Native * Method:isTrue * Signature: (Z)Z */ JNIEXPORT jboolean JNICALL Java_Native_isTrue (JNIEnv *, jobject, jboolean); #ifdef __cplusplus } #endif #endif David - > One part of the JVM spec that confuses me a bit is: > 2.3.4 The boolean Type > Although the Java Virtual Machine defines a boolean type, > it only provides very limited support for it. > There are no Java Virtual Machine instructions solely dedicated > to operations on boolean values. Instead, expressions in the Java > programming language that operate on boolean values are > compiled to use values of the Java Virtual Machine int data type. > > Thanks > Andrew > > Andrew Leonard > Java Runtimes Development > IBM Hursley > IBM United Kingdom Ltd > Phone internal: 245913, external: 01962 815913 > internet email: andrew_m_leon...@uk.ibm.com > > Unless stated otherwise above: > IBM United Kingdom Limited - Registered in England and Wales with number > 741598. > Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU > Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
Re: JDK-8217735: Q: Should jint be jboolean ?
On 4/03/2019 9:30 pm, Andrew Leonard wrote: Hi, This bug raised a missmatch between the Java and JNI definition for a native method, where Java specifies "boolean" and the JNI jint. Which is right, should they match? https://bugs.openjdk.java.net/browse/JDK-8217735 Old javah generates jboolean > cat Native.java public class Native { public native boolean isTrue(boolean b); } > cat Native.h /* DO NOT EDIT THIS FILE - it is machine generated */ #include /* Header for class Native */ #ifndef _Included_Native #define _Included_Native #ifdef __cplusplus extern "C" { #endif /* * Class: Native * Method:isTrue * Signature: (Z)Z */ JNIEXPORT jboolean JNICALL Java_Native_isTrue (JNIEnv *, jobject, jboolean); #ifdef __cplusplus } #endif #endif David - One part of the JVM spec that confuses me a bit is: 2.3.4 The boolean Type Although the Java Virtual Machine defines a boolean type, it only provides very limited support for it. There are no Java Virtual Machine instructions solely dedicated to operations on boolean values. Instead, expressions in the Java programming language that operate on boolean values are compiled to use values of the Java Virtual Machine int data type. Thanks Andrew Andrew Leonard Java Runtimes Development IBM Hursley IBM United Kingdom Ltd Phone internal: 245913, external: 01962 815913 internet email: andrew_m_leon...@uk.ibm.com Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
Re: JDK-8217735: Q: Should jint be jboolean ?
On 04/03/2019 11:30, Andrew Leonard wrote: Hi, This bug raised a missmatch between the Java and JNI definition for a native method, where Java specifies "boolean" and the JNI jint. Which is right, should they match? https://bugs.openjdk.java.net/browse/JDK-8217735 It's probably best to bring this to awt-dev to get to the right people that maintain this area. -Alan
JDK-8217735: Q: Should jint be jboolean ?
Hi, This bug raised a missmatch between the Java and JNI definition for a native method, where Java specifies "boolean" and the JNI jint. Which is right, should they match? https://bugs.openjdk.java.net/browse/JDK-8217735 One part of the JVM spec that confuses me a bit is: 2.3.4 The boolean Type Although the Java Virtual Machine defines a boolean type, it only provides very limited support for it. There are no Java Virtual Machine instructions solely dedicated to operations on boolean values. Instead, expressions in the Java programming language that operate on boolean values are compiled to use values of the Java Virtual Machine int data type. Thanks Andrew Andrew Leonard Java Runtimes Development IBM Hursley IBM United Kingdom Ltd Phone internal: 245913, external: 01962 815913 internet email: andrew_m_leon...@uk.ibm.com Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU