mirror of https://github.com/M66B/FairEmail.git
Simplification
This commit is contained in:
parent
2810115d2f
commit
d47e5ec10c
|
@ -35,8 +35,6 @@ public class ThrowableWrapper extends Throwable {
|
|||
|
||||
public static native String jni_get_safe_message(Throwable ex);
|
||||
|
||||
public static native String jni_to_safe_string(Throwable ex);
|
||||
|
||||
public static native String jni_get_safe_stack_trace_string(Throwable ex);
|
||||
|
||||
static {
|
||||
|
@ -73,7 +71,9 @@ public class ThrowableWrapper extends Throwable {
|
|||
}
|
||||
|
||||
public String toSafeString() {
|
||||
return jni_to_safe_string(ex);
|
||||
String name = ex.getClass().getName();
|
||||
String message = getSafeMessage();
|
||||
return (message == null ? name : (name + ": " + message));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
|
@ -32,15 +32,6 @@ Java_eu_faircode_email_ThrowableWrapper_jni_1get_1safe_1message(
|
|||
return (jstring) env->CallObjectMethod(ex, mid);
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_eu_faircode_email_ThrowableWrapper_jni_1to_1safe_1string(
|
||||
JNIEnv *env, jclass clazz, jthrowable ex) {
|
||||
jclass cls = env->FindClass("java/lang/Throwable");
|
||||
jmethodID mid = env->GetMethodID(cls, "toString", "()Ljava/lang/String;");
|
||||
return (jstring) env->CallObjectMethod(ex, mid);
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_eu_faircode_email_ThrowableWrapper_jni_1get_1safe_1stack_1trace_1string(
|
||||
|
|
Loading…
Reference in New Issue