public class

StackTraceDeobfuscator

extends Object
java.lang.Object
   ↳ com.google.gwt.logging.server.StackTraceDeobfuscator

Class Overview

Deobfuscates stack traces on the server side. This class requires that you have turned on emulated stack traces and moved your symbolMap files to a place accessible by your server. More concretely, you must compile with the -extra command line option, copy the symbolMaps directory to somewhere your server side code has access to it, and then set the symbolMapsDirectory in this class through the constructor, or the setter method. For example, this variable could be set to "WEB-INF/classes/symbolMaps/", if you copied the symbolMaps directory to there or compiled your application using -extra war/WEB-INF/classes/. TODO(unnurg): Combine this code with similar code in JUnitHostImpl

Summary

Public Constructors
StackTraceDeobfuscator(String symbolMapsDirectory)
Constructor, which takes a symbolMaps directory as its argument.
Public Methods
LogRecord deobfuscateLogRecord(LogRecord lr, String strongName)
Best effort resymbolization of a log record's stack trace.
StackTraceElement[] deobfuscateStackTrace(StackTraceElement[] st, String strongName)
Convenience method which resymbolizes an entire stack trace to extent possible.
StackTraceElement resymbolize(StackTraceElement ste, String strongName)
Best effort resymbolization of a a single stack trace element.
void setSymbolMapsDirectory(String symbolMapsDirectory)
Protected Methods
InputStream getSymbolMapInputStream(String permutationStrongName)
Retrieves a new InputStream for the given permutation strong name.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public StackTraceDeobfuscator (String symbolMapsDirectory)

Constructor, which takes a symbolMaps directory as its argument. Symbol maps can be generated using the -extra GWT compiler argument.

Parameters
symbolMapsDirectory the symbolMaps directory with, or without trailing directory separator character

Public Methods

public LogRecord deobfuscateLogRecord (LogRecord lr, String strongName)

Best effort resymbolization of a log record's stack trace.

Parameters
lr the log record to resymbolize
strongName the GWT permutation strong name
Returns
  • the best effort resymbolized log record

public StackTraceElement[] deobfuscateStackTrace (StackTraceElement[] st, String strongName)

Convenience method which resymbolizes an entire stack trace to extent possible.

Parameters
st the stack trace to resymbolize
strongName the GWT permutation strong name
Returns
  • a best effort resymbolized stack trace

public StackTraceElement resymbolize (StackTraceElement ste, String strongName)

Best effort resymbolization of a a single stack trace element.

Parameters
ste the stack trace element to resymbolize
strongName the GWT permutation strong name
Returns
  • the best effort resymbolized stack trace element

public void setSymbolMapsDirectory (String symbolMapsDirectory)

Protected Methods

protected InputStream getSymbolMapInputStream (String permutationStrongName)

Retrieves a new InputStream for the given permutation strong name. This implementation, which subclasses may override, returns a InputStream for the <permutation-strong-name>.symbolMap file in the symbolMapsDirectory.

Parameters
permutationStrongName the GWT permutation strong name
Returns
Throws
IOException