jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1394133 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: plugins/index/property/PropertyIndexUpdate.java plugins/memory/MemoryNodeBuilder.java spi/state/NodeBuilder.java spi/state/ReadOnlyBuilder.java
Date Thu, 04 Oct 2012 16:21:03 GMT
Author: mduerig
Date: Thu Oct  4 16:21:02 2012
New Revision: 1394133

URL: http://svn.apache.org/viewvc?rev=1394133&view=rev
Log:
OAK-350: Unify PropertyState and CoreValue
- Replace usages of deprecated NodeBuilder.setProperty method with new method and remove the
former

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexUpdate.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeBuilder.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/ReadOnlyBuilder.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexUpdate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexUpdate.java?rev=1394133&r1=1394132&r2=1394133&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexUpdate.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexUpdate.java
Thu Oct  4 16:21:02 2012
@@ -25,6 +25,7 @@ import javax.jcr.PropertyType;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.plugins.memory.MultiPropertyState;
 import org.apache.jackrabbit.oak.plugins.memory.StringValue;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 
@@ -60,7 +61,7 @@ class PropertyIndexUpdate {
         putValues(remove, path.substring(this.path.length()), values);
     }
 
-    private void putValues(
+    private static void putValues(
             Map<String, Set<String>> map,
             String path, Iterable<CoreValue> values) {
         for (CoreValue value : values) {
@@ -95,7 +96,7 @@ class PropertyIndexUpdate {
                 if (values.isEmpty()) {
                     index.removeProperty(encoded);
                 } else {
-                    index.setProperty(encoded, values);
+                    index.setProperty(new MultiPropertyState(encoded, values));
                 }
             }
         }
@@ -120,7 +121,7 @@ class PropertyIndexUpdate {
                 throw new CommitFailedException(
                         "Uniqueness constraint violated");
             } else {
-                index.setProperty(encoded, values);
+                index.setProperty(new MultiPropertyState(encoded, values));
             }
         }
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java?rev=1394133&r1=1394132&r2=1394133&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
Thu Oct  4 16:21:02 2012
@@ -280,20 +280,6 @@ public class MemoryNodeBuilder implement
         return read().getProperty(name);
     }
 
-    @Override @Nonnull @Deprecated
-    public NodeBuilder setProperty(String name, List<CoreValue> values) {
-        MutableNodeState mstate = write();
-
-        if (values.isEmpty()) {
-            mstate.props.put(name, new EmptyPropertyState(name, STRING));
-        } else {
-            mstate.props.put(name, new MultiPropertyState(name, values));
-        }
-
-        updated();
-        return this;
-    }
-
     @Override @Nonnull
     public NodeBuilder removeProperty(String name) {
         MutableNodeState mstate = write();

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeBuilder.java?rev=1394133&r1=1394132&r2=1394133&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeBuilder.java
Thu Oct  4 16:21:02 2012
@@ -16,11 +16,8 @@
  */
 package org.apache.jackrabbit.oak.spi.state;
 
-import java.util.List;
-
 import javax.annotation.Nonnull;
 
-import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 
@@ -105,17 +102,6 @@ public interface NodeBuilder {
     PropertyState getProperty(String name);
 
     /**
-     * Set a property.
-     *
-     * @param name property name
-     * @param values
-     * @return this builder
-     */
-    @Deprecated
-    @Nonnull
-    NodeBuilder setProperty(String name, @Nonnull List<CoreValue> values);
-
-    /**
      * Set a property state
      * @param property  The property state to set
      * @return this builder

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/ReadOnlyBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/ReadOnlyBuilder.java?rev=1394133&r1=1394132&r2=1394133&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/ReadOnlyBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/ReadOnlyBuilder.java
Thu Oct  4 16:21:02 2012
@@ -85,11 +85,6 @@ public class ReadOnlyBuilder implements 
         return state.getProperty(name);
     }
 
-    @Override @Nonnull @Deprecated
-    public NodeBuilder setProperty(String name, List<CoreValue> values) {
-        throw unsupported();
-    }
-
     @Override @Nonnull
     public NodeBuilder removeProperty(String name) {
         throw unsupported();



Mime
View raw message