diff options
author | Sven Gothel <[email protected]> | 2015-03-08 00:06:11 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-08 00:06:11 +0100 |
commit | da909f84dc8421052c92491baa7dd90e1c78dc8f (patch) | |
tree | 60aca793c01b0e56c1628f8ccdac448f96541ad0 /src/java/com/jogamp/gluegen/GlueGenException.java | |
parent | e2d5d6f55794c5e27c3a29dcbbdaf2921506667d (diff) |
Bug 1134 - Use ASTLocationTag in Logging (PCPP, Emitter); Refine ASTLocationTag log/exception formatting.
Since commit eca019cdea4017227e951d8a9eb30cb34fca4a07, we have ASTLocationTag available.
Hence use it for all logging purposes and emit a standard compiler output,
which shall be parsable by other tools.
Diffstat (limited to 'src/java/com/jogamp/gluegen/GlueGenException.java')
-rw-r--r-- | src/java/com/jogamp/gluegen/GlueGenException.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/java/com/jogamp/gluegen/GlueGenException.java b/src/java/com/jogamp/gluegen/GlueGenException.java index e8e06ec..473f99a 100644 --- a/src/java/com/jogamp/gluegen/GlueGenException.java +++ b/src/java/com/jogamp/gluegen/GlueGenException.java @@ -81,18 +81,12 @@ public class GlueGenException extends JogampRuntimeException { } public String toString() { - final StringBuffer buf = new StringBuffer(); + final StringBuilder sb = new StringBuilder(256); if (null != locus) { - buf.append(locus.toString(false)).append(": error: "); - if( null != locus.text && locus.text.length()>0 ) { - buf.append("text '").append(locus.text).append("': "); - } + locus.toString(sb, "error").append(": "); } - buf.append(getLocalizedMessage()); - final String message = buf.toString(); - - final String className = getClass().getSimpleName(); - return null != message ? className + ": " + message : className; + sb.append(getClass().getSimpleName()).append(": ").append(getLocalizedMessage()); + return sb.toString(); } } |