[Swift-commit] r4590 - trunk/src/org/griphyn/vdl/mapping

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Wed Jun 8 21:16:22 CDT 2011


Author: hategan
Date: 2011-06-08 21:16:22 -0500 (Wed, 08 Jun 2011)
New Revision: 4590

Modified:
   trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
Log:
a few improvements to toString()

Modified: trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2011-06-09 02:15:33 UTC (rev 4589)
+++ trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2011-06-09 02:16:22 UTC (rev 4590)
@@ -93,21 +93,27 @@
         sb.append(getDisplayableName());
         Path p = getPathFromRoot();
         if (!p.isEmpty()) {
-            sb.append(".");
+            if (!p.isArrayIndex(0)) {
+                sb.append(".");
+            }
             sb.append(p.toString());
         }
         sb.append(":");
-        sb.append(getType());
-        sb.append(" = ");
-        if (value == null) {
-            sb.append("?");
+        Type type = getType();
+        String strtype = type.toString();
+        if (type.isArray() && closed) {
+            strtype = strtype.replace("[]", "[" + this.getHandles().size() + "]");
         }
-        else if (value instanceof Throwable) {
-            sb.append(value.getClass().getName());
+        sb.append(strtype);
+        if (value != null) {
+            sb.append(" = ");
+            if (value instanceof Throwable) {
+                sb.append(value.getClass().getName());
+            }
+            else {
+                sb.append(value);
+            }
         }
-        else {
-            sb.append(value);
-        }
         if (closed) {
             sb.append(" - Closed");
         }
@@ -256,7 +262,6 @@
             else {
                 handle = createDSHandle(name);
             }
-
         }
         return handle;
     }




More information about the Swift-commit mailing list