1
1
/*
2
- * Copyright (c) 2011, 2018 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2011, 2024 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -83,7 +83,7 @@ static void throwOutOfMemoryError(JNIEnv *env, const char *msg)
83
83
c = exceptionClass;
84
84
} else {
85
85
c = (*env)->FindClass (env, " java/lang/OutOfMemoryError" );
86
- if ((*env)->ExceptionOccurred (env)) return ;
86
+ if ((*env)->ExceptionCheck (env)) return ;
87
87
exceptionClass = (*env)->NewGlobalRef (env, c);
88
88
}
89
89
@@ -211,7 +211,7 @@ static jarray createJavaStringArray(JNIEnv *env, CFIndex count)
211
211
c = stringClass;
212
212
} else {
213
213
c = (*env)->FindClass (env, " java/lang/String" );
214
- if ((*env)->ExceptionOccurred (env)) return NULL ;
214
+ if ((*env)->ExceptionCheck (env)) return NULL ;
215
215
stringClass = (*env)->NewGlobalRef (env, c);
216
216
}
217
217
@@ -892,7 +892,7 @@ static void createTreeForPath(CFStringRef path, CFStringRef name,
892
892
result = NULL ;
893
893
} else {
894
894
CFStringRef cfString = copyToCFString (env, value);
895
- if ((*env)->ExceptionOccurred (env)) {
895
+ if ((*env)->ExceptionCheck (env)) {
896
896
// memory error in copyToCFString
897
897
result = NULL ;
898
898
} else if (cfString == NULL ) {
@@ -940,10 +940,10 @@ static void BuildJavaArrayFn(const void *key, const void *value, void *context)
940
940
CFStringRef cfString = NULL ;
941
941
JNIEnv *env = args->env ;
942
942
943
- if ((*env)->ExceptionOccurred (env)) return ; // already failed
943
+ if ((*env)->ExceptionCheck (env)) return ; // already failed
944
944
945
945
cfString = copyToCFString (env, propkey);
946
- if ((*env)->ExceptionOccurred (env)) {
946
+ if ((*env)->ExceptionCheck (env)) {
947
947
// memory error in copyToCFString
948
948
} else if (!cfString) {
949
949
// bogus value type in prefs file - no Java errors available
@@ -960,9 +960,9 @@ static void BuildJavaArrayFn(const void *key, const void *value, void *context)
960
960
}
961
961
if (CFStringGetLength (cfString) <= 0 ) goto bad; // ignore empty
962
962
javaString = toJavaString (env, cfString);
963
- if ((*env)->ExceptionOccurred (env)) goto bad;
963
+ if ((*env)->ExceptionCheck (env)) goto bad;
964
964
(*env)->SetObjectArrayElement (env, args->result ,args->used ,javaString);
965
- if ((*env)->ExceptionOccurred (env)) goto bad;
965
+ if ((*env)->ExceptionCheck (env)) goto bad;
966
966
args->used ++;
967
967
}
968
968
@@ -1003,7 +1003,7 @@ static jarray getStringsForNode(JNIEnv *env, jobject klass, jobject jpath,
1003
1003
args.used = 0 ;
1004
1004
args.allowSlash = allowSlash;
1005
1005
CFDictionaryApplyFunction (node, BuildJavaArrayFn, &args);
1006
- if (!(*env)->ExceptionOccurred (env)) {
1006
+ if (!(*env)->ExceptionCheck (env)) {
1007
1007
// array construction succeeded
1008
1008
if (args.used < count) {
1009
1009
// finished array is smaller than expected.
0 commit comments