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

Commit 930e352d authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Only construct real Throwable objects."

parents 1d6e0df5 020ed6ae
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} */