mirror of https://github.com/apache/lucene.git
LUCENE-2004: Constants.LUCENE_MAIN_VERSION may not be inlined in code compiled against Lucene JAR
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@828331 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d1fc6bece6
commit
abf2f86302
|
@ -122,6 +122,9 @@ Bug fixes
|
|||
cannot exceed 2048 MB, and throw IllegalArgumentException if it
|
||||
does. (Aaron McKee, Yonik Seeley, Mike McCandless)
|
||||
|
||||
* LUCENE-2004: Fix Constants.LUCENE_MAIN_VERSION to not be inlined
|
||||
by client code. (Uwe Schindler)
|
||||
|
||||
New features
|
||||
|
||||
* LUCENE-1933: Provide a convenience AttributeFactory that creates a
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<property name="Name" value="Lucene"/>
|
||||
<property name="dev.version" value="3.0-dev"/>
|
||||
<property name="version" value="${dev.version}"/>
|
||||
<property name="compatibility.tag" value="lucene_2_9_back_compat_tests_20091021a"/>
|
||||
<property name="compatibility.tag" value="lucene_2_9_back_compat_tests_20091022"/>
|
||||
<property name="spec.version" value="${version}"/>
|
||||
<property name="year" value="2000-${current.year}"/>
|
||||
<property name="final.name" value="lucene-${name}-${version}"/>
|
||||
|
|
|
@ -64,7 +64,13 @@ public final class Constants {
|
|||
}
|
||||
}
|
||||
|
||||
public static final String LUCENE_MAIN_VERSION = "3.0";
|
||||
// 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("3.0");
|
||||
|
||||
public static final String LUCENE_VERSION;
|
||||
static {
|
||||
|
@ -75,6 +81,6 @@ public final class Constants {
|
|||
} else if (v.indexOf(LUCENE_MAIN_VERSION) == -1) {
|
||||
v = v + " [" + LUCENE_MAIN_VERSION + "]";
|
||||
}
|
||||
LUCENE_VERSION = v;
|
||||
LUCENE_VERSION = ident(v);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue