You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2010/12/16 18:25:01 UTC

svn commit: r1050064 - /lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/core/Config.java

Author: rmuir
Date: Thu Dec 16 17:25:01 2010
New Revision: 1050064

URL: http://svn.apache.org/viewvc?rev=1050064&view=rev
Log:
SOLR-2259: (3.x only) warn if luceneMatchVersion isn't in the config, explaining it will be required in 4.0, and that its defaulting to 2.4 emulation

Modified:
    lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/core/Config.java

Modified: lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/core/Config.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/core/Config.java?rev=1050064&r1=1050063&r2=1050064&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/core/Config.java (original)
+++ lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/core/Config.java Thu Dec 16 17:25:01 2010
@@ -281,7 +281,19 @@ public class Config {
    
    public Version getLuceneVersion(String path, Version def) {
      String val = getVal(path, false);
-     return val!=null ? parseLuceneVersionString(val) : def;
+     if (val == null) {
+       if (!versionWarningAlreadyLogged.getAndSet(true)) {
+         log.warn(
+           "the luceneMatchVersion is not specified, defaulting to " + def + 
+           " emulation. You should at some point declare and reindex to at least 3.0, " +
+           "because 2.4 emulation is deprecated and will be removed in 4.0. " + 
+           "This parameter will be mandatory in 4.0."
+         );
+       }
+       return def;
+     } else {
+       return parseLuceneVersionString(val);
+     }
    }
   
   private static final AtomicBoolean versionWarningAlreadyLogged = new AtomicBoolean(false);