jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r515162 - /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
Date Tue, 06 Mar 2007 15:50:43 GMT
Author: angela
Date: Tue Mar  6 07:50:42 2007
New Revision: 515162

URL: http://svn.apache.org/viewvc?view=rev&rev=515162
Log:
creating Query from Node that has not been retrieved the 'this' session throws.

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java?view=diff&rev=515162&r1=515161&r2=515162
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
Tue Mar  6 07:50:42 2007
@@ -145,6 +145,9 @@
             if (!node.isNodeType(NameFormat.format(QName.NT_QUERY, nsResolver))) {
                 throw new InvalidQueryException("Node is not of type nt:query");
             }
+            if (node.getSession() != session) {
+                throw new InvalidQueryException("Node belongs to a different session.");
+            }
             statement = node.getProperty(NameFormat.format(QName.JCR_STATEMENT, nsResolver)).getString();
             language = node.getProperty(NameFormat.format(QName.JCR_LANGUAGE, nsResolver)).getString();
             this.wspManager.checkQueryStatement(statement, language,



Mime
View raw message