Java Code Examples for com.alibaba.dubbo.common.io.UnsafeStringWriter

The following examples show how to use com.alibaba.dubbo.common.io.UnsafeStringWriter. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: dubbo-2.6.5   Source File: StringUtils.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @param e
 * @return string
 */
public static String toString(Throwable e) {
    UnsafeStringWriter w = new UnsafeStringWriter();
    PrintWriter p = new PrintWriter(w);
    p.print(e.getClass().getName());
    if (e.getMessage() != null) {
        p.print(": " + e.getMessage());
    }
    p.println();
    try {
        e.printStackTrace(p);
        return w.toString();
    } finally {
        p.close();
    }
}
 
Example 2
Source Project: dubbox   Source File: StringUtils.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param e
 * @return string
 */
public static String toString(Throwable e) {
	UnsafeStringWriter w = new UnsafeStringWriter();
    PrintWriter p = new PrintWriter(w);
    p.print(e.getClass().getName());
    if (e.getMessage() != null) {
        p.print(": " + e.getMessage());
    }
    p.println();
    try {
        e.printStackTrace(p);
        return w.toString();
    } finally {
        p.close();
    }
}
 
Example 3
Source Project: dubbox-hystrix   Source File: StringUtils.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param e
 * @return string
 */
public static String toString(Throwable e) {
	UnsafeStringWriter w = new UnsafeStringWriter();
    PrintWriter p = new PrintWriter(w);
    p.print(e.getClass().getName());
    if (e.getMessage() != null) {
        p.print(": " + e.getMessage());
    }
    p.println();
    try {
        e.printStackTrace(p);
        return w.toString();
    } finally {
        p.close();
    }
}
 
Example 4
Source Project: dubbo3   Source File: StringUtils.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @param e
 * @return string
 */
public static String toString(Throwable e) {
    UnsafeStringWriter w = new UnsafeStringWriter();
    PrintWriter p = new PrintWriter(w);
    p.print(e.getClass().getName());
    if (e.getMessage() != null) {
        p.print(": " + e.getMessage());
    }
    p.println();
    try {
        e.printStackTrace(p);
        return w.toString();
    } finally {
        p.close();
    }
}
 
Example 5
Source Project: dubbox   Source File: StringUtils.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param e
 * @return string
 */
public static String toString(Throwable e) {
	UnsafeStringWriter w = new UnsafeStringWriter();
    PrintWriter p = new PrintWriter(w);
    p.print(e.getClass().getName());
    if (e.getMessage() != null) {
        p.print(": " + e.getMessage());
    }
    p.println();
    try {
        e.printStackTrace(p);
        return w.toString();
    } finally {
        p.close();
    }
}
 
Example 6
Source Project: dubbox   Source File: StringUtils.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param e
 * @return string
 */
public static String toString(Throwable e) {
	UnsafeStringWriter w = new UnsafeStringWriter();
    PrintWriter p = new PrintWriter(w);
    p.print(e.getClass().getName());
    if (e.getMessage() != null) {
        p.print(": " + e.getMessage());
    }
    p.println();
    try {
        e.printStackTrace(p);
        return w.toString();
    } finally {
        p.close();
    }
}
 
Example 7
Source Project: dubbo-2.6.5   Source File: StringUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * @param msg
 * @param e
 * @return string
 */
public static String toString(String msg, Throwable e) {
    UnsafeStringWriter w = new UnsafeStringWriter();
    w.write(msg + "\n");
    PrintWriter p = new PrintWriter(w);
    try {
        e.printStackTrace(p);
        return w.toString();
    } finally {
        p.close();
    }
}
 
Example 8
Source Project: dubbox   Source File: StringUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @param msg
 * @param e
 * @return string
 */
public static String toString(String msg, Throwable e) {
	UnsafeStringWriter w = new UnsafeStringWriter();
    w.write(msg + "\n");
    PrintWriter p = new PrintWriter(w);
    try {
        e.printStackTrace(p);
        return w.toString();
    } finally {
        p.close();
    }
}
 
Example 9
Source Project: dubbox-hystrix   Source File: StringUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @param msg
 * @param e
 * @return string
 */
public static String toString(String msg, Throwable e) {
	UnsafeStringWriter w = new UnsafeStringWriter();
    w.write(msg + "\n");
    PrintWriter p = new PrintWriter(w);
    try {
        e.printStackTrace(p);
        return w.toString();
    } finally {
        p.close();
    }
}
 
Example 10
Source Project: dubbo3   Source File: StringUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * @param msg
 * @param e
 * @return string
 */
public static String toString(String msg, Throwable e) {
    UnsafeStringWriter w = new UnsafeStringWriter();
    w.write(msg + "\n");
    try (PrintWriter p = new PrintWriter(w)) {
        e.printStackTrace(p);
        return w.toString();
    }
}
 
Example 11
Source Project: dubbox   Source File: StringUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @param msg
 * @param e
 * @return string
 */
public static String toString(String msg, Throwable e) {
	UnsafeStringWriter w = new UnsafeStringWriter();
    w.write(msg + "\n");
    PrintWriter p = new PrintWriter(w);
    try {
        e.printStackTrace(p);
        return w.toString();
    } finally {
        p.close();
    }
}
 
Example 12
Source Project: dubbox   Source File: StringUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @param msg
 * @param e
 * @return string
 */
public static String toString(String msg, Throwable e) {
	UnsafeStringWriter w = new UnsafeStringWriter();
    w.write(msg + "\n");
    PrintWriter p = new PrintWriter(w);
    try {
        e.printStackTrace(p);
        return w.toString();
    } finally {
        p.close();
    }
}