jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1394157 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: spi/query/IndexUtils.java util/NodeUtil.java
Date Thu, 04 Oct 2012 17:05:44 GMT
Author: mduerig
Date: Thu Oct  4 17:05:44 2012
New Revision: 1394157

URL: http://svn.apache.org/viewvc?rev=1394157&view=rev
Log:
OAK-350: Unify PropertyState and CoreValue
- Replace CoreValue.getBoolean with PropertyState.getValue(Type)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexUtils.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexUtils.java?rev=1394157&r1=1394156&r2=1394157&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexUtils.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexUtils.java
Thu Oct  4 17:05:44 2012
@@ -16,10 +16,6 @@
  */
 package org.apache.jackrabbit.oak.spi.query;
 
-import static org.apache.jackrabbit.oak.spi.query.IndexDefinition.INDEX_DATA_CHILD_NAME;
-import static org.apache.jackrabbit.oak.spi.query.IndexDefinition.TYPE_PROPERTY_NAME;
-import static org.apache.jackrabbit.oak.spi.query.IndexDefinition.UNIQUE_PROPERTY_NAME;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -34,6 +30,11 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
+import static org.apache.jackrabbit.oak.api.Type.BOOLEAN;
+import static org.apache.jackrabbit.oak.spi.query.IndexDefinition.INDEX_DATA_CHILD_NAME;
+import static org.apache.jackrabbit.oak.spi.query.IndexDefinition.TYPE_PROPERTY_NAME;
+import static org.apache.jackrabbit.oak.spi.query.IndexDefinition.UNIQUE_PROPERTY_NAME;
+
 public class IndexUtils {
 
     /**
@@ -59,7 +60,7 @@ public class IndexUtils {
         boolean unique = false;
         PropertyState uniqueProp = ns.getProperty(UNIQUE_PROPERTY_NAME);
         if (uniqueProp != null && !uniqueProp.isArray()) {
-            unique = uniqueProp.getValue().getBoolean();
+            unique = uniqueProp.getValue(BOOLEAN);
         }
 
         Map<String, String> props = new HashMap<String, String>();

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java?rev=1394157&r1=1394156&r2=1394157&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java
Thu Oct  4 17:05:44 2012
@@ -42,6 +42,7 @@ import org.apache.jackrabbit.util.ISO860
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.jackrabbit.oak.api.Type.BOOLEAN;
 import static org.apache.jackrabbit.oak.api.Type.DATE;
 import static org.apache.jackrabbit.oak.api.Type.LONG;
 import static org.apache.jackrabbit.oak.api.Type.NAME;
@@ -127,7 +128,7 @@ public class NodeUtil {
     public boolean getBoolean(String name) {
         PropertyState property = tree.getProperty(name);
         return property != null && !property.isArray()
-                && property.getValue().getBoolean();
+                && property.getValue(BOOLEAN);
     }
 
     public void setBoolean(String name, boolean value) {



Mime
View raw message