jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r780010 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: query/lucene/LuceneQueryBuilder.java value/InternalValue.java
Date Fri, 29 May 2009 15:13:26 GMT
Author: stefan
Date: Fri May 29 15:13:26 2009
New Revision: 780010

URL: http://svn.apache.org/viewvc?rev=780010&view=rev
Log:
JCR-1609: new Property Types


Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java?rev=780010&r1=780009&r2=780010&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
Fri May 29 15:13:26 2009
@@ -1004,6 +1004,16 @@
                         log.debug("Unable to coerce '" + literal + "' into a LONG: " + e.toString());
                     }
                     break;
+                case PropertyType.DECIMAL:
+                    // try to parse decimal
+                    try {
+                        BigDecimal d = new BigDecimal(literal);
+                        values.add(DecimalField.decimalToString(d));
+                        log.debug("Coerced " + literal + " into DECIMAL.");
+                    } catch (NumberFormatException e) {
+                        log.debug("Unable to coerce '" + literal + "' into a DECIMAL: " +
e.toString());
+                    }
+                    break;
                 case PropertyType.STRING:
                     values.add(literal);
                     log.debug("Using literal " + literal + " as is.");

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java?rev=780010&r1=780009&r2=780010&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
Fri May 29 15:13:26 2009
@@ -619,11 +619,11 @@
     }
 
     private InternalValue(URI value) {
-        super(value, PropertyType.URI);
+        super(value);
     }
 
     private InternalValue(BigDecimal value) {
-        super(value, PropertyType.DECIMAL);
+        super(value);
     }
 
     private InternalValue(BLOBFileValue value) {



Mime
View raw message