jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1394784 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java
Date Fri, 05 Oct 2012 20:19:48 GMT
Author: mduerig
Date: Fri Oct  5 20:19:48 2012
New Revision: 1394784

URL: http://svn.apache.org/viewvc?rev=1394784&view=rev
Log:
OAK-350: Unify PropertyState and CoreValue
- correct equality for binaries

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java?rev=1394784&r1=1394783&r2=1394784&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java
Fri Oct  5 20:19:48 2012
@@ -21,10 +21,12 @@ package org.apache.jackrabbit.oak.plugin
 import java.util.Collections;
 
 import javax.annotation.Nonnull;
+import javax.jcr.PropertyType;
 
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 
+import static org.apache.jackrabbit.oak.api.Type.BINARIES;
 import static org.apache.jackrabbit.oak.api.Type.STRING;
 import static org.apache.jackrabbit.oak.api.Type.STRINGS;
 
@@ -98,10 +100,18 @@ abstract class EmptyPropertyState implem
         }
         else if (other instanceof PropertyState) {
             PropertyState that = (PropertyState) other;
-            return getName().equals(that.getName())
-                    && isArray() == that.isArray()
-                    && getType().equals(that.getType())
-                    && getValue(STRINGS).equals(that.getValue(STRINGS));
+            if (!getName().equals(that.getName())) {
+                return false;
+            }
+            if (!getType().equals(that.getType())) {
+                return false;
+            }
+            if (getType().tag() == PropertyType.BINARY) {
+                return getValue(BINARIES).equals(that.getValue(BINARIES));
+            }
+            else {
+                return getValue(STRINGS).equals(that.getValue(STRINGS));
+            }
         }
         else {
             return false;



Mime
View raw message