summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-09 02:10:29 +0100
committerSven Gothel <[email protected]>2015-03-09 02:10:29 +0100
commit3b7871515f9a6a3c7adcbf12772d168e61f86d50 (patch)
tree99fd6118d20fd002e144bd756157b3421ae4b1ef /src/java/com/jogamp/gluegen
parent457355003bff320eee831731de016d29fb1e3982 (diff)
Bug 1134 - Make ASTLocusTag's text optional
Diffstat (limited to 'src/java/com/jogamp/gluegen')
-rw-r--r--src/java/com/jogamp/gluegen/ASTLocusTag.java10
-rw-r--r--src/java/com/jogamp/gluegen/GlueGenException.java2
-rw-r--r--src/java/com/jogamp/gluegen/Logging.java10
3 files changed, 15 insertions, 7 deletions
diff --git a/src/java/com/jogamp/gluegen/ASTLocusTag.java b/src/java/com/jogamp/gluegen/ASTLocusTag.java
index 1e0349d..aea7699 100644
--- a/src/java/com/jogamp/gluegen/ASTLocusTag.java
+++ b/src/java/com/jogamp/gluegen/ASTLocusTag.java
@@ -48,9 +48,9 @@ public class ASTLocusTag {
}
public String toString() {
- return toString(new StringBuilder(), null).toString();
+ return toString(new StringBuilder(), null, true).toString();
}
- public StringBuilder toString(final StringBuilder sb, final String level) {
+ public StringBuilder toString(final StringBuilder sb, final String level, final boolean inclText) {
boolean preCol = false;
if (source != null) {
sb.append(source);
@@ -75,11 +75,13 @@ public class ASTLocusTag {
sb.append(level);
preCol = true;
}
- if( null != text && text.length()>0 ) {
+ if( inclText && null != text && text.length()>0 ) {
if( preCol ) {
sb.append(": ");
+ } else {
+ sb.append("text ");
}
- sb.append("text '").append(text).append("'");
+ sb.append("'").append(text).append("'");
}
return sb;
}
diff --git a/src/java/com/jogamp/gluegen/GlueGenException.java b/src/java/com/jogamp/gluegen/GlueGenException.java
index 473f99a..b6713e1 100644
--- a/src/java/com/jogamp/gluegen/GlueGenException.java
+++ b/src/java/com/jogamp/gluegen/GlueGenException.java
@@ -83,7 +83,7 @@ public class GlueGenException extends JogampRuntimeException {
public String toString() {
final StringBuilder sb = new StringBuilder(256);
if (null != locus) {
- locus.toString(sb, "error").append(": ");
+ locus.toString(sb, "error", true).append(": ");
}
sb.append(getClass().getSimpleName()).append(": ").append(getLocalizedMessage());
return sb.toString();
diff --git a/src/java/com/jogamp/gluegen/Logging.java b/src/java/com/jogamp/gluegen/Logging.java
index f57c485..7000406 100644
--- a/src/java/com/jogamp/gluegen/Logging.java
+++ b/src/java/com/jogamp/gluegen/Logging.java
@@ -41,6 +41,7 @@ import java.util.logging.LogRecord;
import java.util.logging.Logger;
import com.jogamp.common.util.PropertyAccess;
+import com.jogamp.gluegen.cgram.types.AliasedSymbol;
import com.jogamp.gluegen.cgram.types.Type;
/**
@@ -234,14 +235,19 @@ public class Logging {
params[i] = ((Type)o).getDebugString();
} else if( o instanceof JavaType ) {
params[i] = ((JavaType)o).getDebugString();
+ } else if( o instanceof AliasedSymbol ) {
+ params[i] = ((AliasedSymbol)o).getAliasedString();
}
}
}
final StringBuilder sb = new StringBuilder(256);
if( null != astLocus ) {
- astLocus.toString(sb, getCanonicalName(record.getLevel())).append(": ");
+ astLocus.toString(sb, getCanonicalName(record.getLevel()), GlueGen.debug()).append(": ");
}
- sb.append(simpleClassName).append(": ").append(formatMessage(record)).append("\n");
+ if( GlueGen.debug() ) {
+ sb.append(simpleClassName).append(": ");
+ }
+ sb.append(formatMessage(record)).append("\n");
return sb.toString();
}
}