Index: src/java/org/apache/lucene/util/Constants.java =================================================================== --- src/java/org/apache/lucene/util/Constants.java (revision 828082) +++ src/java/org/apache/lucene/util/Constants.java (working copy) @@ -66,9 +66,15 @@ } } } + + // this method prevents inlining the final version constant in compiled classes, + // see: http://www.javaworld.com/community/node/3400 + private static String ident(final String s) { + return s.toString(); + } + + public static final String LUCENE_MAIN_VERSION = ident("2.9"); - public static final String LUCENE_MAIN_VERSION = "2.9"; - public static final String LUCENE_VERSION; static { Package pkg = LucenePackage.get(); @@ -78,6 +84,6 @@ } else if (v.indexOf(LUCENE_MAIN_VERSION) == -1) { v = v + " [" + LUCENE_MAIN_VERSION + "]"; } - LUCENE_VERSION = v; + LUCENE_VERSION = ident(v); } }