diff --git a/runtime/oti/UnsafeAPI.hpp b/runtime/oti/UnsafeAPI.hpp index 3fd7a076ae1..02c825ba1e6 100644 --- a/runtime/oti/UnsafeAPI.hpp +++ b/runtime/oti/UnsafeAPI.hpp @@ -421,7 +421,7 @@ class VM_UnsafeAPI static VMINLINE void putBoolean(J9VMThread *currentThread, MM_ObjectAccessBarrierAPI *objectAccessBarrier, j9object_t object, UDATA offset, bool isVolatile, U_8 value) { - put32(currentThread, objectAccessBarrier, object, offset, isVolatile, 0, false, (I_32)(value & 1)); + put32(currentThread, objectAccessBarrier, object, offset, isVolatile, 0, false, (I_32)(0 != value)); } static VMINLINE I_16 diff --git a/runtime/oti/VMHelpers.hpp b/runtime/oti/VMHelpers.hpp index cc15e083e8e..15c842c1e26 100644 --- a/runtime/oti/VMHelpers.hpp +++ b/runtime/oti/VMHelpers.hpp @@ -1389,7 +1389,7 @@ class VM_VMHelpers } break; case J9NtcBoolean: - *returnStorage = ((UDATA)(U_8)*returnStorage) & 1; + *returnStorage = ((UDATA)(U_8)(0 != *returnStorage)); break; case J9NtcByte: *returnStorage = (UDATA)(IDATA)(I_8)*returnStorage; diff --git a/runtime/vm/jnicsup.cpp b/runtime/vm/jnicsup.cpp index da458a0104a..9b66a161711 100644 --- a/runtime/vm/jnicsup.cpp +++ b/runtime/vm/jnicsup.cpp @@ -373,7 +373,7 @@ JNICALL throwNew(JNIEnv *env, jclass clazz, const char *message) static void JNICALL setStaticBooleanField(JNIEnv *env, jclass cls, jfieldID fieldID, jboolean value) { - setStaticIntField(env, cls, fieldID, (jint)(value != 0)); + setStaticIntField(env, cls, fieldID, (jint)(value & 1)); }