You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by us...@apache.org on 2009/10/22 08:50:37 UTC
svn commit: r828331 - in /lucene/java/trunk: CHANGES.txt common-build.xml
src/java/org/apache/lucene/util/Constants.java
Author: uschindler
Date: Thu Oct 22 06:50:37 2009
New Revision: 828331
URL: http://svn.apache.org/viewvc?rev=828331&view=rev
Log:
LUCENE-2004: Constants.LUCENE_MAIN_VERSION may not be inlined in code compiled against Lucene JAR
Modified:
lucene/java/trunk/CHANGES.txt
lucene/java/trunk/common-build.xml
lucene/java/trunk/src/java/org/apache/lucene/util/Constants.java
Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=828331&r1=828330&r2=828331&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Thu Oct 22 06:50:37 2009
@@ -122,6 +122,9 @@
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
Modified: lucene/java/trunk/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/common-build.xml?rev=828331&r1=828330&r2=828331&view=diff
==============================================================================
--- lucene/java/trunk/common-build.xml (original)
+++ lucene/java/trunk/common-build.xml Thu Oct 22 06:50:37 2009
@@ -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}"/>
Modified: lucene/java/trunk/src/java/org/apache/lucene/util/Constants.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/Constants.java?rev=828331&r1=828330&r2=828331&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/Constants.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/Constants.java Thu Oct 22 06:50:37 2009
@@ -64,7 +64,13 @@
}
}
- 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 @@
} else if (v.indexOf(LUCENE_MAIN_VERSION) == -1) {
v = v + " [" + LUCENE_MAIN_VERSION + "]";
}
- LUCENE_VERSION = v;
+ LUCENE_VERSION = ident(v);
}
}