jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1393449 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query: Query.java ast/NodeNameImpl.java
Date Wed, 03 Oct 2012 12:07:32 GMT
Author: alexparvulescu
Date: Wed Oct  3 12:07:32 2012
New Revision: 1393449

URL: http://svn.apache.org/viewvc?rev=1393449&view=rev
Log:
OAK-328 jcr:like(fn:name(), '%:content') should not match jcr:content - rollback

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java?rev=1393449&r1=1393448&r2=1393449&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
Wed Oct  3 12:07:32 2012
@@ -474,7 +474,7 @@ public class Query {
             case PropertyType.DECIMAL:
                 return vf.createValue(v.getString(), PropertyType.DECIMAL);
             case PropertyType.NAME:
-                return vf.createValue(getOakPath(v.getString(), true), PropertyType.NAME);
+                return vf.createValue(getOakPath(v.getString()), PropertyType.NAME);
             case PropertyType.PATH:
                 return vf.createValue(v.getString(), PropertyType.PATH);
             case PropertyType.REFERENCE:
@@ -504,7 +504,7 @@ public class Query {
         }
     }
 
-    public String getOakPath(String jcrPath, boolean errorOnInvalidPath) {
+    public String getOakPath(String jcrPath) {
         NamePathMapper m = getNamePathMapper();
         if (m == null) {
             // to simplify testing, a getNamePathMapper isn't required
@@ -512,10 +512,8 @@ public class Query {
         }
         String p = m.getOakPath(jcrPath);
         if (p == null) {
-            if (!errorOnInvalidPath) {
-                return null;
-            }
-            throw new IllegalArgumentException("Not a valid JCR path: " + jcrPath);
+            throw new IllegalArgumentException("Not a valid JCR path: "
+                    + jcrPath);
         }
         return p;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java?rev=1393449&r1=1393448&r2=1393449&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java
Wed Oct  3 12:07:32 2012
@@ -77,10 +77,6 @@ public class NodeNameImpl extends Dynami
         String path = v.getString();
         // Name escaping (convert _x0020_ to space)
         path = decodeName(path);
-        if (path == null) {
-            f.setAlwaysFalse();
-            return;
-        }
         if (PathUtils.isAbsolute(path)) {
             throw new IllegalArgumentException("NAME() comparison with absolute path are
not allowed: " + path);
         }
@@ -99,7 +95,7 @@ public class NodeNameImpl extends Dynami
         // Name escaping (convert _x0020_ to space)
         path = ISO9075.decode(path);
         // normalize paths (./name > name)
-        path = query.getOakPath(path, false);
+        path = query.getOakPath(path);
         return path;
     }
 



Mime
View raw message