jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r783356 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java
Date Wed, 10 Jun 2009 13:29:28 GMT
Author: angela
Date: Wed Jun 10 13:29:27 2009
New Revision: 783356

URL: http://svn.apache.org/viewvc?rev=783356&view=rev
Log:
JCR-1104: JSR 283 support

- resolve TODO: determine length of an internalvalue

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java?rev=783356&r1=783355&r2=783356&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java
Wed Jun 10 13:29:27 2009
@@ -344,15 +344,16 @@
      *         cannot be determined.
      */
     public static long getLength(InternalValue value) {
-        // TODO: support new JSR 283 property types
-        if (value.getType() == PropertyType.BINARY) {
-            return value.getBLOBFileValue().getLength();
-        } else
         if (value.getType() == PropertyType.NAME
                 || value.getType() == PropertyType.PATH) {
             return -1;
         } else {
-            return value.toString().length();
+            try {
+                return value.getLength();
+            } catch (RepositoryException e) {
+                log.warn("Unable to determine length of value.", e.getMessage());
+                return -1;
+            }
         }
     }
 }



Mime
View raw message