jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1400137 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins: memory/ value/
Date Fri, 19 Oct 2012 15:51:21 GMT
Author: mduerig
Date: Fri Oct 19 15:51:21 2012
New Revision: 1400137

URL: http://svn.apache.org/viewvc?rev=1400137&view=rev
Log:
OAK-380: Define conversion of property values
conversion for date values

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublePropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericsPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/SinglePropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/Conversions.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalPropertyState.java?rev=1400137&r1=1400136&r2=1400137&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalPropertyState.java
Fri Oct 19 15:51:21 2012
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.oak.plugins.memory;
 
 import java.math.BigDecimal;
+import java.util.Calendar;
 
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
@@ -47,6 +48,12 @@ public class DecimalPropertyState extend
     }
 
     @Override
+    protected String getDate() {
+        Calendar calendar = Conversions.convert(value).toDate();
+        return Conversions.convert(calendar).toString();
+    }
+
+    @Override
     public String getString() {
         return Conversions.convert(value).toString();
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java?rev=1400137&r1=1400136&r2=1400137&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java
Fri Oct 19 15:51:21 2012
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.oak.plugins.memory;
 
 import java.math.BigDecimal;
+import java.util.Calendar;
 import java.util.List;
 
 import com.google.common.base.Function;
@@ -53,11 +54,28 @@ public class DecimalsPropertyState exten
     }
 
     @Override
+    protected Iterable<String> getDates() {
+        return Iterables.transform(values, new Function<BigDecimal, String>() {
+            @Override
+            public String apply(BigDecimal value) {
+                Calendar calendar = Conversions.convert(value).toDate();
+                return Conversions.convert(calendar).toString();
+            }
+        });
+    }
+
+    @Override
     protected double getDouble(int index) {
         return Conversions.convert(values.get(index)).toDouble();
     }
 
     @Override
+    protected String getDate(int index) {
+        Calendar calendar = Conversions.convert(values.get(index)).toDate();
+        return Conversions.convert(calendar).toString();
+    }
+
+    @Override
     protected Iterable<Long> getLongs() {
         return Iterables.transform(values, new Function<BigDecimal, Long>() {
             @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublePropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublePropertyState.java?rev=1400137&r1=1400136&r2=1400137&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublePropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublePropertyState.java
Fri Oct 19 15:51:21 2012
@@ -19,11 +19,12 @@
 package org.apache.jackrabbit.oak.plugins.memory;
 
 import java.math.BigDecimal;
+import java.util.Calendar;
 
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 
-import static org.apache.jackrabbit.oak.api.Type.*;
+import static org.apache.jackrabbit.oak.api.Type.DOUBLE;
 
 public class DoublePropertyState extends SinglePropertyState {
     private final double value;
@@ -49,6 +50,12 @@ public class DoublePropertyState extends
     }
 
     @Override
+    protected String getDate() {
+        Calendar calendar = Conversions.convert(value).toDate();
+        return Conversions.convert(calendar).toString();
+    }
+
+    @Override
     public String getString() {
         return Conversions.convert(value).toString();
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java?rev=1400137&r1=1400136&r2=1400137&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java
Fri Oct 19 15:51:21 2012
@@ -19,6 +19,7 @@
 package org.apache.jackrabbit.oak.plugins.memory;
 
 import java.math.BigDecimal;
+import java.util.Calendar;
 import java.util.List;
 
 import com.google.common.base.Function;
@@ -54,11 +55,27 @@ public class DoublesPropertyState extend
     }
 
     @Override
+    protected Iterable<String> getDates() {
+        return Iterables.transform(values, new Function<Double, String>() {
+            @Override
+            public String apply(Double value) {
+                Calendar calendar = Conversions.convert(value).toDate();
+                return Conversions.convert(calendar).toString();
+            }
+        });
+    }
+    @Override
     protected double getDouble(int index) {
         return values.get(index);
     }
 
     @Override
+    protected String getDate(int index) {
+        Calendar calendar = Conversions.convert(values.get(index)).toDate();
+        return Conversions.convert(calendar).toString();
+    }
+
+    @Override
     protected Iterable<Long> getLongs() {
         return Iterables.transform(values, new Function<Double, Long>() {
             @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericPropertyState.java?rev=1400137&r1=1400136&r2=1400137&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericPropertyState.java
Fri Oct 19 15:51:21 2012
@@ -16,7 +16,11 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import java.math.BigDecimal;
+import java.util.Calendar;
+
 import org.apache.jackrabbit.oak.api.Type;
+import org.apache.jackrabbit.oak.plugins.value.Conversions;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
@@ -40,6 +44,50 @@ public class GenericPropertyState extend
     }
 
     @Override
+    protected long getLong() {
+        if (type == Type.DATE) {
+            Calendar calendar = Conversions.convert(value).toDate();
+            return Conversions.convert(calendar).toLong();
+        }
+        else {
+            return super.getLong();
+        }
+    }
+
+    @Override
+    protected double getDouble() {
+        if (type == Type.DATE) {
+            Calendar calendar = Conversions.convert(value).toDate();
+            return Conversions.convert(calendar).toDouble();
+        }
+        else {
+            return super.getDouble();
+        }
+    }
+
+    @Override
+    protected String getDate() {
+        if (type == Type.DATE) {
+            Calendar calendar = Conversions.convert(value).toDate();
+            return Conversions.convert(calendar).toString();
+        }
+        else {
+            return super.getDate();
+        }
+    }
+
+    @Override
+    protected BigDecimal getDecimal() {
+        if (type == Type.DATE) {
+            Calendar calendar = Conversions.convert(value).toDate();
+            return Conversions.convert(calendar).toDecimal();
+        }
+        else {
+            return super.getDecimal();
+        }
+    }
+
+    @Override
     public Type<?> getType() {
         return type;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericsPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericsPropertyState.java?rev=1400137&r1=1400136&r2=1400137&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericsPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericsPropertyState.java
Fri Oct 19 15:51:21 2012
@@ -18,9 +18,14 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import java.math.BigDecimal;
+import java.util.Calendar;
 import java.util.List;
 
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
 import org.apache.jackrabbit.oak.api.Type;
+import org.apache.jackrabbit.oak.plugins.value.Conversions;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
@@ -47,6 +52,114 @@ public class GenericsPropertyState exten
     }
 
     @Override
+    protected Iterable<Long> getLongs() {
+        if (type == Type.DATES) {
+            return Iterables.transform(values, new Function<String, Long>() {
+                @Override
+                public Long apply(String value) {
+                    Calendar calendar = Conversions.convert(value).toDate();
+                    return Conversions.convert(calendar).toLong();
+                }
+            });
+        }
+        else {
+            return super.getLongs();
+        }
+    }
+
+    @Override
+    protected long getLong(int index) {
+        if (type == Type.DATES) {
+            Calendar calendar = Conversions.convert(values.get(index)).toDate();
+            return Conversions.convert(calendar).toLong();
+        }
+        else {
+            return super.getLong(index);
+        }
+    }
+
+    @Override
+    protected Iterable<Double> getDoubles() {
+        if (type == Type.DATES) {
+            return Iterables.transform(values, new Function<String, Double>() {
+                @Override
+                public Double apply(String value) {
+                    Calendar calendar = Conversions.convert(value).toDate();
+                    return Conversions.convert(calendar).toDouble();
+                }
+            });
+        }
+        else {
+            return super.getDoubles();
+        }
+    }
+
+    @Override
+    protected double getDouble(int index) {
+        if (type == Type.DATES) {
+            Calendar calendar = Conversions.convert(values.get(index)).toDate();
+            return Conversions.convert(calendar).toDouble();
+        }
+        else {
+            return super.getDouble(index);
+        }
+    }
+
+    @Override
+    protected Iterable<String> getDates() {
+        if (type == Type.DATES) {
+            return Iterables.transform(values, new Function<String, String>() {
+                @Override
+                public String apply(String value) {
+                    Calendar calendar = Conversions.convert(value).toDate();
+                    return Conversions.convert(calendar).toString();
+                }
+            });
+        }
+        else {
+            return super.getDates();
+        }
+    }
+
+    @Override
+    protected String getDate(int index) {
+        if (type == Type.DATES) {
+            Calendar calendar = Conversions.convert(values.get(index)).toDate();
+            return Conversions.convert(calendar).toString();
+        }
+        else {
+            return super.getDate(index);
+        }
+    }
+
+    @Override
+    protected Iterable<BigDecimal> getDecimals() {
+        if (type == Type.DATES) {
+            return Iterables.transform(values, new Function<String, BigDecimal>() {
+                @Override
+                public BigDecimal apply(String value) {
+                    Calendar calendar = Conversions.convert(value).toDate();
+                    return Conversions.convert(calendar).toDecimal();
+                }
+            });
+        }
+        else {
+            return super.getDecimals();
+        }
+    }
+
+    @Override
+    protected BigDecimal getDecimal(int index) {
+        if (type == Type.DATES) {
+            Calendar calendar = Conversions.convert(values.get(index)).toDate();
+            return Conversions.convert(calendar).toDecimal();
+        }
+        else {
+            return super.getDecimal(index);
+        }
+    }
+
+    @Override
     public Type<?> getType() {
         return type;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongPropertyState.java?rev=1400137&r1=1400136&r2=1400137&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongPropertyState.java
Fri Oct 19 15:51:21 2012
@@ -19,11 +19,12 @@
 package org.apache.jackrabbit.oak.plugins.memory;
 
 import java.math.BigDecimal;
+import java.util.Calendar;
 
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 
-import static org.apache.jackrabbit.oak.api.Type.*;
+import static org.apache.jackrabbit.oak.api.Type.LONG;
 
 public class LongPropertyState extends SinglePropertyState {
     private final long value;
@@ -49,6 +50,12 @@ public class LongPropertyState extends S
     }
 
     @Override
+    protected String getDate() {
+        Calendar calendar = Conversions.convert(value).toDate();
+        return Conversions.convert(calendar).toString();
+    }
+
+    @Override
     public String getString() {
         return Conversions.convert(value).toString();
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java?rev=1400137&r1=1400136&r2=1400137&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java
Fri Oct 19 15:51:21 2012
@@ -19,6 +19,7 @@
 package org.apache.jackrabbit.oak.plugins.memory;
 
 import java.math.BigDecimal;
+import java.util.Calendar;
 import java.util.List;
 
 import com.google.common.base.Function;
@@ -60,11 +61,28 @@ public class LongsPropertyState extends 
     }
 
     @Override
+    protected Iterable<String> getDates() {
+        return Iterables.transform(values, new Function<Long, String>() {
+            @Override
+            public String apply(Long value) {
+                Calendar calendar = Conversions.convert(value).toDate();
+                return Conversions.convert(calendar).toString();
+            }
+        });
+    }
+
+    @Override
     protected double getDouble(int index) {
         return Conversions.convert(values.get(index)).toDouble();
     }
 
     @Override
+    protected String getDate(int index) {
+        Calendar calendar = Conversions.convert(values.get(index)).toDate();
+        return Conversions.convert(calendar).toString();
+    }
+
+    @Override
     protected Iterable<Long> getLongs() {
         return values;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java?rev=1400137&r1=1400136&r2=1400137&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java
Fri Oct 19 15:51:21 2012
@@ -19,6 +19,7 @@
 package org.apache.jackrabbit.oak.plugins.memory;
 
 import java.math.BigDecimal;
+import java.util.Calendar;
 import java.util.List;
 
 import javax.annotation.Nonnull;
@@ -99,6 +100,19 @@ abstract class MultiPropertyState<T> ext
     }
 
     /**
+     * @return  The values of this property state as {@code Dates}s
+     */
+    protected Iterable<String> getDates() {
+        return Iterables.transform(getStrings(), new Function<String, String>() {
+            @Override
+            public String apply(String value) {
+                Calendar calendar = Conversions.convert(value).toDate();
+                return Conversions.convert(calendar).toString();
+            }
+        });
+    }
+
+    /**
      * @return  The values of this property state as {@code Booleans}s
      */
     protected Iterable<Boolean> getBooleans() {
@@ -148,6 +162,15 @@ abstract class MultiPropertyState<T> ext
 
     /**
      * @param index
+     * @return  The value at the given {@code index} as {@code date}
+     */
+    protected String getDate(int index) {
+        Calendar calendar = Conversions.convert(getString(index)).toDate();
+        return Conversions.convert(calendar).toString();
+    }
+
+    /**
+     * @param index
      * @return  The value at the given {@code index} as {@code boolean}
      */
     protected boolean getBoolean(int index) {
@@ -176,7 +199,7 @@ abstract class MultiPropertyState<T> ext
             case PropertyType.BINARY: return (T) getBlobs();
             case PropertyType.LONG: return (T) getLongs();
             case PropertyType.DOUBLE: return (T) getDoubles();
-            case PropertyType.DATE: return (T) getStrings();
+            case PropertyType.DATE: return (T) getDates();
             case PropertyType.BOOLEAN: return (T) getBooleans();
             case PropertyType.NAME: return (T) getStrings();
             case PropertyType.PATH: return (T) getStrings();
@@ -207,7 +230,7 @@ abstract class MultiPropertyState<T> ext
             case PropertyType.BINARY: return (T) getBlob(index);
             case PropertyType.LONG: return (T) (Long) getLong(index);
             case PropertyType.DOUBLE: return (T) (Double) getDouble(index);
-            case PropertyType.DATE: return (T) getString(index);
+            case PropertyType.DATE: return (T) getDate(index);
             case PropertyType.BOOLEAN: return (T) (Boolean) getBoolean(index);
             case PropertyType.NAME: return (T) getString(index);
             case PropertyType.PATH: return (T) getString(index);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/SinglePropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/SinglePropertyState.java?rev=1400137&r1=1400136&r2=1400137&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/SinglePropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/SinglePropertyState.java
Fri Oct 19 15:51:21 2012
@@ -19,6 +19,7 @@
 package org.apache.jackrabbit.oak.plugins.memory;
 
 import java.math.BigDecimal;
+import java.util.Calendar;
 
 import javax.annotation.Nonnull;
 import javax.jcr.PropertyType;
@@ -58,28 +59,36 @@ abstract class SinglePropertyState exten
     }
 
     /**
-     * @return  {@code getLong(getString())}
+     * @return  long value converted by {@code Conversions.convert(String)}
      */
     protected long getLong() {
         return Conversions.convert(getString()).toLong();
     }
 
     /**
-     * @return  {@code getDouble(getString())}
+     * @return  double value converted by {@code Conversions.convert(String)}
      */
     protected double getDouble() {
         return Conversions.convert(getString()).toDouble();
     }
 
     /**
-     * @return  {@code StringPropertyState.getBoolean(getString())}
+     * @return  date value converted by {@code Conversions.convert(String)}
+     */
+    protected String getDate() {
+        Calendar calendar = Conversions.convert(getString()).toDate();
+        return Conversions.convert(calendar).toString();
+    }
+
+    /**
+     * @return  boolean value converted by {@code Conversions.convert(String)}
      */
     protected boolean getBoolean() {
         return Conversions.convert(getString()).toBoolean();
     }
 
     /**
-     * @return  {@code getDecimal(getString())}
+     * @return  decimal value converted by {@code Conversions.convert(String)}
      */
     protected BigDecimal getDecimal() {
         return Conversions.convert(getString()).toDecimal();
@@ -107,7 +116,7 @@ abstract class SinglePropertyState exten
                 case PropertyType.BINARY: return (T) singleton(getBlob());
                 case PropertyType.LONG: return (T) singleton(getLong());
                 case PropertyType.DOUBLE: return (T) singleton(getDouble());
-                case PropertyType.DATE: return (T) singleton(getString());
+                case PropertyType.DATE: return (T) singleton(getDate());
                 case PropertyType.BOOLEAN: return (T) singleton(getBoolean());
                 case PropertyType.NAME: return (T) singleton(getString());
                 case PropertyType.PATH: return (T) singleton(getString());
@@ -124,7 +133,7 @@ abstract class SinglePropertyState exten
                 case PropertyType.BINARY: return (T) getBlob();
                 case PropertyType.LONG: return (T) (Long) getLong();
                 case PropertyType.DOUBLE: return (T) (Double) getDouble();
-                case PropertyType.DATE: return (T) getString();
+                case PropertyType.DATE: return (T) getDate();
                 case PropertyType.BOOLEAN: return (T) (Boolean) getBoolean();
                 case PropertyType.NAME: return (T) getString();
                 case PropertyType.PATH: return (T) getString();

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/Conversions.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/Conversions.java?rev=1400137&r1=1400136&r2=1400137&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/Conversions.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/Conversions.java
Fri Oct 19 15:51:21 2012
@@ -189,7 +189,7 @@ public final class Conversions {
             @Override
             public Calendar toDate() {
                 Calendar date = Calendar.getInstance(TimeZone.getTimeZone("GMT+00:00"));
-                date.setTimeInMillis(toLong());
+                date.setTimeInMillis(value);
                 return date;
             }
 



Mime
View raw message