Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7926

Unsafe type cast in flexible parser QueryNodeImpl

Details

    • Bug
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • New

    Description

      org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImplL67 casts the argument to QueryNodeImpl although the rest of the code is written against the QueryNode interface. This blows up in cases where a non-inheriting implementation is passed (such as using a wrapper/decorator class).

      The relevant setParent method does not exist on the interface, so the most backwards compatible short term fix would be to wrap the cast in a conditional to ensure it is safe (more significant changes to the hierarchy may make sense but this seems like a fairly stable module).

      Patch enclosed...

      Attachments

        1. LUCENE-7926.patch
          4 kB
          Matt Whipple

        Activity

          People

            Unassigned Unassigned
            mwhipple Matt Whipple
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: