diff options
author | Michael Bien <[email protected]> | 2010-03-22 17:19:17 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-03-22 17:19:17 +0100 |
commit | ebb79dfb8ab9752c6ce92ca1af6c430d22bc069c (patch) | |
tree | be16ba927e92c3ef3e0326d397b38629dcd3413f /src/java/com/sun | |
parent | 58d9dd488cbd7eee530031ef9ea523037be175cd (diff) |
fixed regression in constant emission where a type suffix (e.g. 'f') was illegally added after a closing bracket.
added testcase.
Diffstat (limited to 'src/java/com/sun')
-rw-r--r-- | src/java/com/sun/gluegen/ConstantDefinition.java | 8 | ||||
-rw-r--r-- | src/java/com/sun/gluegen/JavaEmitter.java | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/java/com/sun/gluegen/ConstantDefinition.java b/src/java/com/sun/gluegen/ConstantDefinition.java index e4cb3f5..eee5781 100644 --- a/src/java/com/sun/gluegen/ConstantDefinition.java +++ b/src/java/com/sun/gluegen/ConstantDefinition.java @@ -121,4 +121,12 @@ public class ConstantDefinition { } aliases.add(alias); } + + @Override + public String toString() { + return "ConstantDefinition [name " + name + " origName " + origName + " value " + value + + " aliasedNames " + aliasedNames + " aliases " + aliases + + " enumName " + enumName + " isEnum " + isEnum + "]"; + } + } diff --git a/src/java/com/sun/gluegen/JavaEmitter.java b/src/java/com/sun/gluegen/JavaEmitter.java index f6660d2..df98839 100644 --- a/src/java/com/sun/gluegen/JavaEmitter.java +++ b/src/java/com/sun/gluegen/JavaEmitter.java @@ -357,10 +357,12 @@ public class JavaEmitter implements GlueEmitter { javaWriter().println(" /** " + optionalComment + " */"); } String suffix = ""; - if (type.equals("float") && !value.endsWith("f")) { - suffix = "f"; - }else if(value.endsWith("u") || value.endsWith("U")) { - value = value.substring(0, value.length()-1); + if(!value.endsWith(")")) { + if (type.equals("float") && !value.endsWith("f")) { + suffix = "f"; + }else if(value.endsWith("u") || value.endsWith("U")) { + value = value.substring(0, value.length()-1); + } } javaWriter().println(" public static final " + type + " " + name + " = " + value + suffix + ";"); |