jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1039946 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/webdav/QueryUtil.java
Date Sun, 28 Nov 2010 20:47:49 GMT
Author: jukka
Date: Sun Nov 28 20:47:48 2010
New Revision: 1039946

URL: http://svn.apache.org/viewvc?rev=1039946&view=rev
Log:
JCR-2715: Improved join query performance

It's possible for a query to return null columns.
Fix a related jcr2dav test failure by making the WebDAV result parser more resilient.

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/webdav/QueryUtil.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/webdav/QueryUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/webdav/QueryUtil.java?rev=1039946&r1=1039945&r2=1039946&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/webdav/QueryUtil.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/webdav/QueryUtil.java
Sun Nov 28 20:47:48 2010
@@ -65,14 +65,15 @@ public class QueryUtil implements JcrRem
         columnNames.add(XMLUtil.getChildText(columnElement, JCR_NAME_LN, NS_URI));
         selectorNames.add(XMLUtil.getChildText(columnElement, JCR_SELECTOR_NAME_LN, NS_URI));
 
-        Value jcrValue;
+        Value jcrValue = null;
         Element valueElement = XMLUtil.getChildElement(columnElement, JCR_VALUE_LN, NS_URI);
         if (valueElement != null) {
-            String typeStr = XMLUtil.getAttribute(valueElement, ATTR_VALUE_TYPE, NS_URI);
-            jcrValue = ValueHelper.deserialize(XMLUtil.getText(valueElement),
-                    PropertyType.valueFromName(typeStr), true, valueFactory);
-        } else {
-            jcrValue = null;
+            String text = XMLUtil.getText(valueElement);
+            if (text != null) {
+                String typeStr = XMLUtil.getAttribute(valueElement, ATTR_VALUE_TYPE, NS_URI);
+                jcrValue = ValueHelper.deserialize(
+                        text, PropertyType.valueFromName(typeStr), true, valueFactory);
+            }
         }
         values.add(jcrValue);
     }



Mime
View raw message