lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r692921 [1/2] - in /lucene/java/trunk: contrib/analyzers/src/java/org/apache/lucene/analysis/br/ contrib/analyzers/src/java/org/apache/lucene/analysis/cn/ contrib/analyzers/src/java/org/apache/lucene/analysis/cz/ contrib/analyzers/src/java/...
Date Sun, 07 Sep 2008 19:22:41 GMT
Author: mikemccand
Date: Sun Sep  7 12:22:40 2008
New Revision: 692921

URL: http://svn.apache.org/viewvc?rev=692921&view=rev
Log:
LUCENE-1369: switch from Hashtable to HashMap and from Vector to List, when possible

Modified:
    lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/br/BrazilianAnalyzer.java
    lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/br/BrazilianStemFilter.java
    lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/cn/ChineseFilter.java
    lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java
    lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java
    lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/el/GreekAnalyzer.java
    lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/fr/FrenchAnalyzer.java
    lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/fr/FrenchStemFilter.java
    lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/ru/RussianAnalyzer.java
    lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java
    lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
    lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.java
    lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.jj
    lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/ComposedQuery.java
    lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/FieldsQuery.java
    lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SimpleTerm.java
    lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/BaseListModel.java
    lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/BaseTableModel.java
    lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java
    lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java
    lucene/java/trunk/src/demo/org/apache/lucene/demo/html/Entities.java
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/java/trunk/src/java/org/apache/lucene/index/MultiReader.java
    lucene/java/trunk/src/java/org/apache/lucene/index/MultiSegmentReader.java
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj
    lucene/java/trunk/src/java/org/apache/lucene/search/PhraseQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java
    lucene/java/trunk/src/test/org/apache/lucene/store/TestLockFactory.java

Modified: lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/br/BrazilianAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/br/BrazilianAnalyzer.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/br/BrazilianAnalyzer.java (original)
+++ lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/br/BrazilianAnalyzer.java Sun Sep  7 12:22:40 2008
@@ -17,6 +17,13 @@
  * limitations under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.LowerCaseFilter;
 import org.apache.lucene.analysis.StopFilter;
@@ -24,12 +31,6 @@
 import org.apache.lucene.analysis.WordlistLoader;
 import org.apache.lucene.analysis.standard.StandardFilter;
 import org.apache.lucene.analysis.standard.StandardTokenizer;
-import java.io.File;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Hashtable;
-import java.util.HashSet;
-import java.util.Set;
 
 /**
  * Analyzer for Brazilian language. Supports an external list of stopwords (words that
@@ -92,7 +93,7 @@
 	/**
 	 * Builds an analyzer with the given stop words.
 	 */
-	public BrazilianAnalyzer( Hashtable stopwords ) {
+	public BrazilianAnalyzer( Map stopwords ) {
 		stoptable = new HashSet(stopwords.keySet());
 	}
 
@@ -112,7 +113,7 @@
 	/**
 	 * Builds an exclusionlist from a Hashtable.
 	 */
-	public void setStemExclusionTable( Hashtable exclusionlist ) {
+	public void setStemExclusionTable( Map exclusionlist ) {
 		excltable = new HashSet(exclusionlist.keySet());
 	}
 	/**

Modified: lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/br/BrazilianStemFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/br/BrazilianStemFilter.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/br/BrazilianStemFilter.java (original)
+++ lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/br/BrazilianStemFilter.java Sun Sep  7 12:22:40 2008
@@ -23,7 +23,6 @@
 
 import java.io.IOException;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.Set;
 
 /**

Modified: lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/cn/ChineseFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/cn/ChineseFilter.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/cn/ChineseFilter.java (original)
+++ lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/cn/ChineseFilter.java Sun Sep  7 12:22:40 2008
@@ -17,7 +17,8 @@
  * limitations under the License.
  */
 
-import java.util.Hashtable;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.lucene.analysis.Token;
 import org.apache.lucene.analysis.TokenFilter;
@@ -54,12 +55,12 @@
     };
 
 
-    private Hashtable stopTable;
+    private Map stopTable;
 
     public ChineseFilter(TokenStream in) {
         super(in);
 
-        stopTable = new Hashtable(STOP_WORDS.length);
+        stopTable = new HashMap(STOP_WORDS.length);
         for (int i = 0; i < STOP_WORDS.length; i++)
             stopTable.put(STOP_WORDS[i], STOP_WORDS[i]);
     }

Modified: lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java (original)
+++ lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java Sun Sep  7 12:22:40 2008
@@ -26,7 +26,6 @@
 import org.apache.lucene.analysis.standard.StandardTokenizer;
 
 import java.io.*;
-import java.util.Hashtable;
 import java.util.HashSet;
 import java.util.Set;
 

Modified: lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java (original)
+++ lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java Sun Sep  7 12:22:40 2008
@@ -22,7 +22,7 @@
 import java.io.IOException;
 import java.io.Reader;
 import java.util.HashSet;
-import java.util.Hashtable;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.lucene.analysis.Analyzer;
@@ -91,7 +91,7 @@
   /**
    * Builds an analyzer with the given stop words.
    */
-  public GermanAnalyzer(Hashtable stopwords) {
+  public GermanAnalyzer(Map stopwords) {
     stopSet = new HashSet(stopwords.keySet());
   }
 
@@ -112,7 +112,7 @@
   /**
    * Builds an exclusionlist from a Hashtable.
    */
-  public void setStemExclusionTable(Hashtable exclusionlist) {
+  public void setStemExclusionTable(Map exclusionlist) {
     exclusionSet = new HashSet(exclusionlist.keySet());
   }
 

Modified: lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/el/GreekAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/el/GreekAnalyzer.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/el/GreekAnalyzer.java (original)
+++ lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/el/GreekAnalyzer.java Sun Sep  7 12:22:40 2008
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.StopFilter;
 import org.apache.lucene.analysis.TokenStream;
@@ -23,7 +24,7 @@
 
 import java.io.Reader;
 import java.util.HashSet;
-import java.util.Hashtable;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -200,7 +201,7 @@
     /**
      * Builds an analyzer with the given stop words.
      */
-    public GreekAnalyzer(char[] charset, Hashtable stopwords)
+    public GreekAnalyzer(char[] charset, Map stopwords)
     {
         this.charset = charset;
         stopSet = new HashSet(stopwords.keySet());

Modified: lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/fr/FrenchAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/fr/FrenchAnalyzer.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/fr/FrenchAnalyzer.java (original)
+++ lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/fr/FrenchAnalyzer.java Sun Sep  7 12:22:40 2008
@@ -29,7 +29,7 @@
 import java.io.IOException;
 import java.io.Reader;
 import java.util.HashSet;
-import java.util.Hashtable;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -111,9 +111,9 @@
   }
 
   /**
-   * Builds an exclusionlist from a Hashtable.
+   * Builds an exclusionlist from a Map.
    */
-  public void setStemExclusionTable(Hashtable exclusionlist) {
+  public void setStemExclusionTable(Map exclusionlist) {
     excltable = new HashSet(exclusionlist.keySet());
   }
 

Modified: lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/fr/FrenchStemFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/fr/FrenchStemFilter.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/fr/FrenchStemFilter.java (original)
+++ lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/fr/FrenchStemFilter.java Sun Sep  7 12:22:40 2008
@@ -20,9 +20,10 @@
 import org.apache.lucene.analysis.Token;
 import org.apache.lucene.analysis.TokenFilter;
 import org.apache.lucene.analysis.TokenStream;
+
 import java.io.IOException;
-import java.util.Hashtable;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -83,7 +84,7 @@
 	/**
 	 * Set an alternative exclusion list for this filter.
 	 */
-	public void setExclusionTable( Hashtable exclusiontable ) {
+	public void setExclusionTable( Map exclusiontable ) {
 		exclusions = new HashSet(exclusiontable.keySet());
 	}
 }

Modified: lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/ru/RussianAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/ru/RussianAnalyzer.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/ru/RussianAnalyzer.java (original)
+++ lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/ru/RussianAnalyzer.java Sun Sep  7 12:22:40 2008
@@ -19,7 +19,7 @@
 
 import java.io.Reader;
 import java.util.HashSet;
-import java.util.Hashtable;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.lucene.analysis.Analyzer;
@@ -237,7 +237,7 @@
      * Builds an analyzer with the given stop words.
      * @todo create a Set version of this ctor
      */
-    public RussianAnalyzer(char[] charset, Hashtable stopwords)
+    public RussianAnalyzer(char[] charset, Map stopwords)
     {
         this.charset = charset;
         stopSet = new HashSet(stopwords.keySet());

Modified: lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java (original)
+++ lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java Sun Sep  7 12:22:40 2008
@@ -57,16 +57,17 @@
 import java.io.IOException;
 import java.io.Reader;
 import java.io.StringReader;
-
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.TreeMap;
-import java.util.Map.Entry;
-import java.util.Set;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
-import java.util.Iterator;
 import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.Map.Entry;
 
 import jline.ConsoleReader;
 
@@ -91,15 +92,15 @@
 
 /**
  * Various methods that interact with Lucene and provide info about the 
- * index, search, etc. Parts addapted from Lucene demo.
+ * index, search, etc. Parts adapted from Lucene demo.
  */
 class LuceneMethods {
 
   private int numDocs;
   private String indexName; //directory of this index
   private java.util.Iterator fieldIterator;
-  private Vector fields; //Fields as a vector
-  private Vector indexedFields; //Fields as a vector
+  private List fields; //Fields as a vector
+  private List indexedFields; //Fields as a vector
   private String fieldsArray[]; //Fields as an array
   private Searcher searcher;
   private Query query; //current query string
@@ -247,8 +248,8 @@
 
   private void getFieldInfo() throws IOException {
     IndexReader indexReader = IndexReader.open(indexName);
-    fields = new Vector();
-    indexedFields = new Vector();
+    fields = new ArrayList();
+    indexedFields = new ArrayList();
 
     //get the list of all field names
     fieldIterator = indexReader.getFieldNames(FieldOption.ALL).iterator();
@@ -274,14 +275,14 @@
   private void invertDocument(Document doc)
     throws IOException {
 
-    Hashtable tokenHash = new Hashtable();
+    Map tokenMap = new HashMap();
     final int maxFieldLength = 10000;
 
     Analyzer analyzer = new StandardAnalyzer();
-    Enumeration fields = doc.fields();
+    Iterator fields = doc.getFields().iterator();
     final Token reusableToken = new Token();
-    while (fields.hasMoreElements()) {
-      Field field = (Field) fields.nextElement();
+    while (fields.hasNext()) {
+      Field field = (Field) fields.next();
       String fieldName = field.name();
 
 
@@ -304,12 +305,12 @@
               position += (nextToken.getPositionIncrement() - 1);
               position++;
               String name = nextToken.term();
-              Integer Count = (Integer) tokenHash.get(name);
+              Integer Count = (Integer) tokenMap.get(name);
               if (Count == null) { // not in there yet
-                tokenHash.put(name, new Integer(1)); //first one
+                tokenMap.put(name, new Integer(1)); //first one
               } else {
                 int count = Count.intValue();
-                tokenHash.put(name, new Integer(count + 1));
+                tokenMap.put(name, new Integer(count + 1));
               }
               if (position > maxFieldLength) break;
             }
@@ -320,7 +321,7 @@
 
       }
     }
-    Entry[] sortedHash = getSortedHashtableEntries(tokenHash);
+    Entry[] sortedHash = getSortedMapEntries(tokenMap);
     for (int ii = 0; ii < sortedHash.length && ii < 10; ii++) {
       Entry currentEntry = sortedHash[ii];
       message((ii + 1) + ":" + currentEntry.getKey() + " " + currentEntry.getValue());
@@ -353,17 +354,16 @@
     indexReader.close();
   }
 
-  /** Sort Hashtable values
-   * @param h the hashtable we're sorting
+  /** Sort Map values
+   * @param m the map we're sorting
    * from http://developer.java.sun.com/developer/qow/archive/170/index.jsp
    */
-
   public static Entry[]
-    getSortedHashtableEntries(Hashtable h) {
-    Set set = h.entrySet();
+    getSortedMapEntries(Map m) {
+    Set set = m.entrySet();
     Entry[] entries =
       (Entry[]) set.toArray(
-        new Entry[set.size()]);
+          new Entry[set.size()]);
     Arrays.sort(entries, new Comparator() {
       public int compare(Object o1, Object o2) {
         Object v1 = ((Entry) o1).getValue();

Modified: lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java (original)
+++ lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java Sun Sep  7 12:22:40 2008
@@ -28,8 +28,9 @@
 import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
-import java.util.Enumeration;
+import java.util.Iterator;
 import java.util.LinkedHashSet;
+import java.util.List;
 import java.util.Set;
 
 import junit.framework.TestCase;
@@ -350,7 +351,7 @@
   private String[] readLines(File file) throws Exception {
     BufferedReader reader = new BufferedReader(new InputStreamReader(
         new FileInputStream(file))); 
-    ArrayList lines = new ArrayList();
+    List lines = new ArrayList();
     String line;  
     while ((line = reader.readLine()) != null) {
       String t = line.trim(); 
@@ -373,9 +374,9 @@
   
   private MemoryIndex createMemoryIndex(Document doc) {
     MemoryIndex index = new MemoryIndex();
-    Enumeration iter = doc.fields();
-    while (iter.hasMoreElements()) {
-      Field field = (Field) iter.nextElement();
+    Iterator iter = doc.getFields().iterator();
+    while (iter.hasNext()) {
+      Field field = (Field) iter.next();
       index.addField(field.name(), field.stringValue(), analyzer);
     }
     return index;

Modified: lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.java (original)
+++ lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.java Sun Sep  7 12:22:40 2008
@@ -252,13 +252,20 @@
     return locale;
   }
 
+  /**
+   * @deprecated use {@link #addClause(List, int, int, Query)} instead.
+   */
   protected void addClause(Vector clauses, int conj, int modifier, Query q) {
+    addClause((List) clauses, conj, modifier, q);
+  }
+
+  protected void addClause(List clauses, int conj, int modifier, Query q) {
     boolean required, prohibited;
 
     // If this term is introduced by AND, make the preceding term required,
     // unless it's already prohibited
     if (clauses.size() > 0 && conj == CONJ_AND) {
-      BooleanClause c = (BooleanClause) clauses.elementAt(clauses.size()-1);
+      BooleanClause c = (BooleanClause) clauses.get(clauses.size()-1);
       if (!c.isProhibited())
         c.setOccur(BooleanClause.Occur.MUST);
     }
@@ -268,7 +275,7 @@
       // unless it's prohibited (that means we leave -a OR b but +a OR b-->a OR b)
       // notice if the input is a OR b, first term is parsed as required; without
       // this modification a OR b would parsed as +a OR b
-      BooleanClause c = (BooleanClause) clauses.elementAt(clauses.size()-1);
+      BooleanClause c = (BooleanClause) clauses.get(clauses.size()-1);
       if (!c.isProhibited())
         c.setOccur(BooleanClause.Occur.SHOULD);
     }
@@ -293,11 +300,11 @@
       required   = (!prohibited && conj != CONJ_OR);
     }
     if (required && !prohibited)
-      clauses.addElement(new BooleanClause(q, BooleanClause.Occur.MUST));
+      clauses.add(new BooleanClause(q, BooleanClause.Occur.MUST));
     else if (!required && !prohibited)
-      clauses.addElement(new BooleanClause(q, BooleanClause.Occur.SHOULD));
+      clauses.add(new BooleanClause(q, BooleanClause.Occur.SHOULD));
     else if (!required && prohibited)
-      clauses.addElement(new BooleanClause(q, BooleanClause.Occur.MUST_NOT));
+      clauses.add(new BooleanClause(q, BooleanClause.Occur.MUST_NOT));
     else
       throw new RuntimeException("Clause cannot be both required and prohibited");
   }
@@ -310,7 +317,7 @@
     // PhraseQuery, or nothing based on the term count
 
     TokenStream source = analyzer.tokenStream(field, new StringReader(queryText));
-    Vector v = new Vector();
+    List list = new ArrayList();
     final org.apache.lucene.analysis.Token reusableToken = new org.apache.lucene.analysis.Token();
     org.apache.lucene.analysis.Token nextToken;
     int positionCount = 0;
@@ -325,7 +332,7 @@
       }
       if (nextToken == null)
         break;
-      v.addElement(nextToken.clone());
+      list.add(nextToken.clone());
       if (nextToken.getPositionIncrement() == 1)
         positionCount++;
       else
@@ -338,18 +345,18 @@
       // ignore
     }
 
-    if (v.size() == 0)
+    if (list.size() == 0)
       return null;
-    else if (v.size() == 1) {
-      nextToken = (org.apache.lucene.analysis.Token) v.elementAt(0);
+    else if (list.size() == 1) {
+      nextToken = (org.apache.lucene.analysis.Token) list.get(0);
       return new TermQuery(new Term(field, nextToken.term()));
     } else {
       if (severalTokensAtSamePosition) {
         if (positionCount == 1) {
           // no phrase query:
           BooleanQuery q = new BooleanQuery();
-          for (int i = 0; i < v.size(); i++) {
-            nextToken = (org.apache.lucene.analysis.Token) v.elementAt(i);
+          for (int i = 0; i < list.size(); i++) {
+            nextToken = (org.apache.lucene.analysis.Token) list.get(i);
             TermQuery currentQuery = new TermQuery(
                 new Term(field, nextToken.term()));
             q.add(currentQuery, BooleanClause.Occur.SHOULD);
@@ -360,8 +367,8 @@
           // phrase query:
           MultiPhraseQuery mpq = new MultiPhraseQuery();
           List multiTerms = new ArrayList();
-          for (int i = 0; i < v.size(); i++) {
-            nextToken = (org.apache.lucene.analysis.Token) v.elementAt(i);
+          for (int i = 0; i < list.size(); i++) {
+            nextToken = (org.apache.lucene.analysis.Token) list.get(i);
             if (nextToken.getPositionIncrement() == 1 && multiTerms.size() > 0) {
               mpq.add((Term[])multiTerms.toArray(new Term[0]));
               multiTerms.clear();
@@ -375,10 +382,9 @@
       else {
         PhraseQuery q = new PhraseQuery();
         q.setSlop(phraseSlop);
-        for (int i = 0; i < v.size(); i++) {
+        for (int i = 0; i < list.size(); i++) {
           q.add(new Term(field, ((org.apache.lucene.analysis.Token)
-              v.elementAt(i)).term()));
-
+              list.get(i)).term()));
         }
         return q;
       }
@@ -440,14 +446,33 @@
    * Can be overridden by extending classes, to modify query being
    * returned.
    *
-   * @param clauses Vector that contains {@link BooleanClause} instances
+   * @param clauses List that contains {@link BooleanClause} instances
    *    to join.
    *
    * @return Resulting {@link Query} object.
    * @exception ParseException throw in overridden method to disallow
+   * @deprecated use {@link #getBooleanQuery(List)} instead
    */
   protected Query getBooleanQuery(Vector clauses) throws ParseException
   {
+    return getBooleanQuery((List) clauses, false);
+  }
+
+  /**
+   * Factory method for generating query, given a set of clauses.
+   * By default creates a boolean query composed of clauses passed in.
+   *
+   * Can be overridden by extending classes, to modify query being
+   * returned.
+   *
+   * @param clauses List that contains {@link BooleanClause} instances
+   *    to join.
+   *
+   * @return Resulting {@link Query} object.
+   * @exception ParseException throw in overridden method to disallow
+   */
+  protected Query getBooleanQuery(List clauses) throws ParseException
+  {
     return getBooleanQuery(clauses, false);
   }
 
@@ -458,22 +483,42 @@
    * Can be overridden by extending classes, to modify query being
    * returned.
    *
-   * @param clauses Vector that contains {@link BooleanClause} instances
+   * @param clauses List that contains {@link BooleanClause} instances
    *    to join.
    * @param disableCoord true if coord scoring should be disabled.
    *
    * @return Resulting {@link Query} object.
    * @exception ParseException throw in overridden method to disallow
+   * @deprecated use {@link #getBooleanQuery(List, boolean)} instead
    */
   protected Query getBooleanQuery(Vector clauses, boolean disableCoord)
     throws ParseException
   {
+    return getBooleanQuery((List) clauses, disableCoord);
+  }
+
+  /**
+   * Factory method for generating query, given a set of clauses.
+   * By default creates a boolean query composed of clauses passed in.
+   *
+   * Can be overridden by extending classes, to modify query being
+   * returned.
+   *
+   * @param clauses List that contains {@link BooleanClause} instances
+   *    to join.
+   * @param disableCoord true if coord scoring should be disabled.
+   *
+   * @return Resulting {@link Query} object.
+   * @exception ParseException throw in overridden method to disallow
+   */
+  protected Query getBooleanQuery(List clauses, boolean disableCoord)
+      throws ParseException {
     if (clauses == null || clauses.size() == 0)
       return null;
 
     BooleanQuery query = new BooleanQuery(disableCoord);
     for (int i = 0; i < clauses.size(); i++) {
-      query.add((BooleanClause)clauses.elementAt(i));
+      query.add((BooleanClause)clauses.get(i));
     }
     return query;
   }
@@ -675,7 +720,7 @@
   }
 
   final public Query Query(String field) throws ParseException {
-  Vector clauses = new Vector();
+  List clauses = new ArrayList();
   Query q, firstQuery=null;
   boolean orPresent = false;
   int modifier;
@@ -727,7 +772,7 @@
   }
 
   final public Query andExpression(String field) throws ParseException {
-  Vector clauses = new Vector();
+  List clauses = new ArrayList();
   Query q, firstQuery=null;
   int modifier;
     q = Clause(field);

Modified: lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.jj
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.jj?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.jj (original)
+++ lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.jj Sun Sep  7 12:22:40 2008
@@ -166,28 +166,28 @@
       throw new ParseException("Too many boolean clauses");
     }
   }
-  
+
    /**
    * @return Returns the analyzer.
    */
   public Analyzer getAnalyzer() {
     return analyzer;
   }
-  
+
   /**
    * @return Returns the field.
    */
   public String getField() {
     return field;
   }
-  
+
    /**
    * Get the minimal similarity for fuzzy queries.
    */
   public float getFuzzyMinSim() {
       return fuzzyMinSim;
   }
-  
+
   /**
    * Set the minimum similarity for fuzzy queries.
    * Default is 0.5f.
@@ -195,7 +195,7 @@
   public void setFuzzyMinSim(float fuzzyMinSim) {
       this.fuzzyMinSim = fuzzyMinSim;
   }
-  
+
    /**
    * Get the prefix length for fuzzy queries. 
    * @return Returns the fuzzyPrefixLength.
@@ -203,7 +203,7 @@
   public int getFuzzyPrefixLength() {
     return fuzzyPrefixLength;
   }
-  
+
   /**
    * Set the prefix length for fuzzy queries. Default is 0.
    * @param fuzzyPrefixLength The fuzzyPrefixLength to set.
@@ -276,13 +276,20 @@
     return locale;
   }
 
+  /**
+   * @deprecated use {@link #addClause(List, int, int, Query)} instead.
+   */
   protected void addClause(Vector clauses, int conj, int modifier, Query q) {
+    addClause((List) clauses, conj, modifier, q);
+  }
+
+  protected void addClause(List clauses, int conj, int modifier, Query q) {
     boolean required, prohibited;
 
     // If this term is introduced by AND, make the preceding term required,
     // unless it's already prohibited
     if (clauses.size() > 0 && conj == CONJ_AND) {
-      BooleanClause c = (BooleanClause) clauses.elementAt(clauses.size()-1);
+      BooleanClause c = (BooleanClause) clauses.get(clauses.size()-1);
       if (!c.isProhibited())
         c.setOccur(BooleanClause.Occur.MUST);
     }
@@ -292,7 +299,7 @@
       // unless it's prohibited (that means we leave -a OR b but +a OR b-->a OR b)
       // notice if the input is a OR b, first term is parsed as required; without
       // this modification a OR b would parsed as +a OR b
-      BooleanClause c = (BooleanClause) clauses.elementAt(clauses.size()-1);
+      BooleanClause c = (BooleanClause) clauses.get(clauses.size()-1);
       if (!c.isProhibited())
         c.setOccur(BooleanClause.Occur.SHOULD);
     }
@@ -317,15 +324,15 @@
       required   = (!prohibited && conj != CONJ_OR);
     }
     if (required && !prohibited)
-      clauses.addElement(new BooleanClause(q, BooleanClause.Occur.MUST));
+      clauses.add(new BooleanClause(q, BooleanClause.Occur.MUST));
     else if (!required && !prohibited)
-      clauses.addElement(new BooleanClause(q, BooleanClause.Occur.SHOULD));
+      clauses.add(new BooleanClause(q, BooleanClause.Occur.SHOULD));
     else if (!required && prohibited)
-      clauses.addElement(new BooleanClause(q, BooleanClause.Occur.MUST_NOT));
+      clauses.add(new BooleanClause(q, BooleanClause.Occur.MUST_NOT));
     else
       throw new RuntimeException("Clause cannot be both required and prohibited");
   }
-  
+
   /**
    * @exception ParseException throw in overridden method to disallow
    */
@@ -334,7 +341,7 @@
     // PhraseQuery, or nothing based on the term count
 
     TokenStream source = analyzer.tokenStream(field, new StringReader(queryText));
-    Vector v = new Vector();
+    List list = new ArrayList();
     final org.apache.lucene.analysis.Token reusableToken = new org.apache.lucene.analysis.Token();
     org.apache.lucene.analysis.Token nextToken;
     int positionCount = 0;
@@ -349,7 +356,7 @@
       }
       if (nextToken == null)
         break;
-      v.addElement(nextToken.clone());
+      list.add(nextToken.clone());
       if (nextToken.getPositionIncrement() == 1)
         positionCount++;
       else
@@ -362,18 +369,18 @@
       // ignore
     }
 
-    if (v.size() == 0)
+    if (list.size() == 0)
       return null;
-    else if (v.size() == 1) {
-      nextToken = (org.apache.lucene.analysis.Token) v.elementAt(0);
+    else if (list.size() == 1) {
+      nextToken = (org.apache.lucene.analysis.Token) list.get(0);
       return new TermQuery(new Term(field, nextToken.term()));
     } else {
       if (severalTokensAtSamePosition) {
         if (positionCount == 1) {
           // no phrase query:
           BooleanQuery q = new BooleanQuery();
-          for (int i = 0; i < v.size(); i++) {
-            nextToken = (org.apache.lucene.analysis.Token) v.elementAt(i);
+          for (int i = 0; i < list.size(); i++) {
+            nextToken = (org.apache.lucene.analysis.Token) list.get(i);
             TermQuery currentQuery = new TermQuery(
                 new Term(field, nextToken.term()));
             q.add(currentQuery, BooleanClause.Occur.SHOULD);
@@ -384,8 +391,8 @@
           // phrase query:
           MultiPhraseQuery mpq = new MultiPhraseQuery();
           List multiTerms = new ArrayList();
-          for (int i = 0; i < v.size(); i++) {
-            nextToken = (org.apache.lucene.analysis.Token) v.elementAt(i);
+          for (int i = 0; i < list.size(); i++) {
+            nextToken = (org.apache.lucene.analysis.Token) list.get(i);
             if (nextToken.getPositionIncrement() == 1 && multiTerms.size() > 0) {
               mpq.add((Term[])multiTerms.toArray(new Term[0]));
               multiTerms.clear();
@@ -399,16 +406,15 @@
       else {
         PhraseQuery q = new PhraseQuery();
         q.setSlop(phraseSlop);
-        for (int i = 0; i < v.size(); i++) {
-          q.add(new Term(field, ((org.apache.lucene.analysis.Token) 
-              v.elementAt(i)).term()));
-
+        for (int i = 0; i < list.size(); i++) {
+          q.add(new Term(field, ((org.apache.lucene.analysis.Token)
+              list.get(i)).term()));
         }
         return q;
       }
     }
   }
-  
+
   /**
    * Base implementation delegates to {@link #getFieldQuery(String,String)}.
    * This method may be overridden, for example, to return
@@ -416,8 +422,8 @@
    *
    * @exception ParseException throw in overridden method to disallow
    */
-  protected Query getFieldQuery(String field, String queryText, int slop) 
-  	throws ParseException {
+  protected Query getFieldQuery(String field, String queryText, int slop)
+        throws ParseException {
     Query query = getFieldQuery(field, queryText);
 
     if (query instanceof PhraseQuery) {
@@ -429,7 +435,7 @@
 
     return query;
   }
-  
+
   /**
    * @exception ParseException throw in overridden method to disallow
    */
@@ -464,14 +470,33 @@
    * Can be overridden by extending classes, to modify query being
    * returned.
    *
-   * @param clauses Vector that contains {@link BooleanClause} instances
+   * @param clauses List that contains {@link BooleanClause} instances
    *    to join.
    *
    * @return Resulting {@link Query} object.
    * @exception ParseException throw in overridden method to disallow
+   * @deprecated use {@link #getBooleanQuery(List)} instead
    */
   protected Query getBooleanQuery(Vector clauses) throws ParseException
   {
+    return getBooleanQuery((List) clauses, false);
+  }
+
+  /**
+   * Factory method for generating query, given a set of clauses.
+   * By default creates a boolean query composed of clauses passed in.
+   *
+   * Can be overridden by extending classes, to modify query being
+   * returned.
+   *
+   * @param clauses List that contains {@link BooleanClause} instances
+   *    to join.
+   *
+   * @return Resulting {@link Query} object.
+   * @exception ParseException throw in overridden method to disallow
+   */
+  protected Query getBooleanQuery(List clauses) throws ParseException
+  {
     return getBooleanQuery(clauses, false);
   }
 
@@ -482,22 +507,42 @@
    * Can be overridden by extending classes, to modify query being
    * returned.
    *
-   * @param clauses Vector that contains {@link BooleanClause} instances
+   * @param clauses List that contains {@link BooleanClause} instances
    *    to join.
    * @param disableCoord true if coord scoring should be disabled.
    *
    * @return Resulting {@link Query} object.
    * @exception ParseException throw in overridden method to disallow
+   * @deprecated use {@link #getBooleanQuery(List, boolean)} instead
    */
   protected Query getBooleanQuery(Vector clauses, boolean disableCoord)
     throws ParseException
   {
+    return getBooleanQuery((List) clauses, disableCoord);
+  }
+
+  /**
+   * Factory method for generating query, given a set of clauses.
+   * By default creates a boolean query composed of clauses passed in.
+   *
+   * Can be overridden by extending classes, to modify query being
+   * returned.
+   *
+   * @param clauses List that contains {@link BooleanClause} instances
+   *    to join.
+   * @param disableCoord true if coord scoring should be disabled.
+   *
+   * @return Resulting {@link Query} object.
+   * @exception ParseException throw in overridden method to disallow
+   */
+  protected Query getBooleanQuery(List clauses, boolean disableCoord)
+      throws ParseException {
     if (clauses == null || clauses.size() == 0)
       return null;
 
     BooleanQuery query = new BooleanQuery(disableCoord);
     for (int i = 0; i < clauses.size(); i++) {
-      query.add((BooleanClause)clauses.elementAt(i));
+      query.add((BooleanClause)clauses.get(i));
     }
     return query;
   }
@@ -563,7 +608,7 @@
     Term t = new Term(field, termStr);
     return new PrefixQuery(t);
   }
-  
+
    /**
    * Factory method for generating a query (similar to
    * {@link #getWildcardQuery}). Called when parser parses
@@ -733,7 +778,7 @@
 
 Query Query(String field) :
 {
-  Vector clauses = new Vector();
+  List clauses = new ArrayList();
   Query q, firstQuery=null;
   boolean orPresent = false;
   int modifier;
@@ -760,7 +805,7 @@
 
 Query andExpression(String field) :
 {
-  Vector clauses = new Vector();
+  List clauses = new ArrayList();
   Query q, firstQuery=null;
   int modifier;
 }

Modified: lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/ComposedQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/ComposedQuery.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/ComposedQuery.java (original)
+++ lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/ComposedQuery.java Sun Sep  7 12:22:40 2008
@@ -48,7 +48,7 @@
   public boolean isOperatorInfix() { return operatorInfix; } /* else prefix operator */
   
   public List makeLuceneSubQueriesField(String fn, BasicQueryFactory qf) {
-    ArrayList luceneSubQueries = new ArrayList();
+    List luceneSubQueries = new ArrayList();
     Iterator sqi = getSubQueriesIterator();
     while (sqi.hasNext()) {
       luceneSubQueries.add( ((SrndQuery) sqi.next()).makeLuceneQueryField(fn, qf));

Modified: lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/FieldsQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/FieldsQuery.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/FieldsQuery.java (original)
+++ lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/FieldsQuery.java Sun Sep  7 12:22:40 2008
@@ -24,11 +24,11 @@
 
 public class FieldsQuery extends SrndQuery { /* mostly untested */
   private SrndQuery q;
-  private ArrayList fieldNames;
+  private List fieldNames;
   private final char fieldOp;
   private final String OrOperatorName = "OR"; /* for expanded queries, not normally visible */
   
-  public FieldsQuery(SrndQuery q, ArrayList fieldNames, char fieldOp) {
+  public FieldsQuery(SrndQuery q, List fieldNames, char fieldOp) {
     this.q = q;
     this.fieldNames = fieldNames;
     this.fieldOp = fieldOp;
@@ -49,7 +49,7 @@
     if (fieldNames.size() == 1) { /* single field name: no new queries needed */
       return q.makeLuceneQueryFieldNoBoost((String) fieldNames.get(0), qf);
     } else { /* OR query over the fields */
-      ArrayList queries = new ArrayList();
+      List queries = new ArrayList();
       Iterator fni = getFieldNames().listIterator();
       SrndQuery qc;
       while (fni.hasNext()) {

Modified: lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SimpleTerm.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SimpleTerm.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SimpleTerm.java (original)
+++ lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SimpleTerm.java Sun Sep  7 12:22:40 2008
@@ -16,12 +16,14 @@
  * limitations under the License.
  */
 
-import java.util.ArrayList;
 import java.io.IOException;
-import org.apache.lucene.index.Term;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.search.Query;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.Query;
 
 public abstract class SimpleTerm
   extends SrndQuery
@@ -78,7 +80,7 @@
       }
       
       public Query rewrite(IndexReader reader) throws IOException {
-        final ArrayList luceneSubQueries = new ArrayList();
+        final List luceneSubQueries = new ArrayList();
         visitMatchingTerms( reader, fieldName,
             new MatchingTermVisitor() {
               public void visitMatchingTerm(Term term) throws IOException {

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/BaseListModel.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/BaseListModel.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/BaseListModel.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/BaseListModel.java Sun Sep  7 12:22:40 2008
@@ -16,15 +16,17 @@
  * limitations under the License.
  */
 
-import javax.swing.*;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.AbstractListModel;
 
 /**
  * @author Jonathan Simon - jonathan_s_simon@yahoo.com
  */
 public class BaseListModel extends AbstractListModel {
-    private ArrayList data = new ArrayList();
+    private List data = new ArrayList();
 
     public BaseListModel(Iterator iterator) {
         while (iterator.hasNext()) {

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/BaseTableModel.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/BaseTableModel.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/BaseTableModel.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/BaseTableModel.java Sun Sep  7 12:22:40 2008
@@ -16,16 +16,18 @@
  * limitations under the License.
  */
 
-import javax.swing.table.AbstractTableModel;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.table.AbstractTableModel;
 
 /**
  * @author Jonathan Simon - jonathan_s_simon@yahoo.com
  */
 public class BaseTableModel extends AbstractTableModel {
-    private ArrayList columnNames = new ArrayList();
-    private ArrayList rows = new ArrayList();
+    private List columnNames = new ArrayList();
+    private List rows = new ArrayList();
 
     public BaseTableModel(Iterator data) {
         columnNames.add("Name");

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java Sun Sep  7 12:22:40 2008
@@ -17,6 +17,7 @@
  */
 
 import java.util.ArrayList;
+import java.util.List;
 
 import javax.swing.ListModel;
 
@@ -28,7 +29,7 @@
 public class TestBasicList extends TestCase {
     private ListModel baseListModel;
     private ListSearcher listSearcher;
-    private ArrayList list;
+    private List list;
 
     protected void setUp() throws Exception {
         list = new ArrayList();

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java Sun Sep  7 12:22:40 2008
@@ -17,6 +17,7 @@
  */
 
 import java.util.ArrayList;
+import java.util.List;
 
 import javax.swing.table.TableModel;
 
@@ -28,7 +29,7 @@
 public class TestBasicTable extends TestCase {
     private TableModel baseTableModel;
     private TableSearcher tableSearcher;
-    private ArrayList list;
+    private List list;
 
     protected void setUp() throws Exception {
         list = new ArrayList();

Modified: lucene/java/trunk/src/demo/org/apache/lucene/demo/html/Entities.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/demo/org/apache/lucene/demo/html/Entities.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/src/demo/org/apache/lucene/demo/html/Entities.java (original)
+++ lucene/java/trunk/src/demo/org/apache/lucene/demo/html/Entities.java Sun Sep  7 12:22:40 2008
@@ -17,10 +17,11 @@
  * limitations under the License.
  */
 
-import java.util.*;
+import java.util.HashMap;
+import java.util.Map;
 
 public class Entities {
-  static final Hashtable decoder = new Hashtable(300);
+  static final Map decoder = new HashMap(300);
   static final String[]  encoder = new String[0x100];
 
   static final String decode(String entity) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java Sun Sep  7 12:22:40 2008
@@ -2952,7 +2952,7 @@
               final SegmentInfo info = sis.info(j);
               docCount += info.docCount;
               assert !segmentInfos.contains(info);
-              segmentInfos.addElement(info);	  // add each info
+              segmentInfos.add(info);	  // add each info
             }
           }
         }
@@ -3077,7 +3077,7 @@
               SegmentInfo info = sis.info(j);
               assert !segmentInfos.contains(info): "dup info dir=" + info.dir + " name=" + info.name;
               docCount += info.docCount;
-              segmentInfos.addElement(info); // add each info
+              segmentInfos.add(info); // add each info
             }
           }
         }
@@ -3287,10 +3287,10 @@
           }
 
           synchronized(this) {
-            segmentInfos.setSize(0);                      // pop old infos & add new
+            segmentInfos.clear();                      // pop old infos & add new
             info = new SegmentInfo(mergedName, docCount, directory, false, true,
                                    -1, null, false, merger.hasProx());
-            segmentInfos.addElement(info);
+            segmentInfos.add(info);
           }
 
           // Notify DocumentsWriter that the flushed count just increased
@@ -3650,7 +3650,7 @@
       docWriter.pushDeletes();
 
       if (flushDocs)
-        segmentInfos.addElement(newSegment);
+        segmentInfos.add(newSegment);
 
       if (flushDeletes) {
         flushDeletesCount++;

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/MultiReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/MultiReader.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/MultiReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/MultiReader.java Sun Sep  7 12:22:40 2008
@@ -17,13 +17,14 @@
  * limitations under the License.
  */
 
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.FieldSelector;
-
 import java.io.IOException;
 import java.util.Collection;
-import java.util.Hashtable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.FieldSelector;
 import org.apache.lucene.index.MultiSegmentReader.MultiTermDocs;
 import org.apache.lucene.index.MultiSegmentReader.MultiTermEnum;
 import org.apache.lucene.index.MultiSegmentReader.MultiTermPositions;
@@ -36,7 +37,7 @@
   protected IndexReader[] subReaders;
   private int[] starts;                           // 1st docno for each segment
   private boolean[] decrefOnClose;                // remember which subreaders to decRef on close
-  private Hashtable normsCache = new Hashtable();
+  private Map normsCache = new HashMap();
   private int maxDoc = 0;
   private int numDocs = -1;
   private boolean hasDeletions = false;
@@ -288,7 +289,9 @@
 
   protected void doSetNorm(int n, String field, byte value)
     throws CorruptIndexException, IOException {
-    normsCache.remove(field);                         // clear cache
+    synchronized (normsCache) {
+      normsCache.remove(field);                         // clear cache
+    }
     int i = readerIndex(n);                           // find segment num
     subReaders[i].setNorm(n-starts[i], field, value); // dispatch
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/MultiSegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/MultiSegmentReader.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/MultiSegmentReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/MultiSegmentReader.java Sun Sep  7 12:22:40 2008
@@ -17,26 +17,26 @@
  * limitations under the License.
  */
 
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.FieldSelector;
-import org.apache.lucene.store.Directory;
-
 import java.io.IOException;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.FieldSelector;
+import org.apache.lucene.store.Directory;
+
 /** 
  * An IndexReader which reads indexes with multiple segments.
  */
 class MultiSegmentReader extends DirectoryIndexReader {
   protected SegmentReader[] subReaders;
   private int[] starts;                           // 1st docno for each segment
-  private Hashtable normsCache = new Hashtable();
+  private Map normsCache = new HashMap();
   private int maxDoc = 0;
   private int numDocs = -1;
   private boolean hasDeletions = false;
@@ -149,17 +149,18 @@
     
     // try to copy unchanged norms from the old normsCache to the new one
     if (oldNormsCache != null) {
-      Iterator it = oldNormsCache.keySet().iterator();
+      Iterator it = oldNormsCache.entrySet().iterator();
       while (it.hasNext()) {
-        String field = (String) it.next();
+        Map.Entry entry = (Map.Entry) it.next();
+        String field = (String) entry.getKey();
         if (!hasNorms(field)) {
           continue;
         }
-        
-        byte[] oldBytes = (byte[]) oldNormsCache.get(field);
-  
+
+        byte[] oldBytes = (byte[]) entry.getValue();
+
         byte[] bytes = new byte[maxDoc()];
-        
+
         for (int i = 0; i < subReaders.length; i++) {
           Integer oldReaderIndex = ((Integer) segmentReaders.get(subReaders[i].getSegmentName()));
 
@@ -175,7 +176,7 @@
             subReaders[i].norms(field, bytes, starts[i]);
           }
         }
-        
+
         normsCache.put(field, bytes);      // update cache
       }
     }
@@ -353,7 +354,9 @@
 
   protected void doSetNorm(int n, String field, byte value)
     throws CorruptIndexException, IOException {
-    normsCache.remove(field);                         // clear cache
+    synchronized (normsCache) {
+      normsCache.remove(field);                         // clear cache      
+    }
     int i = readerIndex(n);                           // find segment num
     subReaders[i].setNorm(n-starts[i], field, value); // dispatch
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java Sun Sep  7 12:22:40 2008
@@ -91,7 +91,7 @@
   private static PrintStream infoStream;
 
   public final SegmentInfo info(int i) {
-    return (SegmentInfo) elementAt(i);
+    return (SegmentInfo) get(i);
   }
 
   /**
@@ -231,7 +231,7 @@
       }
       
       for (int i = input.readInt(); i > 0; i--) { // read segmentInfos
-        addElement(new SegmentInfo(directory, format, input));
+        add(new SegmentInfo(directory, format, input));
       }
       
       if(format >= 0){    // in old format the version number may be at the end of the file
@@ -337,7 +337,7 @@
   public Object clone() {
     SegmentInfos sis = (SegmentInfos) super.clone();
     for(int i=0;i<sis.size();i++) {
-      sis.setElementAt(sis.info(i).clone(), i);
+      sis.set(i, sis.info(i).clone());
     }
     return sis;
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java Sun Sep  7 12:22:40 2008
@@ -17,17 +17,18 @@
  * limitations under the License.
  */
 
-import java.util.Vector;
-import java.util.Iterator;
-import java.util.Collection;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
 
-import org.apache.lucene.document.FieldSelector;
 import org.apache.lucene.document.Document;
+import org.apache.lucene.document.FieldSelector;
 import org.apache.lucene.document.FieldSelectorResult;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.IndexOutput;
 import org.apache.lucene.store.IndexInput;
+import org.apache.lucene.store.IndexOutput;
 
 /**
  * The SegmentMerger class combines two or more Segments, represented by an IndexReader ({@link #add},
@@ -49,7 +50,7 @@
   private String segment;
   private int termIndexInterval = IndexWriter.DEFAULT_TERM_INDEX_INTERVAL;
 
-  private Vector readers = new Vector();
+  private List readers = new ArrayList();
   private FieldInfos fieldInfos;
   
   private int mergedDocs;
@@ -93,7 +94,7 @@
    * @param reader
    */
   final void add(IndexReader reader) {
-    readers.addElement(reader);
+    readers.add(reader);
   }
 
   /**
@@ -102,7 +103,7 @@
    * @return The ith reader to be merged
    */
   final IndexReader segmentReader(int i) {
-    return (IndexReader) readers.elementAt(i);
+    return (IndexReader) readers.get(i);
   }
 
   /**
@@ -152,18 +153,18 @@
    */
   final void closeReaders() throws IOException {
     for (int i = 0; i < readers.size(); i++) {  // close readers
-      IndexReader reader = (IndexReader) readers.elementAt(i);
+      IndexReader reader = (IndexReader) readers.get(i);
       reader.close();
     }
   }
 
-  final Vector createCompoundFile(String fileName)
+  final List createCompoundFile(String fileName)
           throws IOException {
     CompoundFileWriter cfsWriter =
       new CompoundFileWriter(directory, fileName, checkAbort);
 
-    Vector files =
-      new Vector(IndexFileNames.COMPOUND_EXTENSIONS.length + 1);    
+    List files =
+      new ArrayList(IndexFileNames.COMPOUND_EXTENSIONS.length + 1);    
     
     // Basic files
     for (int i = 0; i < IndexFileNames.COMPOUND_EXTENSIONS.length; i++) {
@@ -229,7 +230,7 @@
     // FieldInfos, then we can do a bulk copy of the
     // stored fields:
     for (int i = 0; i < readers.size(); i++) {
-      IndexReader reader = (IndexReader) readers.elementAt(i);
+      IndexReader reader = (IndexReader) readers.get(i);
       if (reader instanceof SegmentReader) {
         SegmentReader segmentReader = (SegmentReader) reader;
         boolean same = true;
@@ -261,14 +262,14 @@
       // name -> number mapping are the same.  So, we start
       // with the fieldInfos of the last segment in this
       // case, to keep that numbering.
-      final SegmentReader sr = (SegmentReader) readers.elementAt(readers.size()-1);
+      final SegmentReader sr = (SegmentReader) readers.get(readers.size()-1);
       fieldInfos = (FieldInfos) sr.fieldInfos.clone();
     } else {
       fieldInfos = new FieldInfos();		  // merge field names
     }
 
     for (int i = 0; i < readers.size(); i++) {
-      IndexReader reader = (IndexReader) readers.elementAt(i);
+      IndexReader reader = (IndexReader) readers.get(i);
       if (reader instanceof SegmentReader) {
         SegmentReader segmentReader = (SegmentReader) reader;
         for (int j = 0; j < segmentReader.getFieldInfos().size(); j++) {
@@ -307,7 +308,7 @@
 
       try {
         for (int i = 0; i < readers.size(); i++) {
-          final IndexReader reader = (IndexReader) readers.elementAt(i);
+          final IndexReader reader = (IndexReader) readers.get(i);
           final SegmentReader matchingSegmentReader = matchingSegmentReaders[i];
           final FieldsReader matchingFieldsReader;
           final boolean hasMatchingReader;
@@ -385,7 +386,7 @@
       // are no deletions in any of these segments, so we
       // just sum numDocs() of each segment to get total docCount
       for (int i = 0; i < readers.size(); i++)
-        docCount += ((IndexReader) readers.elementAt(i)).numDocs();
+        docCount += ((IndexReader) readers.get(i)).numDocs();
 
     return docCount;
   }
@@ -418,7 +419,7 @@
           hasMatchingReader = false;
           matchingVectorsReader = null;
         }
-        IndexReader reader = (IndexReader) readers.elementAt(r);
+        IndexReader reader = (IndexReader) readers.get(r);
         final boolean hasDeletions = reader.hasDeletions();
         int maxDoc = reader.maxDoc();
         for (int docNum = 0; docNum < maxDoc;) {
@@ -510,7 +511,7 @@
     int base = 0;
     final int readerCount = readers.size();
     for (int i = 0; i < readerCount; i++) {
-      IndexReader reader = (IndexReader) readers.elementAt(i);
+      IndexReader reader = (IndexReader) readers.get(i);
       TermEnum termEnum = reader.terms();
       SegmentMergeInfo smi = new SegmentMergeInfo(base, termEnum, reader);
       int[] docMap  = smi.getDocMap();
@@ -750,7 +751,7 @@
             output.writeBytes(NORMS_HEADER,NORMS_HEADER.length);
           }
           for (int j = 0; j < readers.size(); j++) {
-            IndexReader reader = (IndexReader) readers.elementAt(j);
+            IndexReader reader = (IndexReader) readers.get(j);
             int maxDoc = reader.maxDoc();
             if (normBuffer == null || normBuffer.length < maxDoc) {
               // the buffer is too small for the current segment

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java Sun Sep  7 12:22:40 2008
@@ -18,14 +18,15 @@
  */
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.Vector;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.FieldSelector;
@@ -695,8 +696,8 @@
       undeleteAll = true;
   }
 
-  Vector files() throws IOException {
-    return new Vector(si.files());
+  List files() throws IOException {
+    return new ArrayList(si.files());
   }
 
   public TermEnum terms() {

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java Sun Sep  7 12:22:40 2008
@@ -17,6 +17,11 @@
  * limitations under the License.
  */
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
@@ -24,9 +29,6 @@
 import org.apache.lucene.search.PhraseQuery;
 import org.apache.lucene.search.Query;
 
-import java.util.Vector;
-import java.util.Map;
-
 /**
  * A QueryParser which constructs queries to search multiple fields.
  *
@@ -97,7 +99,7 @@
   
   protected Query getFieldQuery(String field, String queryText, int slop) throws ParseException {
     if (field == null) {
-      Vector clauses = new Vector();
+      List clauses = new ArrayList();
       for (int i = 0; i < fields.length; i++) {
         Query q = super.getFieldQuery(fields[i], queryText);
         if (q != null) {
@@ -139,7 +141,7 @@
   protected Query getFuzzyQuery(String field, String termStr, float minSimilarity) throws ParseException
   {
     if (field == null) {
-      Vector clauses = new Vector();
+      List clauses = new ArrayList();
       for (int i = 0; i < fields.length; i++) {
         clauses.add(new BooleanClause(getFuzzyQuery(fields[i], termStr, minSimilarity),
             BooleanClause.Occur.SHOULD));
@@ -152,7 +154,7 @@
   protected Query getPrefixQuery(String field, String termStr) throws ParseException
   {
     if (field == null) {
-      Vector clauses = new Vector();
+      List clauses = new ArrayList();
       for (int i = 0; i < fields.length; i++) {
         clauses.add(new BooleanClause(getPrefixQuery(fields[i], termStr),
             BooleanClause.Occur.SHOULD));
@@ -164,7 +166,7 @@
 
   protected Query getWildcardQuery(String field, String termStr) throws ParseException {
     if (field == null) {
-      Vector clauses = new Vector();
+      List clauses = new ArrayList();
       for (int i = 0; i < fields.length; i++) {
         clauses.add(new BooleanClause(getWildcardQuery(fields[i], termStr),
             BooleanClause.Occur.SHOULD));
@@ -177,7 +179,7 @@
  
   protected Query getRangeQuery(String field, String part1, String part2, boolean inclusive) throws ParseException {
     if (field == null) {
-      Vector clauses = new Vector();
+      List clauses = new ArrayList();
       for (int i = 0; i < fields.length; i++) {
         clauses.add(new BooleanClause(getRangeQuery(fields[i], part1, part2, inclusive),
             BooleanClause.Occur.SHOULD));

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java?rev=692921&r1=692920&r2=692921&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java Sun Sep  7 12:22:40 2008
@@ -164,7 +164,7 @@
   public Query parse(String query) throws ParseException {
     ReInit(new FastCharStream(new StringReader(query)));
     try {
-          // TopLevelQuery is a Query followed by the end-of-input (EOF)
+      // TopLevelQuery is a Query followed by the end-of-input (EOF)
       Query res = TopLevelQuery(field);
       return res!=null ? res : newBooleanQuery(false);
     }
@@ -342,7 +342,6 @@
     return useOldRangeQuery;
   }
 
-
   /**
    * Set locale used by date range parsing.
    */
@@ -412,13 +411,20 @@
     return resolution;
   }
 
+  /**
+   * @deprecated use {@link #addClause(List, int, int, Query)} instead.
+   */
   protected void addClause(Vector clauses, int conj, int mods, Query q) {
+    addClause((List) clauses, conj, mods, q);
+  }
+
+  protected void addClause(List clauses, int conj, int mods, Query q) {
     boolean required, prohibited;
 
     // If this term is introduced by AND, make the preceding term required,
     // unless it's already prohibited
     if (clauses.size() > 0 && conj == CONJ_AND) {
-      BooleanClause c = (BooleanClause) clauses.elementAt(clauses.size()-1);
+      BooleanClause c = (BooleanClause) clauses.get(clauses.size()-1);
       if (!c.isProhibited())
         c.setOccur(BooleanClause.Occur.MUST);
     }
@@ -428,7 +434,7 @@
       // unless it's prohibited (that means we leave -a OR b but +a OR b-->a OR b)
       // notice if the input is a OR b, first term is parsed as required; without
       // this modification a OR b would parsed as +a OR b
-      BooleanClause c = (BooleanClause) clauses.elementAt(clauses.size()-1);
+      BooleanClause c = (BooleanClause) clauses.get(clauses.size()-1);
       if (!c.isProhibited())
         c.setOccur(BooleanClause.Occur.SHOULD);
     }
@@ -453,11 +459,11 @@
       required   = (!prohibited && conj != CONJ_OR);
     }
     if (required && !prohibited)
-      clauses.addElement(newBooleanClause(q, BooleanClause.Occur.MUST));
+      clauses.add(newBooleanClause(q, BooleanClause.Occur.MUST));
     else if (!required && !prohibited)
-      clauses.addElement(newBooleanClause(q, BooleanClause.Occur.SHOULD));
+      clauses.add(newBooleanClause(q, BooleanClause.Occur.SHOULD));
     else if (!required && prohibited)
-      clauses.addElement(newBooleanClause(q, BooleanClause.Occur.MUST_NOT));
+      clauses.add(newBooleanClause(q, BooleanClause.Occur.MUST_NOT));
     else
       throw new RuntimeException("Clause cannot be both required and prohibited");
   }
@@ -471,7 +477,7 @@
     // PhraseQuery, or nothing based on the term count
 
     TokenStream source = analyzer.tokenStream(field, new StringReader(queryText));
-    Vector v = new Vector();
+    List list = new ArrayList();
     final org.apache.lucene.analysis.Token reusableToken = new org.apache.lucene.analysis.Token();
     org.apache.lucene.analysis.Token nextToken;
     int positionCount = 0;
@@ -486,7 +492,7 @@
       }
       if (nextToken == null)
         break;
-      v.addElement(nextToken.clone());
+      list.add(nextToken.clone());
       if (nextToken.getPositionIncrement() != 0)
         positionCount += nextToken.getPositionIncrement();
       else
@@ -499,18 +505,18 @@
       // ignore
     }
 
-    if (v.size() == 0)
+    if (list.size() == 0)
       return null;
-    else if (v.size() == 1) {
-      nextToken = (org.apache.lucene.analysis.Token) v.elementAt(0);
+    else if (list.size() == 1) {
+      nextToken = (org.apache.lucene.analysis.Token) list.get(0);
       return newTermQuery(new Term(field, nextToken.term()));
     } else {
       if (severalTokensAtSamePosition) {
         if (positionCount == 1) {
           // no phrase query:
           BooleanQuery q = newBooleanQuery(true);
-          for (int i = 0; i < v.size(); i++) {
-            nextToken = (org.apache.lucene.analysis.Token) v.elementAt(i);
+          for (int i = 0; i < list.size(); i++) {
+            nextToken = (org.apache.lucene.analysis.Token) list.get(i);
             Query currentQuery = newTermQuery(
                 new Term(field, nextToken.term()));
             q.add(currentQuery, BooleanClause.Occur.SHOULD);
@@ -523,8 +529,8 @@
           mpq.setSlop(phraseSlop);
           List multiTerms = new ArrayList();
           int position = -1;
-          for (int i = 0; i < v.size(); i++) {
-            nextToken = (org.apache.lucene.analysis.Token) v.elementAt(i);
+          for (int i = 0; i < list.size(); i++) {
+            nextToken = (org.apache.lucene.analysis.Token) list.get(i);
             if (nextToken.getPositionIncrement() > 0 && multiTerms.size() > 0) {
               if (enablePositionIncrements) {
                 mpq.add((Term[])multiTerms.toArray(new Term[0]),position);
@@ -548,8 +554,8 @@
         PhraseQuery pq = newPhraseQuery();
         pq.setSlop(phraseSlop);
         int position = -1;
-        for (int i = 0; i < v.size(); i++) {
-          nextToken = (org.apache.lucene.analysis.Token) v.elementAt(i);
+        for (int i = 0; i < list.size(); i++) {
+          nextToken = (org.apache.lucene.analysis.Token) list.get(i);
           if (enablePositionIncrements) {
             position += nextToken.getPositionIncrement();
             pq.add(new Term(field, nextToken.term()),position);
@@ -740,13 +746,31 @@
    * Can be overridden by extending classes, to modify query being
    * returned.
    *
-   * @param clauses Vector that contains {@link BooleanClause} instances
+   * @param clauses List that contains {@link BooleanClause} instances
    *    to join.
    *
    * @return Resulting {@link Query} object.
    * @exception ParseException throw in overridden method to disallow
+   * @deprecated use {@link #getBooleanQuery(List)} instead
    */
   protected Query getBooleanQuery(Vector clauses) throws ParseException {
+    return getBooleanQuery((List) clauses, false);
+  }
+
+  /**
+   * Factory method for generating query, given a set of clauses.
+   * By default creates a boolean query composed of clauses passed in.
+   *
+   * Can be overridden by extending classes, to modify query being
+   * returned.
+   *
+   * @param clauses List that contains {@link BooleanClause} instances
+   *    to join.
+   *
+   * @return Resulting {@link Query} object.
+   * @exception ParseException throw in overridden method to disallow
+   */
+  protected Query getBooleanQuery(List clauses) throws ParseException {
     return getBooleanQuery(clauses, false);
   }
 
@@ -757,22 +781,43 @@
    * Can be overridden by extending classes, to modify query being
    * returned.
    *
-   * @param clauses Vector that contains {@link BooleanClause} instances
+   * @param clauses List that contains {@link BooleanClause} instances
    *    to join.
    * @param disableCoord true if coord scoring should be disabled.
    *
    * @return Resulting {@link Query} object.
    * @exception ParseException throw in overridden method to disallow
+   * @deprecated use {@link #getBooleanQuery(List, boolean)} instead
    */
   protected Query getBooleanQuery(Vector clauses, boolean disableCoord)
     throws ParseException
   {
+    return getBooleanQuery((List) clauses, disableCoord);
+  }
+
+  /**
+   * Factory method for generating query, given a set of clauses.
+   * By default creates a boolean query composed of clauses passed in.
+   *
+   * Can be overridden by extending classes, to modify query being
+   * returned.
+   *
+   * @param clauses List that contains {@link BooleanClause} instances
+   *    to join.
+   * @param disableCoord true if coord scoring should be disabled.
+   *
+   * @return Resulting {@link Query} object.
+   * @exception ParseException throw in overridden method to disallow
+   */
+  protected Query getBooleanQuery(List clauses, boolean disableCoord)
+    throws ParseException
+  {
     if (clauses.size()==0) {
       return null; // all clause words were filtered away by the analyzer.
     }
     BooleanQuery query = newBooleanQuery(disableCoord);
     for (int i = 0; i < clauses.size(); i++) {
-      query.add((BooleanClause)clauses.elementAt(i));
+      query.add((BooleanClause)clauses.get(i));
     }
     return query;
   }
@@ -846,7 +891,6 @@
     return newPrefixQuery(t);
   }
 
-
    /**
    * Factory method for generating a query (similar to
    * {@link #getWildcardQuery}). Called when parser parses
@@ -872,7 +916,7 @@
    * removed, or kept only once if there was a double escape.
    * 
    * Supports escaped unicode characters, e. g. translates
-   * <code>A</code> to <code>A</code>.
+   * <code>\\u0041</code> to <code>A</code>.
    * 
    */
   private String discardEscapeChar(String input) throws ParseException {
@@ -1056,7 +1100,7 @@
   }
 
   final public Query Query(String field) throws ParseException {
-  Vector clauses = new Vector();
+  List clauses = new ArrayList();
   Query q, firstQuery=null;
   int conj, mods;
     mods = Modifiers();



Mime
View raw message