Lucene - Core
  1. Lucene - Core
  2. LUCENE-2004

Constants.LUCENE_MAIN_VERSION is inlined in code compiled against Lucene JAR, so version detection is incorrect

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9.1, 3.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      When you compile your own code against the Lucene 2.9 version of the JARs and use the LUCENE_MAIN_VERSION constant and then run the code against the 3.0 JAR, the constant still contains 2.9, because javac inlines primitives and Strings into the class files if they are public static final and are generated by a constant (not method).

      The attached fix will fix this by using a ident(String) functions that return the String itsself to prevent this inlining.

      Will apply to 2.9, trunk and 2.9 BW branch. No I can also reenable one test I removed because of this.

      1. LUCENE-2004.patch
        0.9 kB
        Uwe Schindler

        Activity

        Hide
        Uwe Schindler added a comment -
        Show
        Uwe Schindler added a comment - See also: http://www.javaworld.com/community/node/3400
        Hide
        Uwe Schindler added a comment -

        Fixed.

        Show
        Uwe Schindler added a comment - Fixed.
        Hide
        Michael McCandless added a comment -

        Bulk close all 2.9.1 issues.

        Show
        Michael McCandless added a comment - Bulk close all 2.9.1 issues.

          People

          • Assignee:
            Uwe Schindler
            Reporter:
            Uwe Schindler
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development