@@ -1148,7 +1148,7 @@ JNI_ENTRY(ResultType, \
11481148 jni_Call##Result##Method(JNIEnv *env, jobject obj, jmethodID methodID, ...)) \
11491149\
11501150 EntryProbe; \
1151- ResultType ret = 0 ; \
1151+ ResultType ret{}; \
11521152 DT_RETURN_MARK_FOR (Result, Call##Result##Method, ResultType, \
11531153 (const ResultType&)ret);\
11541154\
@@ -1203,7 +1203,7 @@ JNI_ENTRY(ResultType, \
12031203 jni_Call##Result##MethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)) \
12041204\
12051205 EntryProbe;\
1206- ResultType ret = 0 ; \
1206+ ResultType ret{}; \
12071207 DT_RETURN_MARK_FOR (Result, Call##Result##MethodV, ResultType, \
12081208 (const ResultType&)ret);\
12091209\
@@ -1254,7 +1254,7 @@ DEFINE_CALLMETHODV(jdouble, Double, T_DOUBLE
12541254JNI_ENTRY (ResultType, \
12551255 jni_Call##Result##MethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args)) \
12561256 EntryProbe; \
1257- ResultType ret = 0 ; \
1257+ ResultType ret{}; \
12581258 DT_RETURN_MARK_FOR (Result, Call##Result##MethodA, ResultType, \
12591259 (const ResultType&)ret);\
12601260\
@@ -1546,7 +1546,7 @@ JNI_ENTRY(ResultType, \
15461546 jni_CallStatic##Result##Method(JNIEnv *env, jclass cls, jmethodID methodID, ...)) \
15471547\
15481548 EntryProbe; \
1549- ResultType ret = 0 ; \
1549+ ResultType ret{}; \
15501550 DT_RETURN_MARK_FOR (Result, CallStatic##Result##Method, ResultType, \
15511551 (const ResultType&)ret);\
15521552\
@@ -1601,7 +1601,7 @@ JNI_ENTRY(ResultType, \
16011601 jni_CallStatic##Result##MethodV(JNIEnv *env, jclass cls, jmethodID methodID, va_list args)) \
16021602\
16031603 EntryProbe; \
1604- ResultType ret = 0 ; \
1604+ ResultType ret{}; \
16051605 DT_RETURN_MARK_FOR (Result, CallStatic##Result##MethodV, ResultType, \
16061606 (const ResultType&)ret);\
16071607\
@@ -1657,7 +1657,7 @@ JNI_ENTRY(ResultType, \
16571657 jni_CallStatic##Result##MethodA(JNIEnv *env, jclass cls, jmethodID methodID, const jvalue *args)) \
16581658\
16591659 EntryProbe; \
1660- ResultType ret = 0 ; \
1660+ ResultType ret{}; \
16611661 DT_RETURN_MARK_FOR (Result, CallStatic##Result##MethodA, ResultType, \
16621662 (const ResultType&)ret);\
16631663\
@@ -1750,7 +1750,7 @@ DT_RETURN_MARK_DECL(GetFieldID, jfieldID
17501750JNI_ENTRY (jfieldID, jni_GetFieldID(JNIEnv *env, jclass clazz,
17511751 const char *name, const char *sig))
17521752 HOTSPOT_JNI_GETFIELDID_ENTRY (env, clazz, (char *) name, (char *) sig);
1753- jfieldID ret = 0 ;
1753+ jfieldID ret = nullptr ;
17541754 DT_RETURN_MARK (GetFieldID, jfieldID, (const jfieldID&)ret);
17551755
17561756 Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz));
@@ -3035,12 +3035,12 @@ extern "C" void* JNICALL jni_GetDirectBufferAddress(JNIEnv *env, jobject buf)
30353035
30363036 if (!directBufferSupportInitializeEnded) {
30373037 if (!initializeDirectBufferSupport (env, thread)) {
3038- return 0 ;
3038+ return nullptr ;
30393039 }
30403040 }
30413041
30423042 if ((buf != nullptr ) && (!env->IsInstanceOf (buf, directBufferClass))) {
3043- return 0 ;
3043+ return nullptr ;
30443044 }
30453045
30463046 ret = (void *)(intptr_t )env->GetLongField (buf, directBufferAddressField);
@@ -3647,8 +3647,8 @@ static jint JNI_CreateJavaVM_inner(JavaVM **vm, void **penv, void *args) {
36473647 }
36483648
36493649 // Creation failed. We must reset vm_created
3650- *vm = 0 ;
3651- *(JNIEnv**)penv = 0 ;
3650+ *vm = nullptr ;
3651+ *(JNIEnv**)penv = nullptr ;
36523652 // reset vm_created last to avoid race condition. Use OrderAccess to
36533653 // control both compiler and architectural-based reordering.
36543654 assert (vm_created == IN_PROGRESS, " must be" );
0 commit comments