diff options
Diffstat (limited to 'src/java/com/jogamp')
-rw-r--r-- | src/java/com/jogamp/gluegen/ASTLocusTag.java | 13 | ||||
-rw-r--r-- | src/java/com/jogamp/gluegen/GlueGenException.java | 5 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/java/com/jogamp/gluegen/ASTLocusTag.java b/src/java/com/jogamp/gluegen/ASTLocusTag.java index ba38276..babe3df 100644 --- a/src/java/com/jogamp/gluegen/ASTLocusTag.java +++ b/src/java/com/jogamp/gluegen/ASTLocusTag.java @@ -48,18 +48,23 @@ public class ASTLocusTag { } public String toString() { + return toString(true); + } + public String toString(final boolean includeText) { final StringBuffer buf = new StringBuffer(); if (source != null) { - buf.append(source).append(": "); + buf.append(source).append(":"); } if (line != -1) { - buf.append("line ").append(line); + buf.append(line); if (column != -1) { buf.append(":" + column); } - buf.append(": "); } - if( null != text && text.length()>0 ) { + if( includeText && null != text && text.length()>0 ) { + if( buf.length() > 0 ) { + buf.append(": "); + } buf.append("text '").append(text).append("'"); } return buf.toString(); diff --git a/src/java/com/jogamp/gluegen/GlueGenException.java b/src/java/com/jogamp/gluegen/GlueGenException.java index 3c52104..e8e06ec 100644 --- a/src/java/com/jogamp/gluegen/GlueGenException.java +++ b/src/java/com/jogamp/gluegen/GlueGenException.java @@ -83,7 +83,10 @@ public class GlueGenException extends JogampRuntimeException { public String toString() { final StringBuffer buf = new StringBuffer(); if (null != locus) { - buf.append(locus).append(": "); + buf.append(locus.toString(false)).append(": error: "); + if( null != locus.text && locus.text.length()>0 ) { + buf.append("text '").append(locus.text).append("': "); + } } buf.append(getLocalizedMessage()); final String message = buf.toString(); |