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

assertion derived class modifier from parent class silently breaks backward compatibility

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 3.3
    • None
    • core/index
    • None
    • New

    Description

      after upgrading to lucene 3.1+, I see this in my log:

      java.lang.AssertionError: TokenStream implementation classes or at least their incrementToken() implementation must be final
      at org.apache.lucene.analysis.TokenStream.assertFinal(TokenStream.java:117)
      at org.apache.lucene.analysis.TokenStream.<init>(TokenStream.java:92)

      Turns out I derived TokenStream and my class was not declared final.

      This silently breaks backward compatibility via reflection, scary...

      I think doing this sort of check is fine, but throwing an java.lang.AssertionError in this case is too stringent.

      This is a style check against lucene clients, a error log would be fine, but throwing an Error is too much.

      See constructor implementation for: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/analysis/TokenStream.java?view=markup

      Attachments

        1. LUCENE-3420.patch
          1 kB
          Uwe Schindler

        Activity

          People

            uschindler Uwe Schindler
            john.wang@gmail.com John Wang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: