Justin Edelson created OAK-1895:
-----------------------------------

             Summary: ClassCastException can occur if the TraversalIndex is 
cheaper than an OrderedIndex (or a different AdvancedQueryIndex impl)
                 Key: OAK-1895
                 URL: https://issues.apache.org/jira/browse/OAK-1895
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: query
            Reporter: Justin Edelson
             Fix For: 1.0.2


Because the TraversalIndex is added last, the `bestPlan` variable will be 
non-null if an OrderedIndex was usable for the query. If the TraversalIndex 
ends up being cheaper, then the `bestIndex` variable is set to the 
TraveralIndex, but the `bestPlan` remains set to a non-null value.

Later, in SelectorImpl, the fact that the plan is non-null causes the index to 
be cast to AdvancedQueryIndex which fails with a ClassCastException.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to