Lucene - Core
  1. Lucene - Core
  2. LUCENE-2277

QueryNodeImpl throws ConcurrentModificationException on add(List<QueryNode>)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 2.9.4, 3.0.3, 3.1, 4.0-ALPHA
    • Component/s: modules/other
    • Labels:
      None
    • Environment:

      all

    • Lucene Fields:
      New, Patch Available

      Description

      on adding a List of children to a QueryNodeImplemention a ConcurrentModificationException is thrown.
      This is due to the fact that QueryNodeImpl instead of iteration over the supplied list, iterates over its internal clauses List.

      Patch:
      Index: QueryNodeImpl.java
      ===================================================================
      — QueryNodeImpl.java (revision 911642)
      +++ QueryNodeImpl.java (working copy)
      @@ -74,7 +74,7 @@
      .getLocalizedMessage(QueryParserMessages.NODE_ACTION_NOT_SUPPORTED));
      }

      • for (QueryNode child : getChildren()) {
        + for (QueryNode child : children) { add(child); }
      1. LUCENE-2277.patch
        3 kB
        Robert Muir
      2. addChildren.patch
        0.4 kB
        Frank Wesemann

        Activity

        Hide
        Robert Muir added a comment -

        Committed 3.0.x revision 1028758
        Committed 2.9.x revision 1028759

        Show
        Robert Muir added a comment - Committed 3.0.x revision 1028758 Committed 2.9.x revision 1028759
        Hide
        Robert Muir added a comment -

        reopening for possible 2.9.4/3.0.3 backport.

        Show
        Robert Muir added a comment - reopening for possible 2.9.4/3.0.3 backport.
        Hide
        Robert Muir added a comment -

        Simon you could also say the bug was adding a List to itself... either way it was wrong.

        I liked the way Frank describes it because if someone else hit this bug, then they will
        recognize the exception message in CHANGES.

        Show
        Robert Muir added a comment - Simon you could also say the bug was adding a List to itself... either way it was wrong. I liked the way Frank describes it because if someone else hit this bug, then they will recognize the exception message in CHANGES.
        Hide
        Simon Willnauer added a comment -

        Robert, should the changes text rather say something about the argument that was completely ignored. This was simply a bug due to ignoring the argument but calling a similar named method. Could be a bit picky but I thought I should mention it.

        Simon

        Show
        Simon Willnauer added a comment - Robert, should the changes text rather say something about the argument that was completely ignored. This was simply a bug due to ignoring the argument but calling a similar named method. Could be a bit picky but I thought I should mention it. Simon
        Hide
        Robert Muir added a comment -

        Committed revision 919869.

        Thanks Frank!

        Show
        Robert Muir added a comment - Committed revision 919869. Thanks Frank!
        Hide
        Robert Muir added a comment -

        attached is Frank's patch, with a testcase that fails with
        ConcurrentModificationException as he describes, and passes
        with the patch.

        will commit soon.

        Show
        Robert Muir added a comment - attached is Frank's patch, with a testcase that fails with ConcurrentModificationException as he describes, and passes with the patch. will commit soon.
        Hide
        Frank Wesemann added a comment -

        iterates over the supplied List of QueryNodes.

        Show
        Frank Wesemann added a comment - iterates over the supplied List of QueryNodes.

          People

          • Assignee:
            Robert Muir
            Reporter:
            Frank Wesemann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development