Example usage for java.lang Throwable Throwable

List of usage examples for java.lang Throwable Throwable

Introduction

In this page you can find the example usage for java.lang Throwable Throwable.

Prototype

public Throwable() 

Source Link

Document

Constructs a new throwable with null as its detail message.

Usage

From source file:Main.java

public static void main(String[] argv) {
    Throwable t = new Throwable();

    System.out.println(t.toString());
}

From source file:ja.lingo.application.util.messages.ErrorDumper.java

public static void main(String[] args) {
    dump(new Throwable());
}

From source file:Main.java

public static String getLineInfo() {
    StackTraceElement ste = new Throwable().getStackTrace()[1];
    return ste.getFileName() + ": Line " + ste.getLineNumber();
}

From source file:Main.java

private static String getLogCurrentMsg() {
    StackTraceElement[] elements = new Throwable().getStackTrace();
    return elements[3].getClassName() + " > " + elements[3].getMethodName() + " > "
            + elements[3].getLineNumber();
}

From source file:Main.java

public static void method_end() {
    Throwable t = new Throwable();
    StackTraceElement e = t.getStackTrace()[2];
    Log.d(e.getClassName(), e.getMethodName() + ": end");
}

From source file:Main.java

public static void method_start() {
    Throwable t = new Throwable();
    StackTraceElement e = t.getStackTrace()[2];
    Log.d(e.getClassName(), e.getMethodName() + ": start");
}

From source file:Main.java

public static String getStack() {
    StackTraceElement astacktraceelement[] = (new Throwable()).getStackTrace();
    String s;//from  w  w  w .j ava2  s .c om
    if (astacktraceelement == null || astacktraceelement.length < 2) {
        s = "";
    } else {
        s = "";
        int i = 1;
        while (i < astacktraceelement.length
                && astacktraceelement[i].getClassName().contains("com.tencent.mm")) {
            s = (new StringBuilder()).append(s).append("[")
                    .append(astacktraceelement[i].getClassName().substring(15)).append(":")
                    .append(astacktraceelement[i].getMethodName()).append("]").toString();
            i++;
        }
    }
    return s;
}

From source file:Main.java

public static void Message(String str) {
    Log.d("TAG",/*from  w  w w . ja v a2 s  .  com*/
            "[" + new Throwable().getStackTrace()[0].getFileName() + "]["
                    + new Throwable().getStackTrace()[0].getMethodName() + "]["
                    + new Throwable().getStackTrace()[0].getLineNumber() + "] : " + str);
}

From source file:Main.java

public static void logit(String message) {
    String prefLabel = new Throwable().getStackTrace()[1].toString();
    Log.v("logit", prefLabel + ": " + message);
}

From source file:Main.java

public static void log(Object message) {
    StackTraceElement element = new Throwable().getStackTrace()[1];
    print(element, message, null);
}