changeset 5793:6c80d73cf81a

added prefix to formatted object Constants to denote the type of the constant
author Doug Simon <doug.simon@oracle.com>
date Mon, 09 Jul 2012 22:09:36 +0200
parents fa6ed51ac198
children af9ad0e0452d
files graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java	Mon Jul 09 16:44:03 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java	Mon Jul 09 22:09:36 2012 +0200
@@ -264,16 +264,16 @@
                 if (value instanceof String) {
                     String s = (String) value;
                     if (s.length() > 50) {
-                        return "\"" + s.substring(0, 30) + "...\"";
+                        return "String:\"" + s.substring(0, 30) + "...\"";
                     } else {
-                        return " \"" + s + '"';
+                        return "String:\"" + s + '"';
                     }
                 } else if (value instanceof JavaType) {
-                    return "class " + MetaUtil.toJavaName((JavaType) value);
-                } else if (value instanceof Enum || value instanceof FormatWithToString) {
-                    return String.valueOf(value);
+                    return "JavaType:" + MetaUtil.toJavaName((JavaType) value);
+                } else if (value instanceof Enum || value instanceof FormatWithToString || value instanceof Number) {
+                    return MetaUtil.getSimpleName(value.getClass(), true) + ":" + String.valueOf(value);
                 } else if (value instanceof Class< ? >) {
-                    return ((Class< ? >) value).getName() + ".class";
+                    return "Class:" + ((Class< ? >) value).getName();
                 } else if (value.getClass().isArray()) {
                     return formatArray(value);
                 } else {