Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08685337 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Only construct real Throwable objects." into oc-dev

parents 44141092 8e151bf8
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -52,10 +52,12 @@ public final class ParcelableException extends RuntimeException implements Parce
        final String msg = in.readString();
        try {
            final Class<?> clazz = Class.forName(name, true, Parcelable.class.getClassLoader());
            if (Throwable.class.isAssignableFrom(clazz)) {
                return (Throwable) clazz.getConstructor(String.class).newInstance(msg);
            }
        } catch (ReflectiveOperationException e) {
            throw new RuntimeException(name + ": " + msg);
        }
        return new RuntimeException(name + ": " + msg);
    }

    /** {@hide} */