package java.lang;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.OutputStreamWriter;
import java.io.OutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
class CPlusPlusDemangler extends OutputStream
{
java.io.OutputStream procOut;
java.io.InputStream procIn;
java.lang.Process proc;
PrintWriter p;
public int written = 0;
CPlusPlusDemangler (PrintWriter writer) throws IOException
{
p = writer;
proc = Runtime.getRuntime ().exec ("c++filt -s java");
procOut = proc.getOutputStream ();
procIn = proc.getInputStream ();
}
public void write (int b) throws IOException
{
procOut.write (b);
while (procIn.available () != 0)
{
int c = procIn.read ();
if (c == -1)
break;
else
{
p.write (c);
written++;
}
}
}
public void close () throws IOException
{
procOut.close ();
int c;
while ((c = procIn.read ()) != -1)
{
p.write (c);
written++;
}
p.flush ();
try
{
proc.waitFor ();
}
catch (InterruptedException _)
{
}
}
}
public class Throwable implements Serializable
{
public native Throwable fillInStackTrace ();
public String getLocalizedMessage ()
{
return getMessage ();
}
public String getMessage ()
{
return detailMessage;
}
public void printStackTrace ()
{
printStackTrace (System.err);
}
public void printStackTrace (PrintStream ps)
{
PrintWriter writer = new PrintWriter (ps);
printStackTrace (writer);
}
public void printStackTrace (PrintWriter wr)
{
try
{
CPlusPlusDemangler cPlusPlusFilter = new CPlusPlusDemangler (wr);
PrintWriter writer = new PrintWriter (cPlusPlusFilter);
printRawStackTrace (writer);
writer.close ();
if (cPlusPlusFilter.written == 0) printRawStackTrace (wr);
}
catch (Exception e1)
{
printRawStackTrace (wr);
}
}
public Throwable ()
{
detailMessage = null;
fillInStackTrace ();
}
public Throwable (String message)
{
detailMessage = message;
fillInStackTrace ();
}
public String toString ()
{
return ((detailMessage == null)
? getClass().getName()
: getClass().getName() + ": " + getMessage ());
}
private native final void printRawStackTrace (PrintWriter wr);
private String detailMessage;
static boolean trace_enabled = true;
private transient byte stackTrace[];
private static final long serialVersionUID = -3042686055658047285L;
}