You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ju...@apache.org on 2010/09/16 22:25:38 UTC

svn commit: r997916 - in /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper: jcr/JcrNodeResource.java starresource/StarResource.java

Author: justin
Date: Thu Sep 16 20:25:38 2010
New Revision: 997916

URL: http://svn.apache.org/viewvc?rev=997916&view=rev
Log:
Revert "SLING-1781 - fixing String equality check"

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/starresource/StarResource.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java?rev=997916&r1=997915&r2=997916&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java Thu Sep 16 20:25:38 2010
@@ -93,7 +93,8 @@ class JcrNodeResource extends JcrItemRes
     }
 
     public String getResourceSuperType() {
-        if ( UNSET_RESOURCE_SUPER_TYPE.equals(resourceSuperType) ) {
+        // Yes, this isn't how you're supposed to compare Strings, but this is intentional.
+        if ( resourceSuperType == UNSET_RESOURCE_SUPER_TYPE ) {
             try {
                 if (node.hasProperty(JcrResourceConstants.SLING_RESOURCE_SUPER_TYPE_PROPERTY)) {
                     resourceSuperType = node.getProperty(JcrResourceConstants.SLING_RESOURCE_SUPER_TYPE_PROPERTY).getValue().getString();
@@ -101,7 +102,7 @@ class JcrNodeResource extends JcrItemRes
             } catch (RepositoryException re) {
                 // we ignore this
             }
-            if ( UNSET_RESOURCE_SUPER_TYPE.equals(resourceSuperType) ) {
+            if ( resourceSuperType == UNSET_RESOURCE_SUPER_TYPE ) {
                 resourceSuperType = null;
             }
         }

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/starresource/StarResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/starresource/StarResource.java?rev=997916&r1=997915&r2=997916&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/starresource/StarResource.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/starresource/StarResource.java Thu Sep 16 20:25:38 2010
@@ -69,7 +69,8 @@ public class StarResource extends Synthe
      * to dynamically resolve the resource super type of this star resource.
      */
     public String getResourceSuperType() {
-        if (UNSET_RESOURCE_SUPER_TYPE.equals(resourceSuperType)) {
+        // Yes, this isn't how you're supposed to compare Strings, but this is intentional.
+        if (resourceSuperType == UNSET_RESOURCE_SUPER_TYPE) {
             resourceSuperType = ResourceUtil.getResourceSuperType(this.getResourceResolver(),
                     this.getResourceType());
         }