@Test public void testBankdroidifyStacktrace() { StackTraceElement[] bankdroidified = new StackTraceElement[] { new StackTraceElement("not.bankdroid.SomeClass", "someMethod", "SomeClass.java", 42), new StackTraceElement("com.liato.bankdroid.SomeOtherClass", "someOtherMethod", "SomeOtherClass.java", 43), }; bankdroidified = ExceptionUtils.bankdroidifyStacktrace(bankdroidified); StackTraceElement[] expected = new StackTraceElement[] { new StackTraceElement("com.liato.bankdroid.SomeOtherClass", "someOtherMethod", "SomeOtherClass.java", 43), }; Assert.assertArrayEquals(expected, bankdroidified); Assert.assertArrayEquals(expected, ExceptionUtils.bankdroidifyStacktrace(bankdroidified)); }
@VisibleForTesting @NonNull static StackTraceElement[] bankdroidifyStacktrace(final StackTraceElement[] rawStack) { for (int i = 0; i < rawStack.length; i++) { StackTraceElement stackTraceElement = rawStack[i]; if (stackTraceElement.getClassName().startsWith(PREFIX)) { return Arrays.copyOfRange(rawStack, i, rawStack.length); } } return new StackTraceElement[0]; }
ExceptionUtils { @VisibleForTesting @NonNull static StackTraceElement[] bankdroidifyStacktrace(final StackTraceElement[] rawStack) { for (int i = 0; i < rawStack.length; i++) { StackTraceElement stackTraceElement = rawStack[i]; if (stackTraceElement.getClassName().startsWith(PREFIX)) { return Arrays.copyOfRange(rawStack, i, rawStack.length); } } return new StackTraceElement[0]; } }
ExceptionUtils { @VisibleForTesting @NonNull static StackTraceElement[] bankdroidifyStacktrace(final StackTraceElement[] rawStack) { for (int i = 0; i < rawStack.length; i++) { StackTraceElement stackTraceElement = rawStack[i]; if (stackTraceElement.getClassName().startsWith(PREFIX)) { return Arrays.copyOfRange(rawStack, i, rawStack.length); } } return new StackTraceElement[0]; }  }
ExceptionUtils { @VisibleForTesting @NonNull static StackTraceElement[] bankdroidifyStacktrace(final StackTraceElement[] rawStack) { for (int i = 0; i < rawStack.length; i++) { StackTraceElement stackTraceElement = rawStack[i]; if (stackTraceElement.getClassName().startsWith(PREFIX)) { return Arrays.copyOfRange(rawStack, i, rawStack.length); } } return new StackTraceElement[0]; }  static void blameBankdroid(Throwable exception); }
ExceptionUtils { @VisibleForTesting @NonNull static StackTraceElement[] bankdroidifyStacktrace(final StackTraceElement[] rawStack) { for (int i = 0; i < rawStack.length; i++) { StackTraceElement stackTraceElement = rawStack[i]; if (stackTraceElement.getClassName().startsWith(PREFIX)) { return Arrays.copyOfRange(rawStack, i, rawStack.length); } } return new StackTraceElement[0]; }  static void blameBankdroid(Throwable exception);  }