lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r779625 - in /lucene/java/trunk/src: java/org/apache/lucene/util/Constants.java test/org/apache/lucene/index/TestCheckIndex.java
Date Thu, 28 May 2009 15:38:45 GMT
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));
   }
 }



Mime
View raw message