Simplification

This commit is contained in:
M66B
2023-12-14 18:35:04 +01:00
parent 2810115d2f
commit d47e5ec10c
2 changed files with 3 additions and 12 deletions

View File

@@ -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