lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r827979 [2/3] - in /lucene/java/trunk: ./ contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/br/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/cjk/ co...
Date Wed, 21 Oct 2009 12:12:14 GMT
Modified: lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java Wed Oct 21 12:12:11 2009
@@ -28,6 +28,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
+import java.util.Collections;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.KeywordAnalyzer;
@@ -72,6 +73,7 @@
 import org.apache.lucene.search.WildcardQuery;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.util.LocalizedTestCase;
+import org.apache.lucene.util.Version;
 
 /**
  * This test case is a copy of the core Lucene query parser test, it was adapted
@@ -375,7 +377,7 @@
         "+(title:dog title:cat) -author:\"bob dole\"");
 
     QueryParserWrapper qp = new QueryParserWrapper("field",
-        new StandardAnalyzer());
+        new StandardAnalyzer(Version.LUCENE_CURRENT));
     // make sure OR is the default:
     assertEquals(QueryParserWrapper.OR_OPERATOR, qp.getDefaultOperator());
     qp.setDefaultOperator(QueryParserWrapper.AND_OPERATOR);
@@ -406,7 +408,7 @@
     assertQueryEquals("term 1.0 1 2", null, "term");
     assertQueryEquals("term term1 term2", null, "term term term");
 
-    Analyzer a = new StandardAnalyzer();
+    Analyzer a = new StandardAnalyzer(Version.LUCENE_CURRENT);
     assertQueryEquals("3", a, "3");
     assertQueryEquals("term 1.0 1 2", a, "term 1.0 1 2");
     assertQueryEquals("term term1 term2", a, "term term1 term2");
@@ -882,8 +884,7 @@
   }
 
   public void testBoost() throws Exception {
-    StandardAnalyzer oneStopAnalyzer = new StandardAnalyzer(
-        new String[] { "on" });
+    StandardAnalyzer oneStopAnalyzer = new StandardAnalyzer(Version.LUCENE_CURRENT, Collections.singleton("on"));
     QueryParserWrapper qp = new QueryParserWrapper("field", oneStopAnalyzer);
     Query q = qp.parse("on^1.0");
     assertNotNull(q);
@@ -897,7 +898,7 @@
     assertNotNull(q);
 
     QueryParserWrapper qp2 = new QueryParserWrapper("field",
-        new StandardAnalyzer());
+        new StandardAnalyzer(Version.LUCENE_CURRENT));
     q = qp2.parse("the^3");
     // "the" is a stop word so the result is an empty query:
     assertNotNull(q);
@@ -1047,8 +1048,7 @@
   }
 
   public void testStopwords() throws Exception {
-    QueryParserWrapper qp = new QueryParserWrapper("a", new StopAnalyzer(
-        new String[] { "the", "foo" }));
+    QueryParserWrapper qp = new QueryParserWrapper("a", new StopAnalyzer(StopFilter.makeStopSet("the", "foo"), false));
     Query result = qp.parse("a:the OR a:foo");
     assertNotNull("result is null and it shouldn't be", result);
     assertTrue("result is not a BooleanQuery", result instanceof BooleanQuery);
@@ -1067,28 +1067,20 @@
   }
 
   public void testPositionIncrement() throws Exception {
-    boolean dflt = StopFilter.getEnablePositionIncrementsDefault();
-    StopFilter.setEnablePositionIncrementsDefault(true);
-    try {
-      QueryParserWrapper qp = new QueryParserWrapper("a", new StopAnalyzer(
-          new String[] { "the", "in", "are", "this" }));
-      qp.setEnablePositionIncrements(true);
-      String qtxt = "\"the words in poisitions pos02578 are stopped in this phrasequery\"";
-      // 0 2 5 7 8
-      int expectedPositions[] = { 1, 3, 4, 6, 9 };
-      PhraseQuery pq = (PhraseQuery) qp.parse(qtxt);
-      // System.out.println("Query text: "+qtxt);
-      // System.out.println("Result: "+pq);
-      Term t[] = pq.getTerms();
-      int pos[] = pq.getPositions();
-      for (int i = 0; i < t.length; i++) {
-        // System.out.println(i+". "+t[i]+"  pos: "+pos[i]);
-        assertEquals("term " + i + " = " + t[i] + " has wrong term-position!",
-            expectedPositions[i], pos[i]);
-      }
-
-    } finally {
-      StopFilter.setEnablePositionIncrementsDefault(dflt);
+    QueryParserWrapper qp = new QueryParserWrapper("a", new StopAnalyzer(StopFilter.makeStopSet("the", "in", "are", "this"), true));
+    qp.setEnablePositionIncrements(true);
+    String qtxt = "\"the words in poisitions pos02578 are stopped in this phrasequery\"";
+    // 0 2 5 7 8
+    int expectedPositions[] = { 1, 3, 4, 6, 9 };
+    PhraseQuery pq = (PhraseQuery) qp.parse(qtxt);
+    // System.out.println("Query text: "+qtxt);
+    // System.out.println("Result: "+pq);
+    Term t[] = pq.getTerms();
+    int pos[] = pq.getPositions();
+    for (int i = 0; i < t.length; i++) {
+      // System.out.println(i+". "+t[i]+"  pos: "+pos[i]);
+      assertEquals("term " + i + " = " + t[i] + " has wrong term-position!",
+          expectedPositions[i], pos[i]);
     }
   }
 

Modified: lucene/java/trunk/contrib/regex/src/test/org/apache/lucene/search/regex/TestSpanRegexQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/regex/src/test/org/apache/lucene/search/regex/TestSpanRegexQuery.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/contrib/regex/src/test/org/apache/lucene/search/regex/TestSpanRegexQuery.java (original)
+++ lucene/java/trunk/contrib/regex/src/test/org/apache/lucene/search/regex/TestSpanRegexQuery.java Wed Oct 21 12:12:11 2009
@@ -109,14 +109,14 @@
         Field.Index.ANALYZED_NO_NORMS));
 
     // creating first index writer
-    IndexWriter writerA = new IndexWriter(indexStoreA, new StandardAnalyzer(),
+    IndexWriter writerA = new IndexWriter(indexStoreA, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
         true, IndexWriter.MaxFieldLength.LIMITED);
     writerA.addDocument(lDoc);
     writerA.optimize();
     writerA.close();
 
     // creating second index writer
-    IndexWriter writerB = new IndexWriter(indexStoreB, new StandardAnalyzer(),
+    IndexWriter writerB = new IndexWriter(indexStoreB, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
         true, IndexWriter.MaxFieldLength.LIMITED);
     writerB.addDocument(lDoc2);
     writerB.optimize();

Modified: lucene/java/trunk/contrib/snowball/src/java/org/apache/lucene/analysis/snowball/SnowballAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/snowball/src/java/org/apache/lucene/analysis/snowball/SnowballAnalyzer.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/contrib/snowball/src/java/org/apache/lucene/analysis/snowball/SnowballAnalyzer.java (original)
+++ lucene/java/trunk/contrib/snowball/src/java/org/apache/lucene/analysis/snowball/SnowballAnalyzer.java Wed Oct 21 12:12:11 2009
@@ -55,7 +55,7 @@
     result = new StandardFilter(result);
     result = new LowerCaseFilter(result);
     if (stopSet != null)
-      result = new StopFilter(result, stopSet);
+      result = new StopFilter(false, result, stopSet);
     result = new SnowballFilter(result, name);
     return result;
   }
@@ -84,7 +84,7 @@
       streams.result = new StandardFilter(streams.source);
       streams.result = new LowerCaseFilter(streams.result);
       if (stopSet != null)
-        streams.result = new StopFilter(streams.result, stopSet);
+        streams.result = new StopFilter(false, streams.result, stopSet);
       streams.result = new SnowballFilter(streams.result, name);
       setPreviousTokenStream(streams);
     } else {

Modified: lucene/java/trunk/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java (original)
+++ lucene/java/trunk/contrib/wordnet/src/java/org/apache/lucene/wordnet/SynExpand.java Wed Oct 21 12:12:11 2009
@@ -42,6 +42,7 @@
 import org.apache.lucene.search.Searcher;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.util.Version;
 
 
 /**
@@ -77,7 +78,7 @@
 		String query = args[1];
 		String field = "contents";
 
-		Query q = expand( query, searcher, new StandardAnalyzer(), field, 0.9f);
+		Query q = expand( query, searcher, new StandardAnalyzer(Version.LUCENE_CURRENT), field, 0.9f);
 		System.out.println( "Query: " + q.toString( field));
 
 
@@ -112,7 +113,7 @@
 		final Set already = new HashSet(); // avoid dups 
 		List top = new LinkedList(); // needs to be separately listed..
 		final String field = ( f == null) ? "contents" : f;
-		if ( a == null) a = new StandardAnalyzer();
+		if ( a == null) a = new StandardAnalyzer(Version.LUCENE_CURRENT);
 
 		// [1] Parse query into separate words so that when we expand we can avoid dups
 		TokenStream ts = a.tokenStream( field, new StringReader( query));

Modified: lucene/java/trunk/contrib/wordnet/src/java/org/apache/lucene/wordnet/Syns2Index.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/wordnet/src/java/org/apache/lucene/wordnet/Syns2Index.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/contrib/wordnet/src/java/org/apache/lucene/wordnet/Syns2Index.java (original)
+++ lucene/java/trunk/contrib/wordnet/src/java/org/apache/lucene/wordnet/Syns2Index.java Wed Oct 21 12:12:11 2009
@@ -36,6 +36,7 @@
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.util.Version;
 
 /**
  * Convert the prolog file wn_s.pl from the <a href="http://www.cogsci.princeton.edu/2.0/WNprolog-2.0.tar.gz">WordNet prolog download</a>
@@ -88,7 +89,7 @@
 	/**
 	 *
 	 */
-    private static final Analyzer ana = new StandardAnalyzer();
+    private static final Analyzer ana = new StandardAnalyzer(Version.LUCENE_CURRENT);
 
     /**
      * Takes arg of prolog file name and index directory.

Modified: lucene/java/trunk/contrib/xml-query-parser/src/demo/java/org/apache/lucene/xmlparser/webdemo/FormBasedXmlQueryDemo.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/xml-query-parser/src/demo/java/org/apache/lucene/xmlparser/webdemo/FormBasedXmlQueryDemo.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/contrib/xml-query-parser/src/demo/java/org/apache/lucene/xmlparser/webdemo/FormBasedXmlQueryDemo.java (original)
+++ lucene/java/trunk/contrib/xml-query-parser/src/demo/java/org/apache/lucene/xmlparser/webdemo/FormBasedXmlQueryDemo.java Wed Oct 21 12:12:11 2009
@@ -51,7 +51,7 @@
 	private QueryTemplateManager queryTemplateManager;
 	private CorePlusExtensionsParser xmlParser;
 	private IndexSearcher searcher;
-	private Analyzer analyzer=new StandardAnalyzer();
+	private Analyzer analyzer=new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT);
 
 	public void init(ServletConfig config) throws ServletException {
 		super.init(config);

Modified: lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java (original)
+++ lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java Wed Oct 21 12:12:11 2009
@@ -39,7 +39,8 @@
 
 	CoreParser builder;
 	static Directory dir;
-	Analyzer analyzer=new StandardAnalyzer();
+  // TODO: change to CURRENT and rewrite test (this needs to set QueryParser.enablePositionIncrements, too, for work with CURRENT):
+	Analyzer analyzer=new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_24); 
 	IndexReader reader;
 	private IndexSearcher searcher;
 	

Modified: lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestQueryTemplateManager.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestQueryTemplateManager.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestQueryTemplateManager.java (original)
+++ lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestQueryTemplateManager.java Wed Oct 21 12:12:11 2009
@@ -42,7 +42,7 @@
 public class TestQueryTemplateManager extends TestCase {
 
 	CoreParser builder;
-	Analyzer analyzer=new StandardAnalyzer();
+	Analyzer analyzer=new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT);
 	private IndexSearcher searcher;
 	
 	//A collection of documents' field values for use in our tests

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/Analyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/analysis/Analyzer.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/Analyzer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/Analyzer.java Wed Oct 21 12:12:11 2009
@@ -84,25 +84,18 @@
     }
   }
 
-  protected boolean overridesTokenStreamMethod;
+  /** @deprecated */
+  protected boolean overridesTokenStreamMethod = false;
 
   /** @deprecated This is only present to preserve
    *  back-compat of classes that subclass a core analyzer
    *  and override tokenStream but not reusableTokenStream */
-  protected void setOverridesTokenStreamMethod(Class baseClass) {
-
-    final Class[] params = new Class[2];
-    params[0] = String.class;
-    params[1] = Reader.class;
-    
+  protected void setOverridesTokenStreamMethod(Class<? extends Analyzer> baseClass) {
     try {
-      Method m = this.getClass().getMethod("tokenStream", params);
-      if (m != null) {
-        overridesTokenStreamMethod = m.getDeclaringClass() != baseClass;
-      } else {
-        overridesTokenStreamMethod = false;
-      }
+      Method m = this.getClass().getMethod("tokenStream", String.class, Reader.class);
+      overridesTokenStreamMethod = m.getDeclaringClass() != baseClass;
     } catch (NoSuchMethodException nsme) {
+      // cannot happen, as baseClass is subclass of Analyzer through generics
       overridesTokenStreamMethod = false;
     }
   }
@@ -121,8 +114,7 @@
    * @param fieldName Fieldable name being indexed.
    * @return position increment gap, added to the next token emitted from {@link #tokenStream(String,Reader)}
    */
-  public int getPositionIncrementGap(String fieldName)
-  {
+  public int getPositionIncrementGap(String fieldName) {
     return 0;
   }
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/StopAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/analysis/StopAnalyzer.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/StopAnalyzer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/StopAnalyzer.java Wed Oct 21 12:12:11 2009
@@ -22,106 +22,47 @@
 import java.io.Reader;
 import java.util.Arrays;
 import java.util.Set;
+import java.util.List;
 
 /** Filters {@link LetterTokenizer} with {@link LowerCaseFilter} and {@link StopFilter}. */
 
 public final class StopAnalyzer extends Analyzer {
-  private final Set/*<String>*/ stopWords;
-  // @deprecated
-  private final boolean useDefaultStopPositionIncrement;
+  private final Set<?> stopWords;
   private final boolean enablePositionIncrements;
-
-  /** An array containing some common English words that are not usually useful
-    for searching. 
-    @deprecated Use {@link #ENGLISH_STOP_WORDS_SET} instead */
-  public static final String[] ENGLISH_STOP_WORDS = {
-    "a", "an", "and", "are", "as", "at", "be", "but", "by",
-    "for", "if", "in", "into", "is", "it",
-    "no", "not", "of", "on", "or", "such",
-    "that", "the", "their", "then", "there", "these",
-    "they", "this", "to", "was", "will", "with"
-  };
   
   /** An unmodifiable set containing some common English words that are not usually useful
   for searching.*/
-  public static final Set/*<String>*/ ENGLISH_STOP_WORDS_SET;
+  public static final Set<?> ENGLISH_STOP_WORDS_SET;
   
   static {
-	  final String[] stopWords = new String[]{
-  	    "a", "an", "and", "are", "as", "at", "be", "but", "by",
-	    "for", "if", "in", "into", "is", "it",
-	    "no", "not", "of", "on", "or", "such",
-	    "that", "the", "their", "then", "there", "these",
-	    "they", "this", "to", "was", "will", "with"
-	  };
-	  final CharArraySet stopSet = new CharArraySet(stopWords.length, false);
-    stopSet.addAll(Arrays.asList(stopWords));  
-	  ENGLISH_STOP_WORDS_SET = CharArraySet.unmodifiableSet(stopSet); 
+    final List<String> stopWords = Arrays.asList(
+      "a", "an", "and", "are", "as", "at", "be", "but", "by",
+      "for", "if", "in", "into", "is", "it",
+      "no", "not", "of", "on", "or", "such",
+      "that", "the", "their", "then", "there", "these",
+      "they", "this", "to", "was", "will", "with"
+    );
+    final CharArraySet stopSet = new CharArraySet(stopWords.size(), false);
+    stopSet.addAll(stopWords);  
+    ENGLISH_STOP_WORDS_SET = CharArraySet.unmodifiableSet(stopSet); 
   }
   
   /** Builds an analyzer which removes words in
-   * ENGLISH_STOP_WORDS.
-   * @deprecated Use {@link #StopAnalyzer(boolean)} instead */
-  public StopAnalyzer() {
-    stopWords = ENGLISH_STOP_WORDS_SET;
-    useDefaultStopPositionIncrement = true;
-    enablePositionIncrements = false;
-  }
-
-  /** Builds an analyzer which removes words in
-   *  ENGLISH_STOP_WORDS.
+   *  {@link #ENGLISH_STOP_WORDS}.
    * @param enablePositionIncrements See {@link
    * StopFilter#setEnablePositionIncrements} */
   public StopAnalyzer(boolean enablePositionIncrements) {
     stopWords = ENGLISH_STOP_WORDS_SET;
     this.enablePositionIncrements = enablePositionIncrements;
-    useDefaultStopPositionIncrement = false;
-  }
-
-  /** Builds an analyzer with the stop words from the given set.
-   * @deprecated Use {@link #StopAnalyzer(Set, boolean)} instead */
-  public StopAnalyzer(Set stopWords) {
-    this.stopWords = stopWords;
-    useDefaultStopPositionIncrement = true;
-    enablePositionIncrements = false;
   }
 
   /** Builds an analyzer with the stop words from the given set.
    * @param stopWords Set of stop words
    * @param enablePositionIncrements See {@link
    * StopFilter#setEnablePositionIncrements} */
-  public StopAnalyzer(Set stopWords, boolean enablePositionIncrements) {
+  public StopAnalyzer(Set<?> stopWords, boolean enablePositionIncrements) {
     this.stopWords = stopWords;
     this.enablePositionIncrements = enablePositionIncrements;
-    useDefaultStopPositionIncrement = false;
-  }
-
-  /** Builds an analyzer which removes words in the provided array.
-   * @deprecated Use {@link #StopAnalyzer(Set, boolean)} instead */
-  public StopAnalyzer(String[] stopWords) {
-    this.stopWords = StopFilter.makeStopSet(stopWords);
-    useDefaultStopPositionIncrement = true;
-    enablePositionIncrements = false;
-  }
-  
-  /** Builds an analyzer which removes words in the provided array.
-   * @param stopWords Array of stop words
-   * @param enablePositionIncrements See {@link
-   * StopFilter#setEnablePositionIncrements} 
-   * @deprecated Use {@link #StopAnalyzer(Set, boolean)} instead*/
-  public StopAnalyzer(String[] stopWords, boolean enablePositionIncrements) {
-    this.stopWords = StopFilter.makeStopSet(stopWords);
-    this.enablePositionIncrements = enablePositionIncrements;
-    useDefaultStopPositionIncrement = false;
-  }
-  
-  /** Builds an analyzer with the stop words from the given file.
-   * @see WordlistLoader#getWordSet(File)
-   * @deprecated Use {@link #StopAnalyzer(File, boolean)} instead */
-  public StopAnalyzer(File stopwordsFile) throws IOException {
-    stopWords = WordlistLoader.getWordSet(stopwordsFile);
-    useDefaultStopPositionIncrement = true;
-    enablePositionIncrements = false;
   }
 
   /** Builds an analyzer with the stop words from the given file.
@@ -132,17 +73,6 @@
   public StopAnalyzer(File stopwordsFile, boolean enablePositionIncrements) throws IOException {
     stopWords = WordlistLoader.getWordSet(stopwordsFile);
     this.enablePositionIncrements = enablePositionIncrements;
-    useDefaultStopPositionIncrement = false;
-  }
-
-  /** Builds an analyzer with the stop words from the given reader.
-   * @see WordlistLoader#getWordSet(Reader)
-   * @deprecated Use {@link #StopAnalyzer(Reader, boolean)} instead
-   */
-  public StopAnalyzer(Reader stopwords) throws IOException {
-    stopWords = WordlistLoader.getWordSet(stopwords);
-    useDefaultStopPositionIncrement = true;
-    enablePositionIncrements = false;
   }
 
   /** Builds an analyzer with the stop words from the given reader.
@@ -153,16 +83,11 @@
   public StopAnalyzer(Reader stopwords, boolean enablePositionIncrements) throws IOException {
     stopWords = WordlistLoader.getWordSet(stopwords);
     this.enablePositionIncrements = enablePositionIncrements;
-    useDefaultStopPositionIncrement = false;
   }
 
   /** Filters LowerCaseTokenizer with StopFilter. */
   public TokenStream tokenStream(String fieldName, Reader reader) {
-    if (useDefaultStopPositionIncrement) {
-      return new StopFilter(new LowerCaseTokenizer(reader), stopWords);
-    } else {
-      return new StopFilter(enablePositionIncrements, new LowerCaseTokenizer(reader), stopWords);
-    }
+    return new StopFilter(enablePositionIncrements, new LowerCaseTokenizer(reader), stopWords);
   }
 
   /** Filters LowerCaseTokenizer with StopFilter. */
@@ -175,11 +100,7 @@
     if (streams == null) {
       streams = new SavedStreams();
       streams.source = new LowerCaseTokenizer(reader);
-      if (useDefaultStopPositionIncrement) {
-        streams.result = new StopFilter(streams.source, stopWords);
-      } else {
-        streams.result = new StopFilter(enablePositionIncrements, streams.source, stopWords);
-      }
+      streams.result = new StopFilter(enablePositionIncrements, streams.source, stopWords);
       setPreviousTokenStream(streams);
     } else
       streams.source.reset(reader);

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/StopFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/analysis/StopFilter.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/StopFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/StopFilter.java Wed Oct 21 12:12:11 2009
@@ -32,82 +32,11 @@
 
 public final class StopFilter extends TokenFilter {
 
-  // deprecated
-  private static boolean ENABLE_POSITION_INCREMENTS_DEFAULT = false;
-
   private final CharArraySet stopWords;
-  private boolean enablePositionIncrements = ENABLE_POSITION_INCREMENTS_DEFAULT;
+  private boolean enablePositionIncrements = false;
 
   private TermAttribute termAtt;
   private PositionIncrementAttribute posIncrAtt;
-  
-  /**
-   * Construct a token stream filtering the given input.
-   * @deprecated Use {@link #StopFilter(boolean, TokenStream, String[])} instead
-   */
-  public StopFilter(TokenStream input, String [] stopWords)
-  {
-    this(ENABLE_POSITION_INCREMENTS_DEFAULT, input, stopWords, false);
-  }
-
-  /**
-   * Construct a token stream filtering the given input.
-   * @param enablePositionIncrements true if token positions should record the removed stop words
-   * @param input input TokenStream
-   * @param stopWords array of stop words
-   * @deprecated Use {@link #StopFilter(boolean, TokenStream, Set)} instead.
-   */
-  public StopFilter(boolean enablePositionIncrements, TokenStream input, String [] stopWords)
-  {
-    this(enablePositionIncrements, input, stopWords, false);
-  }
-
-  /**
-   * Constructs a filter which removes words from the input
-   * TokenStream that are named in the array of words.
-   * @deprecated Use {@link #StopFilter(boolean, TokenStream, String[], boolean)} instead
-   */
-  public StopFilter(TokenStream in, String[] stopWords, boolean ignoreCase) {
-    this(ENABLE_POSITION_INCREMENTS_DEFAULT, in, stopWords, ignoreCase);
-  }
-
-  /**
-   * Constructs a filter which removes words from the input
-   * TokenStream that are named in the array of words.
-   * @param enablePositionIncrements true if token positions should record the removed stop words
-   * @param in input TokenStream
-   * @param stopWords array of stop words
-   * @param ignoreCase true if case is ignored
-   * @deprecated Use {@link #StopFilter(boolean, TokenStream, Set, boolean)} instead.
-   */
-  public StopFilter(boolean enablePositionIncrements, TokenStream in, String[] stopWords, boolean ignoreCase) {
-    super(in);
-    this.stopWords = (CharArraySet)makeStopSet(stopWords, ignoreCase);
-    this.enablePositionIncrements = enablePositionIncrements;
-    init();
-  }
-
-
-  /**
-   * Construct a token stream filtering the given input.
-   * If <code>stopWords</code> is an instance of {@link CharArraySet} (true if
-   * <code>makeStopSet()</code> was used to construct the set) it will be directly used
-   * and <code>ignoreCase</code> will be ignored since <code>CharArraySet</code>
-   * directly controls case sensitivity.
-   * <p/>
-   * If <code>stopWords</code> is not an instance of {@link CharArraySet},
-   * a new CharArraySet will be constructed and <code>ignoreCase</code> will be
-   * used to specify the case sensitivity of that set.
-   *
-   * @param input
-   * @param stopWords The set of Stop Words.
-   * @param ignoreCase -Ignore case when stopping.
-   * @deprecated Use {@link #StopFilter(boolean, TokenStream, Set, boolean)} instead
-   */
-  public StopFilter(TokenStream input, Set stopWords, boolean ignoreCase)
-  {
-    this(ENABLE_POSITION_INCREMENTS_DEFAULT, input, stopWords, ignoreCase);
-  }
 
   /**
    * Construct a token stream filtering the given input.
@@ -122,10 +51,11 @@
    *
    * @param enablePositionIncrements true if token positions should record the removed stop words
    * @param input Input TokenStream
-   * @param stopWords The set of Stop Words.
+   * @param stopWords A Set of Strings or char[] or any other toString()-able set representing the stopwords
+   * @param ignoreCase if true, all words are lower cased first
    * @param ignoreCase -Ignore case when stopping.
    */
-  public StopFilter(boolean enablePositionIncrements, TokenStream input, Set stopWords, boolean ignoreCase)
+  public StopFilter(boolean enablePositionIncrements, TokenStream input, Set<?> stopWords, boolean ignoreCase)
   {
     super(input);
     if (stopWords instanceof CharArraySet) {
@@ -135,18 +65,8 @@
       this.stopWords.addAll(stopWords);
     }
     this.enablePositionIncrements = enablePositionIncrements;
-    init();
-  }
-
-  /**
-   * Constructs a filter which removes words from the input
-   * TokenStream that are named in the Set.
-   *
-   * @see #makeStopSet(java.lang.String[])
-   * @deprecated Use {@link #StopFilter(boolean, TokenStream, Set)} instead
-   */
-  public StopFilter(TokenStream in, Set stopWords) {
-    this(ENABLE_POSITION_INCREMENTS_DEFAULT, in, stopWords, false);
+    termAtt = addAttribute(TermAttribute.class);
+    posIncrAtt = addAttribute(PositionIncrementAttribute.class);
   }
 
   /**
@@ -155,17 +75,12 @@
    *
    * @param enablePositionIncrements true if token positions should record the removed stop words
    * @param in Input stream
-   * @param stopWords The set of Stop Words.
+   * @param stopWords A Set of Strings or char[] or any other toString()-able set representing the stopwords
    * @see #makeStopSet(java.lang.String[])
    */
-  public StopFilter(boolean enablePositionIncrements, TokenStream in, Set stopWords) {
+  public StopFilter(boolean enablePositionIncrements, TokenStream in, Set<?> stopWords) {
     this(enablePositionIncrements, in, stopWords, false);
   }
-  
-  public void init() {
-    termAtt = addAttribute(TermAttribute.class);
-    posIncrAtt = addAttribute(PositionIncrementAttribute.class);
-  }
 
   /**
    * Builds a Set from an array of stop words,
@@ -175,7 +90,7 @@
    * 
    * @see #makeStopSet(java.lang.String[], boolean) passing false to ignoreCase
    */
-  public static final Set makeStopSet(String[] stopWords) {
+  public static final Set<Object> makeStopSet(String... stopWords) {
     return makeStopSet(stopWords, false);
   }
 
@@ -184,10 +99,11 @@
    * appropriate for passing into the StopFilter constructor.
    * This permits this stopWords construction to be cached once when
    * an Analyzer is constructed.
-   *
+   * @param stopWords A List of Strings or char[] or any other toString()-able list representing the stopwords
+   * @return A Set ({@link CharArraySet}) containing the words
    * @see #makeStopSet(java.lang.String[], boolean) passing false to ignoreCase
    */
-  public static final Set makeStopSet(List/*<String>*/ stopWords) {
+  public static final Set<Object> makeStopSet(List<?> stopWords) {
     return makeStopSet(stopWords, false);
   }
     
@@ -197,7 +113,7 @@
    * @param ignoreCase If true, all words are lower cased first.  
    * @return a Set containing the words
    */    
-  public static final Set makeStopSet(String[] stopWords, boolean ignoreCase) {
+  public static final Set<Object> makeStopSet(String[] stopWords, boolean ignoreCase) {
     CharArraySet stopSet = new CharArraySet(stopWords.length, ignoreCase);
     stopSet.addAll(Arrays.asList(stopWords));
     return stopSet;
@@ -205,11 +121,11 @@
 
   /**
    *
-   * @param stopWords A List of Strings representing the stopwords
+   * @param stopWords A List of Strings or char[] or any other toString()-able list representing the stopwords
    * @param ignoreCase if true, all words are lower cased first
-   * @return A Set containing the words
+   * @return A Set ({@link CharArraySet}) containing the words
    */
-  public static final Set makeStopSet(List/*<String>*/ stopWords, boolean ignoreCase){
+  public static final Set<Object> makeStopSet(List<?> stopWords, boolean ignoreCase){
     CharArraySet stopSet = new CharArraySet(stopWords.size(), ignoreCase);
     stopSet.addAll(stopWords);
     return stopSet;
@@ -230,35 +146,11 @@
       }
       skippedPositions += posIncrAtt.getPositionIncrement();
     }
-    // reached EOS -- return null
+    // reached EOS -- return false
     return false;
   }
 
   /**
-   * @see #setEnablePositionIncrementsDefault(boolean). 
-   * @deprecated Please specify this when you create the StopFilter
-   */
-  public static boolean getEnablePositionIncrementsDefault() {
-    return ENABLE_POSITION_INCREMENTS_DEFAULT;
-  }
-
-  /**
-   * Set the default position increments behavior of every StopFilter created from now on.
-   * <p>
-   * Note: behavior of a single StopFilter instance can be modified 
-   * with {@link #setEnablePositionIncrements(boolean)}.
-   * This static method allows control over behavior of classes using StopFilters internally, 
-   * for example {@link org.apache.lucene.analysis.standard.StandardAnalyzer StandardAnalyzer}. 
-   * <p>
-   * Default : false.
-   * @see #setEnablePositionIncrements(boolean).
-   * @deprecated Please specify this when you create the StopFilter
-   */
-  public static void setEnablePositionIncrementsDefault(boolean defaultValue) {
-    ENABLE_POSITION_INCREMENTS_DEFAULT = defaultValue;
-  }
-
-  /**
    * @see #setEnablePositionIncrements(boolean). 
    */
   public boolean getEnablePositionIncrements() {

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/standard/StandardAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/analysis/standard/StandardAnalyzer.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/standard/StandardAnalyzer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/standard/StandardAnalyzer.java Wed Oct 21 12:12:11 2009
@@ -36,86 +36,25 @@
  * <ul>
  *   <li> As of 2.9, StopFilter preserves position
  *        increments by default
- *   <li> As of 2.9, Tokens incorrectly identified as acronyms
+ *   <li> As of 2.4, Tokens incorrectly identified as acronyms
  *        are corrected (see <a href="https://issues.apache.org/jira/browse/LUCENE-1068">LUCENE-1608</a>
  * </ul>
  */
 public class StandardAnalyzer extends Analyzer {
-  private Set stopSet;
+  private Set<?> stopSet;
 
   /**
    * Specifies whether deprecated acronyms should be replaced with HOST type.
-   * This is false by default to support backward compatibility.
-   * 
-   * @deprecated this should be removed in the next release (3.0).
-   *
-   * See https://issues.apache.org/jira/browse/LUCENE-1068
+   * See {@linkplain https://issues.apache.org/jira/browse/LUCENE-1068}
    */
-  private boolean replaceInvalidAcronym = defaultReplaceInvalidAcronym;
+  private final boolean replaceInvalidAcronym,enableStopPositionIncrements;
 
-  private static boolean defaultReplaceInvalidAcronym;
-  private boolean enableStopPositionIncrements;
-
-  // @deprecated
-  private boolean useDefaultStopPositionIncrements;
-
-  // Default to true (fixed the bug), unless the system prop is set
-  static {
-    final String v = System.getProperty("org.apache.lucene.analysis.standard.StandardAnalyzer.replaceInvalidAcronym");
-    if (v == null || v.equals("true"))
-      defaultReplaceInvalidAcronym = true;
-    else
-      defaultReplaceInvalidAcronym = false;
-  }
-
-  /**
-   *
-   * @return true if new instances of StandardTokenizer will
-   * replace mischaracterized acronyms
-   *
-   * See https://issues.apache.org/jira/browse/LUCENE-1068
-   * @deprecated This will be removed (hardwired to true) in 3.0
-   */
-  public static boolean getDefaultReplaceInvalidAcronym() {
-    return defaultReplaceInvalidAcronym;
-  }
-
-  /**
-   *
-   * @param replaceInvalidAcronym Set to true to have new
-   * instances of StandardTokenizer replace mischaracterized
-   * acronyms by default.  Set to false to preserve the
-   * previous (before 2.4) buggy behavior.  Alternatively,
-   * set the system property
-   * org.apache.lucene.analysis.standard.StandardAnalyzer.replaceInvalidAcronym
-   * to false.
-   *
-   * See https://issues.apache.org/jira/browse/LUCENE-1068
-   * @deprecated This will be removed (hardwired to true) in 3.0
-   */
-  public static void setDefaultReplaceInvalidAcronym(boolean replaceInvalidAcronym) {
-    defaultReplaceInvalidAcronym = replaceInvalidAcronym;
-  }
-
-
-  /** An array containing some common English words that are usually not
-  useful for searching. 
-  @deprecated Use {@link #STOP_WORDS_SET} instead */
-  public static final String[] STOP_WORDS = StopAnalyzer.ENGLISH_STOP_WORDS;
-  
   /** An unmodifiable set containing some common English words that are usually not
   useful for searching. */
-  public static final Set/*<String>*/ STOP_WORDS_SET = StopAnalyzer.ENGLISH_STOP_WORDS_SET; 
+  public static final Set<?> STOP_WORDS_SET = StopAnalyzer.ENGLISH_STOP_WORDS_SET; 
 
   /** Builds an analyzer with the default stop words ({@link
    * #STOP_WORDS_SET}).
-   * @deprecated Use {@link #StandardAnalyzer(Version)} instead. */
-  public StandardAnalyzer() {
-    this(Version.LUCENE_24, STOP_WORDS_SET);
-  }
-
-  /** Builds an analyzer with the default stop words ({@link
-   * #STOP_WORDS}).
    * @param matchVersion Lucene version to match See {@link
    * <a href="#version">above</a>}
    */
@@ -124,34 +63,14 @@
   }
 
   /** Builds an analyzer with the given stop words.
-   * @deprecated Use {@link #StandardAnalyzer(Version, Set)}
-   * instead */
-  public StandardAnalyzer(Set stopWords) {
-    this(Version.LUCENE_24, stopWords);
-  }
-
-  /** Builds an analyzer with the given stop words.
    * @param matchVersion Lucene version to match See {@link
    * <a href="#version">above</a>}
    * @param stopWords stop words */
-  public StandardAnalyzer(Version matchVersion, Set stopWords) {
+  public StandardAnalyzer(Version matchVersion, Set<?> stopWords) {
     stopSet = stopWords;
-    init(matchVersion);
-  }
-
-  /** Builds an analyzer with the given stop words.
-   * @deprecated Use {@link #StandardAnalyzer(Version, Set)} instead */
-  public StandardAnalyzer(String[] stopWords) {
-    this(Version.LUCENE_24, StopFilter.makeStopSet(stopWords));
-  }
-
-  /** Builds an analyzer with the stop words from the given file.
-   * @see WordlistLoader#getWordSet(File)
-   * @deprecated Use {@link #StandardAnalyzer(Version, File)}
-   * instead
-   */
-  public StandardAnalyzer(File stopwords) throws IOException {
-    this(Version.LUCENE_24, stopwords);
+    setOverridesTokenStreamMethod(StandardAnalyzer.class);
+    enableStopPositionIncrements = matchVersion.onOrAfter(Version.LUCENE_29);
+    replaceInvalidAcronym = matchVersion.onOrAfter(Version.LUCENE_24);
   }
 
   /** Builds an analyzer with the stop words from the given file.
@@ -160,17 +79,7 @@
    * <a href="#version">above</a>}
    * @param stopwords File to read stop words from */
   public StandardAnalyzer(Version matchVersion, File stopwords) throws IOException {
-    stopSet = WordlistLoader.getWordSet(stopwords);
-    init(matchVersion);
-  }
-
-  /** Builds an analyzer with the stop words from the given reader.
-   * @see WordlistLoader#getWordSet(Reader)
-   * @deprecated Use {@link #StandardAnalyzer(Version, Reader)}
-   * instead
-   */
-  public StandardAnalyzer(Reader stopwords) throws IOException {
-    this(Version.LUCENE_24, stopwords);
+    this(matchVersion, WordlistLoader.getWordSet(stopwords));
   }
 
   /** Builds an analyzer with the stop words from the given reader.
@@ -179,84 +88,7 @@
    * <a href="#version">above</a>}
    * @param stopwords Reader to read stop words from */
   public StandardAnalyzer(Version matchVersion, Reader stopwords) throws IOException {
-    stopSet = WordlistLoader.getWordSet(stopwords);
-    init(matchVersion);
-  }
-
-  /**
-   *
-   * @param replaceInvalidAcronym Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer
-   *
-   * See https://issues.apache.org/jira/browse/LUCENE-1068
-   *
-   * @deprecated Remove in 3.X and make true the only valid value
-   */
-  public StandardAnalyzer(boolean replaceInvalidAcronym) {
-    this(Version.LUCENE_24, STOP_WORDS_SET);
-    this.replaceInvalidAcronym = replaceInvalidAcronym;
-    useDefaultStopPositionIncrements = true;
-  }
-
-  /**
-   *  @param stopwords The stopwords to use
-   * @param replaceInvalidAcronym Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer
-   *
-   * See https://issues.apache.org/jira/browse/LUCENE-1068
-   *
-   * @deprecated Remove in 3.X and make true the only valid value
-   */
-  public StandardAnalyzer(Reader stopwords, boolean replaceInvalidAcronym) throws IOException{
-    this(Version.LUCENE_24, stopwords);
-    this.replaceInvalidAcronym = replaceInvalidAcronym;
-  }
-
-  /**
-   * @param stopwords The stopwords to use
-   * @param replaceInvalidAcronym Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer
-   *
-   * See https://issues.apache.org/jira/browse/LUCENE-1068
-   *
-   * @deprecated Remove in 3.X and make true the only valid value
-   */
-  public StandardAnalyzer(File stopwords, boolean replaceInvalidAcronym) throws IOException{
-    this(Version.LUCENE_24, stopwords);
-    this.replaceInvalidAcronym = replaceInvalidAcronym;
-  }
-
-  /**
-   *
-   * @param stopwords The stopwords to use
-   * @param replaceInvalidAcronym Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer
-   *
-   * See https://issues.apache.org/jira/browse/LUCENE-1068
-   *
-   * @deprecated Remove in 3.X and make true the only valid value
-   */
-  public StandardAnalyzer(String [] stopwords, boolean replaceInvalidAcronym) throws IOException{
-    this(Version.LUCENE_24, StopFilter.makeStopSet(stopwords));
-    this.replaceInvalidAcronym = replaceInvalidAcronym;
-  }
-
-  /**
-   * @param stopwords The stopwords to use
-   * @param replaceInvalidAcronym Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer
-   *
-   * See https://issues.apache.org/jira/browse/LUCENE-1068
-   *
-   * @deprecated Remove in 3.X and make true the only valid value
-   */
-  public StandardAnalyzer(Set stopwords, boolean replaceInvalidAcronym) throws IOException{
-    this(Version.LUCENE_24, stopwords);
-    this.replaceInvalidAcronym = replaceInvalidAcronym;
-  }
-
-  private final void init(Version matchVersion) {
-    setOverridesTokenStreamMethod(StandardAnalyzer.class);
-    if (matchVersion.onOrAfter(Version.LUCENE_29)) {
-      enableStopPositionIncrements = true;
-    } else {
-      useDefaultStopPositionIncrements = true;
-    }
+    this(matchVersion, WordlistLoader.getWordSet(stopwords));
   }
 
   /** Constructs a {@link StandardTokenizer} filtered by a {@link
@@ -266,11 +98,7 @@
     tokenStream.setMaxTokenLength(maxTokenLength);
     TokenStream result = new StandardFilter(tokenStream);
     result = new LowerCaseFilter(result);
-    if (useDefaultStopPositionIncrements) {
-      result = new StopFilter(result, stopSet);
-    } else {
-      result = new StopFilter(enableStopPositionIncrements, result, stopSet);
-    }
+    result = new StopFilter(enableStopPositionIncrements, result, stopSet);
     return result;
   }
 
@@ -301,7 +129,6 @@
     return maxTokenLength;
   }
 
-  /** @deprecated Use {@link #tokenStream} instead */
   public TokenStream reusableTokenStream(String fieldName, Reader reader) throws IOException {
     if (overridesTokenStreamMethod) {
       // LUCENE-1678: force fallback to tokenStream() if we
@@ -316,11 +143,7 @@
       streams.tokenStream = new StandardTokenizer(reader);
       streams.filteredTokenStream = new StandardFilter(streams.tokenStream);
       streams.filteredTokenStream = new LowerCaseFilter(streams.filteredTokenStream);
-      if (useDefaultStopPositionIncrements) {
-        streams.filteredTokenStream = new StopFilter(streams.filteredTokenStream, stopSet);
-      } else {
-        streams.filteredTokenStream = new StopFilter(enableStopPositionIncrements, streams.filteredTokenStream, stopSet);
-      }
+      streams.filteredTokenStream = new StopFilter(enableStopPositionIncrements, streams.filteredTokenStream, stopSet);
     } else {
       streams.tokenStream.reset(reader);
     }
@@ -330,26 +153,4 @@
 
     return streams.filteredTokenStream;
   }
-
-  /**
-   *
-   * @return true if this Analyzer is replacing mischaracterized acronyms in the StandardTokenizer
-   *
-   * See https://issues.apache.org/jira/browse/LUCENE-1068
-   * @deprecated This will be removed (hardwired to true) in 3.0
-   */
-  public boolean isReplaceInvalidAcronym() {
-    return replaceInvalidAcronym;
-  }
-
-  /**
-   *
-   * @param replaceInvalidAcronym Set to true if this Analyzer is replacing mischaracterized acronyms in the StandardTokenizer
-   *
-   * See https://issues.apache.org/jira/browse/LUCENE-1068
-   * @deprecated This will be removed (hardwired to true) in 3.0
-   */
-  public void setReplaceInvalidAcronym(boolean replaceInvalidAcronym) {
-    this.replaceInvalidAcronym = replaceInvalidAcronym;
-  }
 }

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/Version.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/Version.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/Version.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/Version.java Wed Oct 21 12:12:11 2009
@@ -37,6 +37,18 @@
    */
   public static final Version LUCENE_CURRENT = new Version("LUCENE_CURRENT", 0);
   
+  /** Match settings and bugs in Lucene's 2.0 release. */
+  public static final Version LUCENE_20 = new Version("LUCENE_20", 2000);
+
+  /** Match settings and bugs in Lucene's 2.1 release. */
+  public static final Version LUCENE_21 = new Version("LUCENE_21", 2100);
+
+  /** Match settings and bugs in Lucene's 2.2 release. */
+  public static final Version LUCENE_22 = new Version("LUCENE_22", 2200);
+
+  /** Match settings and bugs in Lucene's 2.3 release. */
+  public static final Version LUCENE_23 = new Version("LUCENE_23", 2300);
+
   /** Match settings and bugs in Lucene's 2.4 release. */
   public static final Version LUCENE_24 = new Version("LUCENE_24", 2400);
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java Wed Oct 21 12:12:11 2009
@@ -68,7 +68,7 @@
     Directory dir = new MockRAMDirectory();
 
     SnapshotDeletionPolicy dp = new SnapshotDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy());
-    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), dp, IndexWriter.MaxFieldLength.UNLIMITED);
+    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), dp, IndexWriter.MaxFieldLength.UNLIMITED);
     // Force frequent flushes
     writer.setMaxBufferedDocs(2);
     Document doc = new Document();
@@ -84,7 +84,7 @@
     writer.close();
     copyFiles(dir, cp);
     
-    writer = new IndexWriter(dir, new StandardAnalyzer(), dp, IndexWriter.MaxFieldLength.UNLIMITED);
+    writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), dp, IndexWriter.MaxFieldLength.UNLIMITED);
     copyFiles(dir, cp);
     for(int i=0;i<7;i++) {
       writer.addDocument(doc);
@@ -96,7 +96,7 @@
     writer.close();
     copyFiles(dir, cp);
     dp.release();
-    writer = new IndexWriter(dir, new StandardAnalyzer(), dp, IndexWriter.MaxFieldLength.UNLIMITED);
+    writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), dp, IndexWriter.MaxFieldLength.UNLIMITED);
     writer.close();
     try {
       copyFiles(dir, cp);
@@ -112,7 +112,7 @@
     final long stopTime = System.currentTimeMillis() + 7000;
 
     SnapshotDeletionPolicy dp = new SnapshotDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy());
-    final IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), dp, IndexWriter.MaxFieldLength.UNLIMITED);
+    final IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), dp, IndexWriter.MaxFieldLength.UNLIMITED);
 
     // Force frequent flushes
     writer.setMaxBufferedDocs(2);

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestAnalyzers.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestAnalyzers.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestAnalyzers.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestAnalyzers.java Wed Oct 21 12:12:11 2009
@@ -74,7 +74,7 @@
   }
 
   public void testStop() throws Exception {
-    Analyzer a = new StopAnalyzer();
+    Analyzer a = new StopAnalyzer(true);
     assertAnalyzesTo(a, "foo bar FOO BAR", 
                      new String[] { "foo", "bar", "foo", "bar" });
     assertAnalyzesTo(a, "foo a bar such FOO THESE BAR", 
@@ -120,6 +120,10 @@
   }
 
   private static class MyStandardAnalyzer extends StandardAnalyzer {
+    public MyStandardAnalyzer() {
+      super(org.apache.lucene.util.Version.LUCENE_CURRENT);
+    }
+  
     public TokenStream tokenStream(String field, Reader reader) {
       return new WhitespaceAnalyzer().tokenStream(field, reader);
     }

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStandardAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStandardAnalyzer.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStandardAnalyzer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStandardAnalyzer.java Wed Oct 21 12:12:11 2009
@@ -26,16 +26,16 @@
 
 public class TestStandardAnalyzer extends BaseTokenStreamTestCase {
 
-  private Analyzer a = new StandardAnalyzer();
+  private Analyzer a = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT);
 
   public void testMaxTermLength() throws Exception {
-    StandardAnalyzer sa = new StandardAnalyzer();
+    StandardAnalyzer sa = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT);
     sa.setMaxTokenLength(5);
     assertAnalyzesTo(sa, "ab cd toolong xy z", new String[]{"ab", "cd", "xy", "z"});
   }
 
   public void testMaxTermLength2() throws Exception {
-    StandardAnalyzer sa = new StandardAnalyzer();
+    StandardAnalyzer sa = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT);
     assertAnalyzesTo(sa, "ab cd toolong xy z", new String[]{"ab", "cd", "toolong", "xy", "z"});
     sa.setMaxTokenLength(5);
     
@@ -99,23 +99,23 @@
 
   public void testLucene1140() throws Exception {
     try {
-      StandardAnalyzer analyzer = new StandardAnalyzer(true);
+      StandardAnalyzer analyzer = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT);
       assertAnalyzesTo(analyzer, "www.nutch.org.", new String[]{ "www.nutch.org" }, new String[] { "<HOST>" });
     } catch (NullPointerException e) {
-      assertTrue("Should not throw an NPE and it did", false);
+      fail("Should not throw an NPE and it did");
     }
 
   }
 
   public void testDomainNames() throws Exception {
     // Don't reuse a because we alter its state (setReplaceInvalidAcronym)
-    StandardAnalyzer a2 = new StandardAnalyzer();
+    StandardAnalyzer a2 = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT);
     // domain names
     assertAnalyzesTo(a2, "www.nutch.org", new String[]{"www.nutch.org"});
     //Notice the trailing .  See https://issues.apache.org/jira/browse/LUCENE-1068.
     // the following should be recognized as HOST:
     assertAnalyzesTo(a2, "www.nutch.org.", new String[]{ "www.nutch.org" }, new String[] { "<HOST>" });
-    a2.setReplaceInvalidAcronym(false);
+    a2 = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_23);
     assertAnalyzesTo(a2, "www.nutch.org.", new String[]{ "wwwnutchorg" }, new String[] { "<ACRONYM>" });
   }
 
@@ -220,11 +220,4 @@
                     "<ALPHANUM>", "<NUM>", "<HOST>", "<NUM>", "<ALPHANUM>",
                     "<ALPHANUM>", "<HOST>"});
   }
-
-  /** @deprecated this should be removed in the 3.0. */
-   public void testDeprecatedAcronyms() throws Exception {
- 	// test backward compatibility for applications that require the old behavior.
- 	// this should be removed once replaceDepAcronym is removed.
- 	  assertAnalyzesTo(a, "lucene.apache.org.", new String[]{ "lucene.apache.org" }, new String[] { "<HOST>" });
-   }
 }

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopAnalyzer.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopAnalyzer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopAnalyzer.java Wed Oct 21 12:12:11 2009
@@ -61,7 +61,7 @@
     stopWordsSet.add("good");
     stopWordsSet.add("test");
     stopWordsSet.add("analyzer");
-    StopAnalyzer newStop = new StopAnalyzer((String[])stopWordsSet.toArray(new String[3]));
+    StopAnalyzer newStop = new StopAnalyzer(stopWordsSet, false);
     StringReader reader = new StringReader("This is a good test of the english stop analyzer");
     TokenStream stream = newStop.tokenStream("test", reader);
     assertNotNull(stream);
@@ -76,29 +76,23 @@
   }
 
   public void testStopListPositions() throws IOException {
-    boolean defaultEnable = StopFilter.getEnablePositionIncrementsDefault();
-    StopFilter.setEnablePositionIncrementsDefault(true);
-    try {
-      Set stopWordsSet = new HashSet();
-      stopWordsSet.add("good");
-      stopWordsSet.add("test");
-      stopWordsSet.add("analyzer");
-      StopAnalyzer newStop = new StopAnalyzer((String[])stopWordsSet.toArray(new String[3]));
-      StringReader reader = new StringReader("This is a good test of the english stop analyzer with positions");
-      int expectedIncr[] =                  { 1,   1, 1,          3, 1,  1,      1,            2,   1};
-      TokenStream stream = newStop.tokenStream("test", reader);
-      assertNotNull(stream);
-      int i = 0;
-      TermAttribute termAtt = stream.getAttribute(TermAttribute.class);
-      PositionIncrementAttribute posIncrAtt = stream.addAttribute(PositionIncrementAttribute.class);
+    Set stopWordsSet = new HashSet();
+    stopWordsSet.add("good");
+    stopWordsSet.add("test");
+    stopWordsSet.add("analyzer");
+    StopAnalyzer newStop = new StopAnalyzer(stopWordsSet, true);
+    StringReader reader = new StringReader("This is a good test of the english stop analyzer with positions");
+    int expectedIncr[] =                  { 1,   1, 1,          3, 1,  1,      1,            2,   1};
+    TokenStream stream = newStop.tokenStream("test", reader);
+    assertNotNull(stream);
+    int i = 0;
+    TermAttribute termAtt = stream.getAttribute(TermAttribute.class);
+    PositionIncrementAttribute posIncrAtt = stream.addAttribute(PositionIncrementAttribute.class);
 
-      while (stream.incrementToken()) {
-        String text = termAtt.term();
-        assertFalse(stopWordsSet.contains(text));
-        assertEquals(expectedIncr[i++],posIncrAtt.getPositionIncrement());
-      }
-    } finally {
-      StopFilter.setEnablePositionIncrementsDefault(defaultEnable);
+    while (stream.incrementToken()) {
+      String text = termAtt.term();
+      assertFalse(stopWordsSet.contains(text));
+      assertEquals(expectedIncr[i++],posIncrAtt.getPositionIncrement());
     }
   }
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java Wed Oct 21 12:12:11 2009
@@ -23,7 +23,9 @@
 import java.io.IOException;
 import java.io.StringReader;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Set;
+import java.util.HashSet;
 
 
 public class TestStopFilter extends BaseTokenStreamTestCase {
@@ -34,8 +36,8 @@
 
   public void testExactCase() throws IOException {
     StringReader reader = new StringReader("Now is The Time");
-    String[] stopWords = new String[] { "is", "the", "Time" };
-    TokenStream stream = new StopFilter(false, new WhitespaceTokenizer(reader), stopWords);
+    Set<String> stopWords = new HashSet(Arrays.asList("is", "the", "Time"));
+    TokenStream stream = new StopFilter(false, new WhitespaceTokenizer(reader), stopWords, false);
     final TermAttribute termAtt = stream.getAttribute(TermAttribute.class);
     assertTrue(stream.incrementToken());
     assertEquals("Now", termAtt.term());
@@ -46,7 +48,7 @@
 
   public void testIgnoreCase() throws IOException {
     StringReader reader = new StringReader("Now is The Time");
-    String[] stopWords = new String[] { "is", "the", "Time" };
+    Set<String> stopWords = new HashSet(Arrays.asList( "is", "the", "Time" ));
     TokenStream stream = new StopFilter(false, new WhitespaceTokenizer(reader), stopWords, true);
     final TermAttribute termAtt = stream.getAttribute(TermAttribute.class);
     assertTrue(stream.incrementToken());

Modified: lucene/java/trunk/src/test/org/apache/lucene/document/TestBinaryDocument.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/document/TestBinaryDocument.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/document/TestBinaryDocument.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/document/TestBinaryDocument.java Wed Oct 21 12:12:11 2009
@@ -59,7 +59,7 @@
     
     /** add the doc to a ram index */
     MockRAMDirectory dir = new MockRAMDirectory();
-    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
     writer.addDocument(doc);
     writer.close();
     
@@ -97,7 +97,7 @@
     
     /** add the doc to a ram index */
     MockRAMDirectory dir = new MockRAMDirectory();
-    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
     writer.addDocument(doc);
     writer.close();
     

Modified: lucene/java/trunk/src/test/org/apache/lucene/document/TestDocument.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/document/TestDocument.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/document/TestDocument.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/document/TestDocument.java Wed Oct 21 12:12:11 2009
@@ -154,7 +154,7 @@
     public void testGetValuesForIndexedDocument() throws Exception
     {
         RAMDirectory dir = new RAMDirectory();
-        IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+        IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
         writer.addDocument(makeDocumentWithFields());
         writer.close();
 
@@ -225,7 +225,7 @@
       doc.add(new Field("keyword", "test", Field.Store.YES, Field.Index.NOT_ANALYZED));
 
       RAMDirectory dir = new RAMDirectory();
-      IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+      IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
       writer.addDocument(doc);
       field.setValue("id2");
       writer.addDocument(doc);

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestDirectoryReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestDirectoryReader.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestDirectoryReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestDirectoryReader.java Wed Oct 21 12:12:11 2009
@@ -193,7 +193,7 @@
   }
 
   private void addDoc(RAMDirectory ramDir1, String s, boolean create) throws IOException {
-    IndexWriter iw = new IndexWriter(ramDir1, new StandardAnalyzer(), create, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter iw = new IndexWriter(ramDir1, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), create, IndexWriter.MaxFieldLength.LIMITED);
     Document doc = new Document();
     doc.add(new Field("body", s, Field.Store.YES, Field.Index.ANALYZED));
     iw.addDocument(doc);

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestDocumentWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestDocumentWriter.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestDocumentWriter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestDocumentWriter.java Wed Oct 21 12:12:11 2009
@@ -259,7 +259,7 @@
     doc.add(new Field("f2", "v1", Store.YES, Index.NOT_ANALYZED, TermVector.WITH_POSITIONS_OFFSETS));
     doc.add(new Field("f2", "v2", Store.YES, Index.NOT_ANALYZED, TermVector.NO));
 
-    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
     writer.addDocument(doc);
     writer.close();
 
@@ -292,7 +292,7 @@
     doc.add(f);
     doc.add(new Field("f2", "v2", Store.YES, Index.NO));
 
-    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
     writer.addDocument(doc);
     writer.optimize(); // be sure to have a single segment
     writer.close();

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java Wed Oct 21 12:12:11 2009
@@ -76,7 +76,7 @@
       commitUserData.put("foo", "fighters");
       
       // set up writer
-      IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+      IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
       writer.setMaxBufferedDocs(2);
       for(int i=0;i<27;i++)
         addDocumentWithFields(writer);
@@ -98,7 +98,7 @@
       assertTrue(c.equals(r.getIndexCommit()));
 
       // Change the index
-      writer = new IndexWriter(d, new StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
+      writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
       writer.setMaxBufferedDocs(2);
       for(int i=0;i<7;i++)
         addDocumentWithFields(writer);
@@ -109,7 +109,7 @@
       assertFalse(r2.getIndexCommit().isOptimized());
       r3.close();
 
-      writer = new IndexWriter(d, new StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
+      writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
       writer.optimize();
       writer.close();
 
@@ -123,19 +123,19 @@
     public void testIsCurrent() throws Exception
     {
       RAMDirectory d = new MockRAMDirectory();
-      IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+      IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
       addDocumentWithFields(writer);
       writer.close();
       // set up reader:
       IndexReader reader = IndexReader.open(d, false);
       assertTrue(reader.isCurrent());
       // modify index by adding another document:
-      writer = new IndexWriter(d, new StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
+      writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
       addDocumentWithFields(writer);
       writer.close();
       assertFalse(reader.isCurrent());
       // re-create index:
-      writer = new IndexWriter(d, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+      writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
       addDocumentWithFields(writer);
       writer.close();
       assertFalse(reader.isCurrent());
@@ -151,7 +151,7 @@
     {
         RAMDirectory d = new MockRAMDirectory();
         // set up writer
-        IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+        IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
         addDocumentWithFields(writer);
         writer.close();
         // set up reader
@@ -163,7 +163,7 @@
         assertTrue(fieldNames.contains("unstored"));
         reader.close();
         // add more documents
-        writer = new IndexWriter(d, new StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
+        writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
         // want to get some more segments here
         for (int i = 0; i < 5*writer.getMergeFactor(); i++)
         {
@@ -243,7 +243,7 @@
   public void testTermVectors() throws Exception {
     RAMDirectory d = new MockRAMDirectory();
     // set up writer
-    IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
     // want to get some more segments here
     // new termvector fields
     for (int i = 0; i < 5 * writer.getMergeFactor(); i++) {
@@ -1418,7 +1418,7 @@
       RAMDirectory d = new MockRAMDirectory();
 
       // set up writer
-      IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+      IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
       writer.setMaxBufferedDocs(2);
       for(int i=0;i<27;i++)
         addDocumentWithFields(writer);
@@ -1434,7 +1434,7 @@
       assertTrue(c.equals(r.getIndexCommit()));
 
       // Change the index
-      writer = new IndexWriter(d, new StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
+      writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
       writer.setMaxBufferedDocs(2);
       for(int i=0;i<7;i++)
         addDocumentWithFields(writer);
@@ -1445,7 +1445,7 @@
       assertFalse(r2.getIndexCommit().isOptimized());
       r2.close();
 
-      writer = new IndexWriter(d, new StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
+      writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
       writer.optimize();
       writer.close();
 
@@ -1459,7 +1459,7 @@
 
     public void testReadOnly() throws Throwable {
       RAMDirectory d = new MockRAMDirectory();
-      IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+      IndexWriter writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
       addDocumentWithFields(writer);
       writer.commit();
       addDocumentWithFields(writer);
@@ -1473,7 +1473,7 @@
         // expected
       }
       
-      writer = new IndexWriter(d, new StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
+      writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
       addDocumentWithFields(writer);
       writer.close();
 
@@ -1490,7 +1490,7 @@
         // expected
       }
 
-      writer = new IndexWriter(d, new StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
+      writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
       writer.optimize();
       writer.close();
 
@@ -1508,7 +1508,7 @@
       }
 
       // Make sure write lock isn't held
-      writer = new IndexWriter(d, new StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
+      writer = new IndexWriter(d, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
       writer.close();
 
       r3.close();
@@ -1518,7 +1518,7 @@
   // LUCENE-1474
   public void testIndexReader() throws Exception {
     Directory dir = new RAMDirectory();
-    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(),
+    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
                                          IndexWriter.MaxFieldLength.UNLIMITED);
     writer.addDocument(createDocument("a"));
     writer.addDocument(createDocument("b"));
@@ -1536,7 +1536,7 @@
   public void testIndexReaderUnDeleteAll() throws Exception {
     MockRAMDirectory dir = new MockRAMDirectory();
     dir.setPreventDoubleWrite(false);
-    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(),
+    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
                                          IndexWriter.MaxFieldLength.UNLIMITED);
     writer.addDocument(createDocument("a"));
     writer.addDocument(createDocument("b"));
@@ -1578,7 +1578,7 @@
 
     Directory dir = new MockRAMDirectory();
     
-    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(),
+    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
                                          IndexWriter.MaxFieldLength.LIMITED);
 
     writer.setMaxBufferedDocs(2);

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java Wed Oct 21 12:12:11 2009
@@ -69,7 +69,7 @@
   protected void setUp() throws Exception {
     super.setUp();
     similarityOne = new SimilarityOne();
-    anlzr = new StandardAnalyzer();
+    anlzr = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT);
   }
   
   /**

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderReopen.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderReopen.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderReopen.java Wed Oct 21 12:12:11 2009
@@ -687,7 +687,7 @@
     final Directory dir = new MockRAMDirectory();
     final int n = 150;
 
-    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED);
     for (int i = 0; i < n; i++) {
       writer.addDocument(createDocument(i, 3));
     }
@@ -705,7 +705,7 @@
           modifier.deleteDocument(i % modifier.maxDoc());
           modifier.close();
         } else {
-          IndexWriter modifier = new IndexWriter(dir, new StandardAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
+          IndexWriter modifier = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED);
           modifier.addDocument(createDocument(n + i, 6));
           modifier.close();
         }

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java Wed Oct 21 12:12:11 2009
@@ -543,7 +543,7 @@
     */
     public void testWickedLongTerm() throws IOException {
       RAMDirectory dir = new RAMDirectory();
-      IndexWriter writer  = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+      IndexWriter writer  = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
 
       char[] chars = new char[DocumentsWriter.CHAR_BLOCK_SIZE-1];
       Arrays.fill(chars, 'x');
@@ -587,7 +587,7 @@
       // maximum length term, and search on that term:
       doc = new Document();
       doc.add(new Field("content", bigTerm, Field.Store.NO, Field.Index.ANALYZED));
-      StandardAnalyzer sa = new StandardAnalyzer();
+      StandardAnalyzer sa = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT);
       sa.setMaxTokenLength(100000);
       writer  = new IndexWriter(dir, sa, IndexWriter.MaxFieldLength.LIMITED);
       writer.addDocument(doc);
@@ -1573,7 +1573,7 @@
    */
   public void testBadSegment() throws IOException {
     MockRAMDirectory dir = new MockRAMDirectory();
-    IndexWriter ir = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter ir = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
     
     Document document = new Document();
     document.add(new Field("tvtest", "", Field.Store.NO, Field.Index.ANALYZED,
@@ -1586,7 +1586,7 @@
   // LUCENE-1008
   public void testNoTermVectorAfterTermVector() throws IOException {
     MockRAMDirectory dir = new MockRAMDirectory();
-    IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
     Document document = new Document();
     document.add(new Field("tvtest", "a b c", Field.Store.NO, Field.Index.ANALYZED,
         Field.TermVector.YES));
@@ -1612,7 +1612,7 @@
   // LUCENE-1010
   public void testNoTermVectorAfterTermVectorMerge() throws IOException {
     MockRAMDirectory dir = new MockRAMDirectory();
-    IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
     Document document = new Document();
     document.add(new Field("tvtest", "a b c", Field.Store.NO, Field.Index.ANALYZED,
         Field.TermVector.YES));
@@ -1644,7 +1644,7 @@
     int pri = Thread.currentThread().getPriority();
     try {
       MockRAMDirectory dir = new MockRAMDirectory();
-      IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+      IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
       Document document = new Document();
       document.add(new Field("tvtest", "a b c", Field.Store.NO, Field.Index.ANALYZED,
                              Field.TermVector.YES));
@@ -1682,7 +1682,7 @@
   // LUCENE-1013
   public void testSetMaxMergeDocs() throws IOException {
     MockRAMDirectory dir = new MockRAMDirectory();
-    IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
     iw.setMergeScheduler(new MyMergeScheduler());
     iw.setMaxMergeDocs(20);
     iw.setMaxBufferedDocs(2);
@@ -2730,7 +2730,7 @@
     Directory dir = new MockRAMDirectory();
     for(int iter=0;iter<2;iter++) {
       IndexWriter writer = new IndexWriter(dir,
-                                           new StandardAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
+                                           new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.UNLIMITED);
       writer.setMaxBufferedDocs(2);
       writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
       writer.setMergeScheduler(new SerialMergeScheduler());
@@ -2763,7 +2763,7 @@
       reader.close();
 
       writer = new IndexWriter(dir,
-                               new StandardAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
+                               new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.UNLIMITED);
       writer.setMaxBufferedDocs(2);
       writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
       writer.setMergeScheduler(new SerialMergeScheduler());
@@ -2782,7 +2782,7 @@
     Directory dir = new MockRAMDirectory();
     for(int iter=0;iter<2;iter++) {
       IndexWriter writer = new IndexWriter(dir,
-                                           new StandardAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
+                                           new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.UNLIMITED);
       writer.setMaxBufferedDocs(2);
       writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
       writer.setMergeScheduler(new SerialMergeScheduler());
@@ -2819,7 +2819,7 @@
   public void testTermVectorCorruption3() throws IOException {
     Directory dir = new MockRAMDirectory();
     IndexWriter writer = new IndexWriter(dir,
-                                         new StandardAnalyzer(),
+                                         new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
                                          IndexWriter.MaxFieldLength.LIMITED);
     writer.setMaxBufferedDocs(2);
     writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
@@ -2841,7 +2841,7 @@
     writer.close();
 
     writer = new IndexWriter(dir,
-                             new StandardAnalyzer(),
+                             new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
                              IndexWriter.MaxFieldLength.LIMITED);
     writer.setMaxBufferedDocs(2);
     writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
@@ -2889,7 +2889,7 @@
   public void testExpungeDeletes() throws IOException {
     Directory dir = new MockRAMDirectory();
     IndexWriter writer = new IndexWriter(dir,
-                                         new StandardAnalyzer(),
+                                         new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
                                          IndexWriter.MaxFieldLength.LIMITED);
     writer.setMaxBufferedDocs(2);
     writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
@@ -2917,7 +2917,7 @@
     ir.close();
 
     writer = new IndexWriter(dir,
-                             new StandardAnalyzer(),
+                             new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
                              IndexWriter.MaxFieldLength.LIMITED);
     assertEquals(8, writer.numDocs());
     assertEquals(10, writer.maxDoc());
@@ -2935,7 +2935,7 @@
   public void testExpungeDeletes2() throws IOException {
     Directory dir = new MockRAMDirectory();
     IndexWriter writer = new IndexWriter(dir,
-                                         new StandardAnalyzer(),
+                                         new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
                                          IndexWriter.MaxFieldLength.LIMITED);
     writer.setMaxBufferedDocs(2);
     writer.setMergeFactor(50);
@@ -2964,7 +2964,7 @@
     ir.close();
 
     writer = new IndexWriter(dir,
-                             new StandardAnalyzer(),
+                             new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
                              IndexWriter.MaxFieldLength.LIMITED);
     writer.setMergeFactor(3);
     assertEquals(49, writer.numDocs());
@@ -2982,7 +2982,7 @@
   public void testExpungeDeletes3() throws IOException {
     Directory dir = new MockRAMDirectory();
     IndexWriter writer = new IndexWriter(dir,
-                                         new StandardAnalyzer(),
+                                         new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
                                          IndexWriter.MaxFieldLength.LIMITED);
     writer.setMaxBufferedDocs(2);
     writer.setMergeFactor(50);
@@ -3011,7 +3011,7 @@
     ir.close();
 
     writer = new IndexWriter(dir,
-                             new StandardAnalyzer(),
+                             new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
                              IndexWriter.MaxFieldLength.LIMITED);
     // Force many merges to happen
     writer.setMergeFactor(3);
@@ -4014,7 +4014,7 @@
 
     final List thrown = new ArrayList();
 
-    final IndexWriter writer = new IndexWriter(new MockRAMDirectory(), new StandardAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED) {
+    final IndexWriter writer = new IndexWriter(new MockRAMDirectory(), new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.UNLIMITED) {
         public void message(final String message) {
           if (message.startsWith("now flush at close") && 0 == thrown.size()) {
             thrown.add(null);
@@ -4167,7 +4167,7 @@
   // LUCENE-1448
   public void testEndOffsetPositionStopFilter() throws Exception {
     MockRAMDirectory dir = new MockRAMDirectory();
-    IndexWriter w = new IndexWriter(dir, new StopAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter w = new IndexWriter(dir, new StopAnalyzer(true), IndexWriter.MaxFieldLength.LIMITED);
     Document doc = new Document();
     Field f = new Field("field", "abcd the", Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS);
     doc.add(f);
@@ -4189,7 +4189,7 @@
   // LUCENE-1448
   public void testEndOffsetPositionStandard() throws Exception {
     MockRAMDirectory dir = new MockRAMDirectory();
-    IndexWriter w = new IndexWriter(dir, new StandardAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter w = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED);
     Document doc = new Document();
     Field f = new Field("field", "abcd the  ", Field.Store.NO,
         Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS);
@@ -4219,7 +4219,7 @@
   // LUCENE-1448
   public void testEndOffsetPositionStandardEmptyField() throws Exception {
     MockRAMDirectory dir = new MockRAMDirectory();
-    IndexWriter w = new IndexWriter(dir, new StandardAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter w = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED);
     Document doc = new Document();
     Field f = new Field("field", "", Field.Store.NO,
                         Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS);
@@ -4246,7 +4246,7 @@
   // LUCENE-1448
   public void testEndOffsetPositionStandardEmptyField2() throws Exception {
     MockRAMDirectory dir = new MockRAMDirectory();
-    IndexWriter w = new IndexWriter(dir, new StandardAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter w = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED);
     Document doc = new Document();
 
     Field f = new Field("field", "abcd", Field.Store.NO,

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java Wed Oct 21 12:12:11 2009
@@ -75,10 +75,10 @@
         IndexWriter im;
         FSDirectory dir = FSDirectory.open(this.__test_dir);
         try {
-            im = new IndexWriter(dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
+            im = new IndexWriter(dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
         } catch (FileNotFoundException e) {
             try {
-                im = new IndexWriter(dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
+                im = new IndexWriter(dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
             } catch (FileNotFoundException e1) {
             }
         } finally {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMerging.java?rev=827979&r1=827978&r2=827979&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMerging.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMerging.java Wed Oct 21 12:12:11 2009
@@ -56,7 +56,7 @@
 
     Directory merged = new MockRAMDirectory();
 
-    IndexWriter writer = new IndexWriter(merged, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter writer = new IndexWriter(merged, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
     writer.setMergeFactor(2);
 
     writer.addIndexesNoOptimize(new Directory[]{indexA, indexB});
@@ -93,7 +93,7 @@
   private void fillIndex(Directory dir, int start, int numDocs) throws IOException
   {
 
-    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
     writer.setMergeFactor(2);
     writer.setMaxBufferedDocs(2);
 



Mime
View raw message