Lucene - Core
  1. Lucene - Core
  2. LUCENE-2855

Contrib queryparser should not use CharSequence as Map key

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.3
    • Fix Version/s: 3.0.4
    • Component/s: modules/other
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Today, contrib query parser uses Map<CharSequence,...> in many different places, which may lead to problems, since CharSequence interface does not enforce the implementation of hashcode and equals methods. Today, it's causing a problem with QueryTreeBuilder.setBuilder(CharSequence,QueryBuilder) method, that does not works as expected.

        Issue Links

          Activity

          Hide
          Adriano Crestani added a comment -

          Here is the fix for the problem raised at thread [1]. The patch also includes a junit to make sure the problem doesn't show up again.

          If there are no concerns in two days, I will go ahead and commit the patch.

          [1] - http://lucene.markmail.org/thread/mbb5wlxttsa6sges

          Show
          Adriano Crestani added a comment - Here is the fix for the problem raised at thread [1] . The patch also includes a junit to make sure the problem doesn't show up again. If there are no concerns in two days, I will go ahead and commit the patch. [1] - http://lucene.markmail.org/thread/mbb5wlxttsa6sges
          Hide
          Uwe Schindler added a comment -

          +1 to commit.

          In general, one should never use interfaces as keys in maps (as long as they don't declare the equals and hashcode methods inside the interface).

          Show
          Uwe Schindler added a comment - +1 to commit. In general, one should never use interfaces as keys in maps (as long as they don't declare the equals and hashcode methods inside the interface).
          Hide
          Uwe Schindler added a comment -

          One thing in your patch: Lucene tests should always extend LuceneTestCase (which is Junit4)

          Show
          Uwe Schindler added a comment - One thing in your patch: Lucene tests should always extend LuceneTestCase (which is Junit4)
          Hide
          Simon Willnauer added a comment -

          +1 - just put your name after the description in the changes.txt

          Show
          Simon Willnauer added a comment - +1 - just put your name after the description in the changes.txt
          Hide
          Adriano Crestani added a comment -

          Thanks for pointing out the problems, here is the new patch

          Show
          Adriano Crestani added a comment - Thanks for pointing out the problems, here is the new patch
          Hide
          Adriano Crestani added a comment -

          patch applied on revision 1057454

          Show
          Adriano Crestani added a comment - patch applied on revision 1057454

            People

            • Assignee:
              Adriano Crestani
              Reporter:
              Adriano Crestani
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development