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 mi...@apache.org on 2009/05/28 17:38:45 UTC
svn commit: r779625 - in /lucene/java/trunk/src:
java/org/apache/lucene/util/Constants.java
test/org/apache/lucene/index/TestCheckIndex.java
Author: mikemccand
Date: Thu May 28 15:38:44 2009
New Revision: 779625
URL: http://svn.apache.org/viewvc?rev=779625&view=rev
Log:
LUCENE-1666: if JAR has null impl version, fallback to Lucene's main version; also add main version in, if the JAR's impl version doesn't contain it
Modified:
lucene/java/trunk/src/java/org/apache/lucene/util/Constants.java
lucene/java/trunk/src/test/org/apache/lucene/index/TestCheckIndex.java
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=779625&r1=779624&r2=779625&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 May 28 15:38:44 2009
@@ -56,10 +56,10 @@
public static final String LUCENE_VERSION;
- public static final String LUCENE_MAIN_VERSION = "2.9-dev";
+ public static final String LUCENE_MAIN_VERSION = "2.9";
static {
- String v = LUCENE_MAIN_VERSION;
+ String v = LUCENE_MAIN_VERSION + "-dev";
try {
// TODO: this should have worked, but doesn't seem to?
// Package.getPackage("org.apache.lucene.util").getImplementationVersion();
@@ -69,7 +69,14 @@
try {
Manifest manifest = new Manifest(s);
Attributes attr = manifest.getMainAttributes();
- v = attr.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
+ String value = attr.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
+ if (value != null) {
+ if (value.indexOf(LUCENE_MAIN_VERSION) == -1) {
+ v = value + " [" + LUCENE_MAIN_VERSION + "]";
+ } else {
+ v = value;
+ }
+ }
} finally {
if (s != null) {
s.close();
Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestCheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestCheckIndex.java?rev=779625&r1=779624&r2=779625&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestCheckIndex.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestCheckIndex.java Thu May 28 15:38:44 2009
@@ -71,7 +71,7 @@
public void testLuceneConstantVersion() throws IOException {
// common-build.xml sets lucene.version
final String version = System.getProperty("lucene.version");
- assertEquals(version, Constants.LUCENE_MAIN_VERSION);
+ assertEquals(version, Constants.LUCENE_MAIN_VERSION+"-dev");
assertTrue(Constants.LUCENE_VERSION.startsWith(version));
}
}