Skip to content

Commit 138b00d

Browse files
YqwedGerrit Code Review
authored andcommitted
Merge "DO NOT MERGE Handle exceptions of type 'Error' when accessing members through JNI." into android12L-tests-dev
2 parents 2680c88 + 49e1fd6 commit 138b00d

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

tests/signature/lib/android/src/android/signature/cts/DexMemberChecker.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package android.signature.cts;
1818

1919
import android.util.Log;
20-
import java.lang.reflect.Constructor;
20+
2121
import java.lang.reflect.Executable;
2222
import java.lang.reflect.Field;
2323
import java.lang.reflect.InvocationTargetException;
@@ -97,8 +97,7 @@ public static void checkSingleMember(DexMember dexMember, boolean reflection, bo
9797
if (jni) {
9898
try {
9999
observer.fieldAccessibleViaJni(hasMatchingField_JNI(klass, field), field);
100-
} catch (ClassNotFoundException | ExceptionInInitializerError | UnsatisfiedLinkError
101-
| NoClassDefFoundError e) {
100+
} catch (ClassNotFoundException | Error e) {
102101
if ((e instanceof NoClassDefFoundError)
103102
&& !(e.getCause() instanceof ExceptionInInitializerError)
104103
&& !(e.getCause() instanceof UnsatisfiedLinkError)) {
@@ -122,11 +121,8 @@ public static void checkSingleMember(DexMember dexMember, boolean reflection, bo
122121
if (jni) {
123122
try {
124123
observer.methodAccessibleViaJni(hasMatchingMethod_JNI(klass, method), method);
125-
} catch (ExceptionInInitializerError | UnsatisfiedLinkError
126-
| NoClassDefFoundError e) {
127-
if ((e instanceof NoClassDefFoundError)
128-
&& !(e.getCause() instanceof ExceptionInInitializerError)
129-
&& !(e.getCause() instanceof UnsatisfiedLinkError)) {
124+
} catch (Error e) {
125+
if ((e instanceof NoClassDefFoundError) && !(e.getCause() instanceof Error)) {
130126
throw e;
131127
}
132128

0 commit comments

Comments
 (0)