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

Commit 3de47967 authored by Kurt Nelson's avatar Kurt Nelson
Browse files

Don't store class in InstanceCountViolation

As InstanceCountViolation is a Throwable, it can be serialized. The
Class is only used for toString, so we just store the class name
instead.

Test: compiles
Change-Id: If3acf151e7b1fa90fbb2d3aab90a102dc0b030e8
parent 28e49b7e
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -2568,9 +2568,8 @@ public final class StrictMode {
    // now we suppress the stack trace because it's useless and/or
    // misleading.
    private static class InstanceCountViolation extends Throwable {
        final Class mClass;
        final long mInstances;
        final int mLimit;
        private final long mInstances;
        private final int mLimit;

        private static final StackTraceElement[] FAKE_STACK = {
            new StackTraceElement(
@@ -2580,7 +2579,6 @@ public final class StrictMode {
        public InstanceCountViolation(Class klass, long instances, int limit) {
            super(klass.toString() + "; instances=" + instances + "; limit=" + limit);
            setStackTrace(FAKE_STACK);
            mClass = klass;
            mInstances = instances;
            mLimit = limit;
        }