You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jörg von Frantzius (JIRA)" <ji...@apache.org> on 2012/09/30 23:36:07 UTC

[jira] [Created] (JCR-3435) NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)

Jörg von Frantzius created JCR-3435:
---------------------------------------

             Summary: NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)
                 Key: JCR-3435
                 URL: https://issues.apache.org/jira/browse/JCR-3435
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-spi-commons
    Affects Versions: 2.5.2, 2.4.2
            Reporter: Jörg von Frantzius


When adding the following to {{org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest}}:
{code}
    public void testChildStarName() throws Exception {
        checkStatement("//element(*, foo)[child::*/@bar = 'bla']");
    }
{code}
a NullPointerException is thrown while parsing:
{code}
java.lang.NullPointerException
        at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:351)
        at org.apache.jackrabbit.spi.commons.query.RelationQueryNode.accept(RelationQueryNode.java:115)
        at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:317)
        at org.apache.jackrabbit.spi.commons.query.LocationStepQueryNode.accept(LocationStepQueryNode.java:166)
        at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:260)
        at org.apache.jackrabbit.spi.commons.query.PathQueryNode.accept(PathQueryNode.java:74)
        at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:115)
        at org.apache.jackrabbit.spi.commons.query.QueryRootNode.accept(QueryRootNode.java:115)
        at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.<init>(QueryFormat.java:75)
        at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.toString(QueryFormat.java:95)
        at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.checkStatement(QueryFormatTest.java:80)
        at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.testChildStarName(QueryFormatTest.java:71)
{code}

This is a regression from Jackrabbit 1.6.5, where a similar test does run, i.e. parsing does not throw exception.

The same NPE happens when "child::" is dropped, i.e. when the query looks like this:
{code}
"//element(*, foo)[*/@bar = 'bla']"
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-3435) NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)

Posted by "Jörg von Frantzius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg von Frantzius updated JCR-3435:
------------------------------------

    Fix Version/s:     (was: 2.4.2)
                   2.4.4
    
> NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-3435
>                 URL: https://issues.apache.org/jira/browse/JCR-3435
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 2.4.2, 2.4.4, 2.5.2, 2.6
>            Reporter: Jörg von Frantzius
>              Labels: queryparser, xpath
>             Fix For: 2.4.4, 2.6
>
>         Attachments: xpathqueryparser.patch
>
>
> When adding the following to {{org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest}}:
> {code}
>     public void testChildStarName() throws Exception {
>         checkStatement("//element(*, foo)[child::*/@bar = 'bla']");
>     }
> {code}
> a NullPointerException is thrown while parsing:
> {code}
> java.lang.NullPointerException
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:351)
>         at org.apache.jackrabbit.spi.commons.query.RelationQueryNode.accept(RelationQueryNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:317)
>         at org.apache.jackrabbit.spi.commons.query.LocationStepQueryNode.accept(LocationStepQueryNode.java:166)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:260)
>         at org.apache.jackrabbit.spi.commons.query.PathQueryNode.accept(PathQueryNode.java:74)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:115)
>         at org.apache.jackrabbit.spi.commons.query.QueryRootNode.accept(QueryRootNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.<init>(QueryFormat.java:75)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.toString(QueryFormat.java:95)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.checkStatement(QueryFormatTest.java:80)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.testChildStarName(QueryFormatTest.java:71)
> {code}
> This is a regression from Jackrabbit 1.6.5, where a similar test does run, i.e. parsing does not throw exception.
> The same NPE happens when "child::" is dropped, i.e. when the query looks like this:
> {code}
> "//element(*, foo)[*/@bar = 'bla']"
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (JCR-3435) NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)

Posted by "Alex Parvulescu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13468422#comment-13468422 ] 

Alex Parvulescu commented on JCR-3435:
--------------------------------------

+1 it looks good to me
                
> NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-3435
>                 URL: https://issues.apache.org/jira/browse/JCR-3435
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 2.4.2, 2.4.4, 2.5.2, 2.6
>            Reporter: Jörg von Frantzius
>            Assignee: Bart van der Schans
>              Labels: queryparser, xpath
>             Fix For: 2.4.4, 2.6
>
>         Attachments: xpathqueryparser.patch
>
>
> When adding the following to {{org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest}}:
> {code}
>     public void testChildStarName() throws Exception {
>         checkStatement("//element(*, foo)[child::*/@bar = 'bla']");
>     }
> {code}
> a NullPointerException is thrown while parsing:
> {code}
> java.lang.NullPointerException
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:351)
>         at org.apache.jackrabbit.spi.commons.query.RelationQueryNode.accept(RelationQueryNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:317)
>         at org.apache.jackrabbit.spi.commons.query.LocationStepQueryNode.accept(LocationStepQueryNode.java:166)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:260)
>         at org.apache.jackrabbit.spi.commons.query.PathQueryNode.accept(PathQueryNode.java:74)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:115)
>         at org.apache.jackrabbit.spi.commons.query.QueryRootNode.accept(QueryRootNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.<init>(QueryFormat.java:75)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.toString(QueryFormat.java:95)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.checkStatement(QueryFormatTest.java:80)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.testChildStarName(QueryFormatTest.java:71)
> {code}
> This is a regression from Jackrabbit 1.6.5, where a similar test does run, i.e. parsing does not throw exception.
> The same NPE happens when "child::" is dropped, i.e. when the query looks like this:
> {code}
> "//element(*, foo)[*/@bar = 'bla']"
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-3435) NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)

Posted by "Jörg von Frantzius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg von Frantzius updated JCR-3435:
------------------------------------

    Affects Version/s: 2.6
    
> NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-3435
>                 URL: https://issues.apache.org/jira/browse/JCR-3435
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 2.4.2, 2.5.2, 2.6
>            Reporter: Jörg von Frantzius
>
> When adding the following to {{org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest}}:
> {code}
>     public void testChildStarName() throws Exception {
>         checkStatement("//element(*, foo)[child::*/@bar = 'bla']");
>     }
> {code}
> a NullPointerException is thrown while parsing:
> {code}
> java.lang.NullPointerException
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:351)
>         at org.apache.jackrabbit.spi.commons.query.RelationQueryNode.accept(RelationQueryNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:317)
>         at org.apache.jackrabbit.spi.commons.query.LocationStepQueryNode.accept(LocationStepQueryNode.java:166)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:260)
>         at org.apache.jackrabbit.spi.commons.query.PathQueryNode.accept(PathQueryNode.java:74)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:115)
>         at org.apache.jackrabbit.spi.commons.query.QueryRootNode.accept(QueryRootNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.<init>(QueryFormat.java:75)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.toString(QueryFormat.java:95)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.checkStatement(QueryFormatTest.java:80)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.testChildStarName(QueryFormatTest.java:71)
> {code}
> This is a regression from Jackrabbit 1.6.5, where a similar test does run, i.e. parsing does not throw exception.
> The same NPE happens when "child::" is dropped, i.e. when the query looks like this:
> {code}
> "//element(*, foo)[*/@bar = 'bla']"
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-3435) NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)

Posted by "Jörg von Frantzius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg von Frantzius updated JCR-3435:
------------------------------------

    Affects Version/s: 2.4.4
    
> NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-3435
>                 URL: https://issues.apache.org/jira/browse/JCR-3435
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 2.4.2, 2.4.4, 2.5.2, 2.6
>            Reporter: Jörg von Frantzius
>              Labels: queryparser, xpath
>             Fix For: 2.4.4, 2.6
>
>         Attachments: xpathqueryparser.patch
>
>
> When adding the following to {{org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest}}:
> {code}
>     public void testChildStarName() throws Exception {
>         checkStatement("//element(*, foo)[child::*/@bar = 'bla']");
>     }
> {code}
> a NullPointerException is thrown while parsing:
> {code}
> java.lang.NullPointerException
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:351)
>         at org.apache.jackrabbit.spi.commons.query.RelationQueryNode.accept(RelationQueryNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:317)
>         at org.apache.jackrabbit.spi.commons.query.LocationStepQueryNode.accept(LocationStepQueryNode.java:166)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:260)
>         at org.apache.jackrabbit.spi.commons.query.PathQueryNode.accept(PathQueryNode.java:74)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:115)
>         at org.apache.jackrabbit.spi.commons.query.QueryRootNode.accept(QueryRootNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.<init>(QueryFormat.java:75)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.toString(QueryFormat.java:95)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.checkStatement(QueryFormatTest.java:80)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.testChildStarName(QueryFormatTest.java:71)
> {code}
> This is a regression from Jackrabbit 1.6.5, where a similar test does run, i.e. parsing does not throw exception.
> The same NPE happens when "child::" is dropped, i.e. when the query looks like this:
> {code}
> "//element(*, foo)[*/@bar = 'bla']"
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-3435) NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)

Posted by "Jörg von Frantzius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg von Frantzius updated JCR-3435:
------------------------------------

    Attachment: xpathqueryparser.patch

Patch for jackrabbit-spi-commons 2.4.2, also applies to 2.6-SNAPSHOT (current trunk from Subversion).

An "mvn clean install" succeeds on parent project, both 2.4.2 and 2.6-SNAPSHOT.
                
> NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-3435
>                 URL: https://issues.apache.org/jira/browse/JCR-3435
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 2.4.2, 2.5.2, 2.6
>            Reporter: Jörg von Frantzius
>         Attachments: xpathqueryparser.patch
>
>
> When adding the following to {{org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest}}:
> {code}
>     public void testChildStarName() throws Exception {
>         checkStatement("//element(*, foo)[child::*/@bar = 'bla']");
>     }
> {code}
> a NullPointerException is thrown while parsing:
> {code}
> java.lang.NullPointerException
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:351)
>         at org.apache.jackrabbit.spi.commons.query.RelationQueryNode.accept(RelationQueryNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:317)
>         at org.apache.jackrabbit.spi.commons.query.LocationStepQueryNode.accept(LocationStepQueryNode.java:166)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:260)
>         at org.apache.jackrabbit.spi.commons.query.PathQueryNode.accept(PathQueryNode.java:74)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:115)
>         at org.apache.jackrabbit.spi.commons.query.QueryRootNode.accept(QueryRootNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.<init>(QueryFormat.java:75)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.toString(QueryFormat.java:95)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.checkStatement(QueryFormatTest.java:80)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.testChildStarName(QueryFormatTest.java:71)
> {code}
> This is a regression from Jackrabbit 1.6.5, where a similar test does run, i.e. parsing does not throw exception.
> The same NPE happens when "child::" is dropped, i.e. when the query looks like this:
> {code}
> "//element(*, foo)[*/@bar = 'bla']"
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (JCR-3435) NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)

Posted by "Bart van der Schans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bart van der Schans reassigned JCR-3435:
----------------------------------------

    Assignee: Bart van der Schans
    
> NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-3435
>                 URL: https://issues.apache.org/jira/browse/JCR-3435
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 2.4.2, 2.4.4, 2.5.2, 2.6
>            Reporter: Jörg von Frantzius
>            Assignee: Bart van der Schans
>              Labels: queryparser, xpath
>             Fix For: 2.4.4, 2.6
>
>         Attachments: xpathqueryparser.patch
>
>
> When adding the following to {{org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest}}:
> {code}
>     public void testChildStarName() throws Exception {
>         checkStatement("//element(*, foo)[child::*/@bar = 'bla']");
>     }
> {code}
> a NullPointerException is thrown while parsing:
> {code}
> java.lang.NullPointerException
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:351)
>         at org.apache.jackrabbit.spi.commons.query.RelationQueryNode.accept(RelationQueryNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:317)
>         at org.apache.jackrabbit.spi.commons.query.LocationStepQueryNode.accept(LocationStepQueryNode.java:166)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:260)
>         at org.apache.jackrabbit.spi.commons.query.PathQueryNode.accept(PathQueryNode.java:74)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:115)
>         at org.apache.jackrabbit.spi.commons.query.QueryRootNode.accept(QueryRootNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.<init>(QueryFormat.java:75)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.toString(QueryFormat.java:95)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.checkStatement(QueryFormatTest.java:80)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.testChildStarName(QueryFormatTest.java:71)
> {code}
> This is a regression from Jackrabbit 1.6.5, where a similar test does run, i.e. parsing does not throw exception.
> The same NPE happens when "child::" is dropped, i.e. when the query looks like this:
> {code}
> "//element(*, foo)[*/@bar = 'bla']"
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-3435) NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)

Posted by "Jörg von Frantzius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg von Frantzius updated JCR-3435:
------------------------------------

    Fix Version/s: 2.4.2
                   2.6
           Labels: queryparser xpath  (was: )
           Status: Patch Available  (was: Open)

The attached patch solves the two different NullPointerExceptions for the valid XPath queries "//element(*, foo)[*/*/@bar = 'bla']" and "//programs//*[*/@sunday]"

Successful parsing of both queries is tested in QueryFormatTest (included in the patch).

                
> NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-3435
>                 URL: https://issues.apache.org/jira/browse/JCR-3435
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 2.5.2, 2.4.2, 2.6
>            Reporter: Jörg von Frantzius
>              Labels: xpath, queryparser
>             Fix For: 2.6, 2.4.2
>
>         Attachments: xpathqueryparser.patch
>
>
> When adding the following to {{org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest}}:
> {code}
>     public void testChildStarName() throws Exception {
>         checkStatement("//element(*, foo)[child::*/@bar = 'bla']");
>     }
> {code}
> a NullPointerException is thrown while parsing:
> {code}
> java.lang.NullPointerException
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:351)
>         at org.apache.jackrabbit.spi.commons.query.RelationQueryNode.accept(RelationQueryNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:317)
>         at org.apache.jackrabbit.spi.commons.query.LocationStepQueryNode.accept(LocationStepQueryNode.java:166)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:260)
>         at org.apache.jackrabbit.spi.commons.query.PathQueryNode.accept(PathQueryNode.java:74)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:115)
>         at org.apache.jackrabbit.spi.commons.query.QueryRootNode.accept(QueryRootNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.<init>(QueryFormat.java:75)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.toString(QueryFormat.java:95)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.checkStatement(QueryFormatTest.java:80)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.testChildStarName(QueryFormatTest.java:71)
> {code}
> This is a regression from Jackrabbit 1.6.5, where a similar test does run, i.e. parsing does not throw exception.
> The same NPE happens when "child::" is dropped, i.e. when the query looks like this:
> {code}
> "//element(*, foo)[*/@bar = 'bla']"
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (JCR-3435) NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)

Posted by "Bart van der Schans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13468410#comment-13468410 ] 

Bart van der Schans commented on JCR-3435:
------------------------------------------

Hi Jörg,

Thanks for the patch! I've applied it to trunk. 

Can somebody else have a second look before I backport this to 2.4 and possibly 2.2?

Bart
                
> NPE on parsing XPath query with child axis and star name at beginning (regression from 1.6.x)
> ---------------------------------------------------------------------------------------------
>
>                 Key: JCR-3435
>                 URL: https://issues.apache.org/jira/browse/JCR-3435
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 2.4.2, 2.4.4, 2.5.2, 2.6
>            Reporter: Jörg von Frantzius
>              Labels: queryparser, xpath
>             Fix For: 2.4.4, 2.6
>
>         Attachments: xpathqueryparser.patch
>
>
> When adding the following to {{org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest}}:
> {code}
>     public void testChildStarName() throws Exception {
>         checkStatement("//element(*, foo)[child::*/@bar = 'bla']");
>     }
> {code}
> a NullPointerException is thrown while parsing:
> {code}
> java.lang.NullPointerException
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:351)
>         at org.apache.jackrabbit.spi.commons.query.RelationQueryNode.accept(RelationQueryNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:317)
>         at org.apache.jackrabbit.spi.commons.query.LocationStepQueryNode.accept(LocationStepQueryNode.java:166)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:260)
>         at org.apache.jackrabbit.spi.commons.query.PathQueryNode.accept(PathQueryNode.java:74)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.visit(QueryFormat.java:115)
>         at org.apache.jackrabbit.spi.commons.query.QueryRootNode.accept(QueryRootNode.java:115)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.<init>(QueryFormat.java:75)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormat.toString(QueryFormat.java:95)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.checkStatement(QueryFormatTest.java:80)
>         at org.apache.jackrabbit.spi.commons.query.xpath.QueryFormatTest.testChildStarName(QueryFormatTest.java:71)
> {code}
> This is a regression from Jackrabbit 1.6.5, where a similar test does run, i.e. parsing does not throw exception.
> The same NPE happens when "child::" is dropped, i.e. when the query looks like this:
> {code}
> "//element(*, foo)[*/@bar = 'bla']"
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira