what-the-bank/sources/com/google/firebase/crashlytics/internal/stacktrace/MiddleOutFallbackStrategy.java

30 lines
1.5 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.firebase.crashlytics.internal.stacktrace;
/* loaded from: classes2.dex */
public class MiddleOutFallbackStrategy implements StackTraceTrimmingStrategy {
private final int maximumStackSize;
private final MiddleOutStrategy middleOutStrategy;
private final StackTraceTrimmingStrategy[] trimmingStrategies;
public MiddleOutFallbackStrategy(int i, StackTraceTrimmingStrategy... stackTraceTrimmingStrategyArr) {
this.maximumStackSize = i;
this.trimmingStrategies = stackTraceTrimmingStrategyArr;
this.middleOutStrategy = new MiddleOutStrategy(i);
}
@Override // com.google.firebase.crashlytics.internal.stacktrace.StackTraceTrimmingStrategy
public StackTraceElement[] getTrimmedStackTrace(StackTraceElement[] stackTraceElementArr) {
if (stackTraceElementArr.length <= this.maximumStackSize) {
return stackTraceElementArr;
}
StackTraceElement[] stackTraceElementArr2 = stackTraceElementArr;
for (StackTraceTrimmingStrategy stackTraceTrimmingStrategy : this.trimmingStrategies) {
if (stackTraceElementArr2.length <= this.maximumStackSize) {
break;
}
stackTraceElementArr2 = stackTraceTrimmingStrategy.getTrimmedStackTrace(stackTraceElementArr);
}
return stackTraceElementArr2.length > this.maximumStackSize ? this.middleOutStrategy.getTrimmedStackTrace(stackTraceElementArr2) : stackTraceElementArr2;
}
}