Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3713

Exception in GQL if it starts with OR expression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.3
    • None
    • jackrabbit-jcr-commons
    • None

    Description

      These GQL queries lead to an ArrayIndexOutOfBoundsException:

      OR property:something
      path:/content OR property:something

      This is because GQL#pushExpression() will blindly replace the previous entry in the "conditions" list, even if it is still empty.

      Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
      	at java.util.ArrayList.get(ArrayList.java:324)
      	at org.apache.jackrabbit.commons.query.GQL.pushExpression(GQL.java:798)
      	at org.apache.jackrabbit.commons.query.GQL.access$000(GQL.java:133)
      	at org.apache.jackrabbit.commons.query.GQL$1.term(GQL.java:426)
      	at org.apache.jackrabbit.commons.query.GQL.parse(GQL.java:682)
      	at org.apache.jackrabbit.commons.query.GQL.translateStatement(GQL.java:423)
      	at org.apache.jackrabbit.commons.query.GQL.execute(GQL.java:389)
      	at org.apache.jackrabbit.commons.query.GQL.execute(GQL.java:322)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            alexander.klimetschek Alexander Klimetschek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: