Example usage for com.google.gwt.core.server StackTraceDeobfuscator resymbolize

List of usage examples for com.google.gwt.core.server StackTraceDeobfuscator resymbolize

Introduction

In this page you can find the example usage for com.google.gwt.core.server StackTraceDeobfuscator resymbolize.

Prototype

public final StackTraceElement resymbolize(StackTraceElement ste, String strongName) 

Source Link

Document

Best effort resymbolization of a single stack trace element.

Usage

From source file:com.allen_sauer.gwt.log.server.RemoteLoggerServlet.java

License:Apache License

private void deobfuscate(WrappedClientThrowable wrappedClientThrowable) {
    if (wrappedClientThrowable == null) {
        // no throwable to deobfuscate
        return;/*from   w w w  . jav  a 2  s  .c  o  m*/
    }

    // recursive
    deobfuscate(wrappedClientThrowable.getCause());

    String permutationStrongName = getPermutationStrongName();
    if ("HostedMode".equals(permutationStrongName)) {
        // For Development Mode
        return;
    }

    StackTraceElement[] originalStackTrace = wrappedClientThrowable.getClientStackTrace();
    StackTraceElement[] deobfuscatedStackTrace = originalStackTrace;
    for (StackTraceDeobfuscator deobf : deobfuscatorList) {
        deobfuscatedStackTrace = deobf.resymbolize(deobfuscatedStackTrace, permutationStrongName);
    }

    // Verify each permutation once that a symbolMap is available
    if (permutationStrongNamesChecked.add(permutationStrongName)) {
        if (equal(originalStackTrace, deobfuscatedStackTrace)) {
            Log.warn("Failed to deobfuscate stack trace for permutation " + permutationStrongName
                    + ". Verify that the corresponding symbolMap is available.");
        }
    }

    wrappedClientThrowable.setClientStackTrace(deobfuscatedStackTrace);
}