jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1394038 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/memory/ main/java/org/apache/jackrabbit/oak/spi/state/ test/java/org/apache/jackrabbit/oak/plugins/index/property/
Date Thu, 04 Oct 2012 13:05:26 GMT
Author: mduerig
Date: Thu Oct  4 13:05:25 2012
New Revision: 1394038

URL: http://svn.apache.org/viewvc?rev=1394038&view=rev
Log:
OAK-350: Unify PropertyState and CoreValue
- replace NodeBuilder.set methods with corresponding setProperty methods and remove the former

Modified:
    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
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexTest.java

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=1394038&r1=1394037&r2=1394038&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 13:05:25 2012
@@ -302,21 +302,6 @@ public class MemoryNodeBuilder implement
         return this;
     }
 
-    @Override @Nonnull @Deprecated
-    public NodeBuilder set(@Nonnull String name, @Nonnull String value) {
-        return setProperty(name, new StringValue(value));
-    }
-
-    @Override @Nonnull @Deprecated
-    public NodeBuilder set(
-            @Nonnull String name, @Nonnull String... values) {
-        List<CoreValue> list = Lists.newArrayListWithCapacity(values.length);
-        for (String value : values) {
-            list.add(new StringValue(value));
-        }
-        return setProperty(name, list);
-    }
-
     @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=1394038&r1=1394037&r2=1394038&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 13:05:25 2012
@@ -126,14 +126,6 @@ public interface NodeBuilder {
     @Nonnull
     NodeBuilder setProperty(String name, @Nonnull List<CoreValue> values);
 
-    @Deprecated
-    @Nonnull
-    NodeBuilder set(String name, String value);
-
-    @Deprecated
-    @Nonnull
-    NodeBuilder set(String name, String... values);
-
     /**
      * Set a property state
      * @param property  The property state to set

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=1394038&r1=1394037&r2=1394038&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 13:05:25 2012
@@ -95,16 +95,6 @@ public class ReadOnlyBuilder implements 
         throw unsupported();
     }
 
-    @Override @Nonnull @Deprecated
-    public NodeBuilder set(String name, String value) {
-        throw unsupported();
-    }
-
-    @Override @Nonnull @Deprecated
-    public NodeBuilder set(String name, String... value) {
-        throw unsupported();
-    }
-
     @Override @Nonnull
     public NodeBuilder removeProperty(String name) {
         throw unsupported();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexTest.java?rev=1394038&r1=1394037&r2=1394038&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexTest.java
Thu Oct  4 13:05:25 2012
@@ -16,14 +16,16 @@
  */
 package org.apache.jackrabbit.oak.plugins.index.property;
 
-import static org.junit.Assert.assertEquals;
+import java.util.Arrays;
 
+import com.google.common.collect.ImmutableSet;
+import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.junit.Test;
 
-import com.google.common.collect.ImmutableSet;
+import static org.junit.Assert.assertEquals;
 
 public class PropertyIndexTest {
 
@@ -40,11 +42,11 @@ public class PropertyIndexTest {
 
         // Add some content and process it through the property index hook
         builder = before.getBuilder();
-        builder.getChildBuilder("a").set("foo", "abc");
-        builder.getChildBuilder("b").set("foo", "abc", "def");
+        builder.getChildBuilder("a").setProperty("foo", "abc");
+        builder.getChildBuilder("b").setProperty("foo", Arrays.asList("abc", "def"), Type.STRINGS);
         // plus lots of dummy content to highlight the benefit of indexing
         for (int i = 0; i < MANY; i++) {
-            builder.getChildBuilder("n" + i).set("foo", "xyz");
+            builder.getChildBuilder("n" + i).setProperty("foo", "xyz");
         }
         NodeState after = builder.getNodeState();
 



Mime
View raw message