jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1003031 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodePropBundle.java
Date Thu, 30 Sep 2010 12:15:42 GMT
Author: jukka
Date: Thu Sep 30 12:15:42 2010
New Revision: 1003031

URL: http://svn.apache.org/viewvc?rev=1003031&view=rev
Log:
JCR-2762: Optimize bundle serialization

Add toString() methods to bundle classes to help determine the cause of the Hudson test failures

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodePropBundle.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodePropBundle.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodePropBundle.java?rev=1003031&r1=1003030&r2=1003031&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodePropBundle.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodePropBundle.java
Thu Sep 30 12:15:42 2010
@@ -454,6 +454,31 @@ public class NodePropBundle {
 
     //--------------------------------------------------------------< Object >
 
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append(id);
+        builder.append("(");
+        builder.append(parentId);
+        builder.append(",");
+        builder.append(nodeTypeName);
+        for (Name mixin : mixinTypeNames) {
+            builder.append(",");
+            builder.append(mixin);
+        }
+        if (isReferenceable) {
+            builder.append(",referenceable");
+        }
+        builder.append(") = ");
+        if (!sharedSet.isEmpty()) {
+            builder.append(sharedSet);
+            builder.append(" ");
+        }
+        builder.append(properties.values());
+        builder.append(" ");
+        builder.append(childNodeEntries);
+        return builder.toString();
+    }
+
     public boolean equals(Object object) {
         if (object instanceof NodePropBundle) {
             NodePropBundle that = (NodePropBundle) object;
@@ -513,6 +538,12 @@ public class NodePropBundle {
             return id;
         }
 
+        //----------------------------------------------------------< Object >
+
+        public String toString() {
+            return name + " => " + id;
+        }
+
         public boolean equals(Object object) {
             if (object instanceof ChildNodeEntry) {
                 ChildNodeEntry that = (ChildNodeEntry) object;
@@ -710,6 +741,21 @@ public class NodePropBundle {
             }
         }
 
+        //----------------------------------------------------------< Object >
+
+        public String toString() {
+            StringBuilder builder = new StringBuilder();
+            builder.append(id);
+            builder.append("(");
+            builder.append(PropertyType.nameFromValue(type));
+            if (multiValued) {
+                builder.append(",multiple");
+            }
+            builder.append(") = ");
+            builder.append(Arrays.toString(values));
+            return builder.toString();
+        }
+
         public boolean equals(Object object) {
             if (object instanceof PropertyEntry) {
                 PropertyEntry that = (PropertyEntry) object;



Mime
View raw message