lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r917019 [7/8] - in /lucene/java/trunk: ./ contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/bg/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/br/ con...
Date Sat, 27 Feb 2010 19:14:09 GMT
Modified: lucene/java/trunk/src/java/org/apache/lucene/search/function/ValueSourceQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/function/ValueSourceQuery.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/function/ValueSourceQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/function/ValueSourceQuery.java Sat Feb 27 19:14:01 2010
@@ -125,7 +125,6 @@
    * be used. (assuming field is indexed for this doc, with a single token.)   
    */
   private class ValueSourceScorer extends Scorer {
-    private final ValueSourceWeight weight;
     private final float qWeight;
     private final DocValues vals;
     private final TermDocs termDocs;
@@ -134,8 +133,7 @@
     // constructor
     private ValueSourceScorer(Similarity similarity, IndexReader reader, ValueSourceWeight w) throws IOException {
       super(similarity);
-      this.weight = w;
-      this.qWeight = w.getValue();
+      qWeight = w.getValue();
       // this is when/where the values are first created.
       vals = valSrc.getValues(reader);
       termDocs = reader.termDocs(null);

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/IndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/IndexOutput.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/IndexOutput.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/IndexOutput.java Sat Feb 27 19:14:01 2010
@@ -119,7 +119,7 @@
        throws IOException {
     final int end = start + length;
     for (int i = start; i < end; i++) {
-      final int code = (int)s.charAt(i);
+      final int code = s.charAt(i);
       if (code >= 0x01 && code <= 0x7F)
 	writeByte((byte)code);
       else if (((code >= 0x80) && (code <= 0x7FF)) || code == 0) {
@@ -145,7 +145,7 @@
     throws IOException {
     final int end = start + length;
     for (int i = start; i < end; i++) {
-      final int code = (int)s[i];
+      final int code = s[i];
       if (code >= 0x01 && code <= 0x7F)
 	writeByte((byte)code);
       else if (((code >= 0x80) && (code <= 0x7FF)) || code == 0) {
@@ -210,7 +210,7 @@
    * undefined.  Otherwise the file is truncated.
    * @param length file length
    */
-  public void setLength(long length) throws IOException {};
+  public void setLength(long length) throws IOException {}
 
   public void writeStringStringMap(Map<String,String> map) throws IOException {
     if (map == null) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/LockObtainFailedException.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/LockObtainFailedException.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/LockObtainFailedException.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/LockObtainFailedException.java Sat Feb 27 19:14:01 2010
@@ -24,7 +24,7 @@
  * could not be acquired.  This
  * happens when a writer tries to open an index
  * that another writer already has open.
- * @see Lock#obtain(long).
+ * @see Lock#obtain(long)
  */
 public class LockObtainFailedException extends IOException {
   public LockObtainFailedException(String message) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/LockReleaseFailedException.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/LockReleaseFailedException.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/LockReleaseFailedException.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/LockReleaseFailedException.java Sat Feb 27 19:14:01 2010
@@ -22,7 +22,7 @@
 /**
  * This exception is thrown when the <code>write.lock</code>
  * could not be released.
- * @see Lock#release().
+ * @see Lock#release()
  */
 public class LockReleaseFailedException extends IOException {
   public LockReleaseFailedException(String message) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/MMapDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/MMapDirectory.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/MMapDirectory.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/MMapDirectory.java Sat Feb 27 19:14:01 2010
@@ -375,7 +375,7 @@
         RuntimeException newException = new RuntimeException(ioe);
         newException.initCause(ioe);
         throw newException;
-      };
+      }
       return clone;
     }
   
@@ -404,7 +404,7 @@
     File f =  new File(getDirectory(), name);
     RandomAccessFile raf = new RandomAccessFile(f, "r");
     try {
-      return (raf.length() <= (long) maxBBuf)
+      return (raf.length() <= maxBBuf)
              ? (IndexInput) new MMapIndexInput(raf)
              : (IndexInput) new MultiMMapIndexInput(raf, maxBBuf);
     } finally {

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/NoLockFactory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/NoLockFactory.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/NoLockFactory.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/NoLockFactory.java Sat Feb 27 19:14:01 2010
@@ -52,8 +52,8 @@
   }
 
   @Override
-  public void clearLock(String lockName) {};
-};
+  public void clearLock(String lockName) {}
+}
 
 class NoLock extends Lock {
   @Override

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/SimpleFSLockFactory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/SimpleFSLockFactory.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/SimpleFSLockFactory.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/SimpleFSLockFactory.java Sat Feb 27 19:14:01 2010
@@ -100,7 +100,7 @@
       }
     }
   }
-};
+}
 
 class SimpleFSLock extends Lock {
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/SingleInstanceLockFactory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/SingleInstanceLockFactory.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/SingleInstanceLockFactory.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/SingleInstanceLockFactory.java Sat Feb 27 19:14:01 2010
@@ -51,7 +51,7 @@
       }
     }
   }
-};
+}
 
 class SingleInstanceLock extends Lock {
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/AverageGuessMemoryModel.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/AverageGuessMemoryModel.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/AverageGuessMemoryModel.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/AverageGuessMemoryModel.java Sat Feb 27 19:14:01 2010
@@ -26,7 +26,7 @@
  */
 public class AverageGuessMemoryModel extends MemoryModel {
   // best guess primitive sizes
-  private final Map<Class,Integer> sizes = new IdentityHashMap<Class,Integer>() {
+  private final Map<Class<?>,Integer> sizes = new IdentityHashMap<Class<?>,Integer>() {
     {
       put(boolean.class, Integer.valueOf(1));
       put(byte.class, Integer.valueOf(1));
@@ -63,7 +63,7 @@
    * @see org.apache.lucene.util.MemoryModel#getPrimitiveSize(java.lang.Class)
    */
   @Override
-  public int getPrimitiveSize(Class clazz) {
+  public int getPrimitiveSize(Class<?> clazz) {
     return sizes.get(clazz).intValue();
   }
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/IndexableBinaryStringTools.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/IndexableBinaryStringTools.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/IndexableBinaryStringTools.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/IndexableBinaryStringTools.java Sat Feb 27 19:14:01 2010
@@ -104,7 +104,7 @@
   public static int getEncodedLength(byte[] inputArray, int inputOffset,
       int inputLength) {
     // Use long for intermediaries to protect against overflow
-    return (int)(((long)inputLength * 8L + 14L) / 15L) + 1;
+    return (int)((8L * inputLength + 14L) / 15L) + 1;
   }
 
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/MemoryModel.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/MemoryModel.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/MemoryModel.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/MemoryModel.java Sat Feb 27 19:14:01 2010
@@ -38,7 +38,7 @@
    *        short, double, int
    * @return the size in bytes of given primitive Class
    */
-  public abstract int getPrimitiveSize(Class clazz);
+  public abstract int getPrimitiveSize(Class<?> clazz);
 
   /**
    * @return size of reference

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/NumericUtils.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/NumericUtils.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/NumericUtils.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/NumericUtils.java Sat Feb 27 19:14:01 2010
@@ -210,10 +210,10 @@
       if (ch>0x7f) {
         throw new NumberFormatException(
           "Invalid prefixCoded numerical value representation (char "+
-          Integer.toHexString((int)ch)+" at position "+i+" is invalid)"
+          Integer.toHexString(ch)+" at position "+i+" is invalid)"
         );
       }
-      sortableBits |= (long)ch;
+      sortableBits |= ch;
     }
     return (sortableBits << shift) ^ 0x8000000000000000L;
   }
@@ -237,10 +237,10 @@
       if (ch>0x7f) {
         throw new NumberFormatException(
           "Invalid prefixCoded numerical value representation (char "+
-          Integer.toHexString((int)ch)+" at position "+i+" is invalid)"
+          Integer.toHexString(ch)+" at position "+i+" is invalid)"
         );
       }
-      sortableBits |= (int)ch;
+      sortableBits |= ch;
     }
     return (sortableBits << shift) ^ 0x80000000;
   }
@@ -346,7 +346,7 @@
   public static void splitIntRange(final IntRangeBuilder builder,
     final int precisionStep,  final int minBound, final int maxBound
   ) {
-    splitRange(builder, 32, precisionStep, (long)minBound, (long)maxBound);
+    splitRange(builder, 32, precisionStep, minBound, maxBound);
   }
   
   /** This helper does the splitting for both 32 and 64 bit. */

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/OpenBitSet.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/OpenBitSet.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/OpenBitSet.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/OpenBitSet.java Sat Feb 27 19:14:01 2010
@@ -642,7 +642,7 @@
   public Object clone() {
     try {
       OpenBitSet obs = (OpenBitSet)super.clone();
-      obs.bits = (long[]) obs.bits.clone();  // hopefully an array clone is as fast(er) than arraycopy
+      obs.bits = obs.bits.clone();  // hopefully an array clone is as fast(er) than arraycopy
       return obs;
     } catch (CloneNotSupportedException e) {
       throw new RuntimeException(e);

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/Parameter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/Parameter.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/Parameter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/Parameter.java Sat Feb 27 19:14:01 2010
@@ -30,16 +30,11 @@
  */
 @Deprecated
 @SuppressWarnings("serial")
-public abstract class Parameter implements Serializable
-{
+public abstract class Parameter implements Serializable {
   static Map<String,Parameter> allParameters = new HashMap<String,Parameter>();
   
   private String name;
   
-  private Parameter() {
-    // typesafe enum pattern, no public constructor
-  }
-  
   protected Parameter(String name) {
     // typesafe enum pattern, no public constructor
     this.name = name;

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/RamUsageEstimator.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/RamUsageEstimator.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/RamUsageEstimator.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/RamUsageEstimator.java Sat Feb 27 19:14:01 2010
@@ -124,7 +124,7 @@
     // add to seen
     seen.put(obj, null);
 
-    Class clazz = obj.getClass();
+    Class<?> clazz = obj.getClass();
     if (clazz.isArray()) {
       return sizeOfArray(obj);
     }
@@ -167,7 +167,7 @@
       return 0;
     }
     long size = arraySize;
-    Class arrayElementClazz = obj.getClass().getComponentType();
+    Class<?> arrayElementClazz = obj.getClass().getComponentType();
     if (arrayElementClazz.isPrimitive()) {
       size += len * memoryModel.getPrimitiveSize(arrayElementClazz);
     } else {

Modified: lucene/java/trunk/src/test/org/apache/lucene/TestMergeSchedulerExternal.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/TestMergeSchedulerExternal.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/TestMergeSchedulerExternal.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/TestMergeSchedulerExternal.java Sat Feb 27 19:14:01 2010
@@ -20,7 +20,6 @@
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 import org.apache.lucene.store.MockRAMDirectory;
-import org.apache.lucene.store.Directory;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.MergePolicy;
 import org.apache.lucene.index.ConcurrentMergeScheduler;
@@ -38,14 +37,6 @@
   volatile boolean mergeThreadCreated;
   volatile boolean excCalled;
 
-  private class MyMergeException extends RuntimeException {
-    Directory dir;
-    public MyMergeException(Throwable exc, Directory dir) {
-      super(exc);
-      this.dir = dir;
-    }
-  }
-
   private class MyMergeScheduler extends ConcurrentMergeScheduler {
 
     private class MyMergeThread extends ConcurrentMergeScheduler.MergeThread {
@@ -99,7 +90,7 @@
     MyMergeScheduler ms = new MyMergeScheduler();
     writer.setMergeScheduler(ms);
     writer.setMaxBufferedDocs(2);
-    writer.setRAMBufferSizeMB(writer.DISABLE_AUTO_FLUSH);
+    writer.setRAMBufferSizeMB(IndexWriter.DISABLE_AUTO_FLUSH);
     for(int i=0;i<20;i++)
       writer.addDocument(doc);
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestASCIIFoldingFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestASCIIFoldingFilter.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestASCIIFoldingFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestASCIIFoldingFilter.java Sat Feb 27 19:14:01 2010
@@ -1892,7 +1892,7 @@
     ASCIIFoldingFilter filter = new ASCIIFoldingFilter(stream);
     TermAttribute termAtt = filter.getAttribute(TermAttribute.class);
     Iterator<String> expectedIter = expectedOutputTokens.iterator();
-    while (expectedIter.hasNext()) {;
+    while (expectedIter.hasNext()) {
       assertTermEquals(expectedIter.next(), filter, termAtt);
     }
     assertFalse(filter.incrementToken());

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=917019&r1=917018&r2=917019&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 Sat Feb 27 19:14:01 2010
@@ -107,6 +107,7 @@
 
   // LUCENE-1150: Just a compile time test, to ensure the
   // StandardAnalyzer constants remain publicly accessible
+  @SuppressWarnings("unused")
   public void _testStandardConstants() {
     int x = StandardTokenizer.ALPHANUM;
     x = StandardTokenizer.APOSTROPHE;

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharArrayMap.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharArrayMap.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharArrayMap.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharArrayMap.java Sat Feb 27 19:14:01 2010
@@ -76,7 +76,8 @@
     int n=0;
     for (Object o : cs) {
       assertTrue(cm.containsKey(o));
-      assertTrue(cm.containsKey((char[]) o));
+      char[] co = (char[]) o;
+      assertTrue(cm.containsKey(co, 0, co.length));
       n++;
     }
     assertEquals(hm.size(), n);

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharArraySet.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharArraySet.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharArraySet.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharArraySet.java Sat Feb 27 19:14:01 2010
@@ -327,6 +327,7 @@
     }
   }
   
+  @SuppressWarnings("deprecated")
   public void testCopyCharArraySetBWCompat() {
     CharArraySet setIngoreCase = new CharArraySet(TEST_VERSION_CURRENT, 10, true);
     CharArraySet setCaseSensitive = new CharArraySet(TEST_VERSION_CURRENT, 10, false);
@@ -341,6 +342,7 @@
     setCaseSensitive.addAll(Arrays.asList(TEST_STOP_WORDS));
     setCaseSensitive.add(Integer.valueOf(1));
 
+    // This should use the deprecated methods, because it checks a bw compatibility.
     CharArraySet copy = CharArraySet.copy(setIngoreCase);
     CharArraySet copyCaseSens = CharArraySet.copy(setCaseSensitive);
 
@@ -474,8 +476,9 @@
     for (String stopword : TEST_STOP_WORDS) {
       assertFalse(CharArraySet.EMPTY_SET.contains(stopword));
     }
+    assertFalse(CharArraySet.EMPTY_SET.contains("foo"));
     assertFalse(CharArraySet.EMPTY_SET.contains((Object) "foo"));
-    assertFalse(CharArraySet.EMPTY_SET.contains((Object) "foo".toCharArray()));
+    assertFalse(CharArraySet.EMPTY_SET.contains("foo".toCharArray()));
     assertFalse(CharArraySet.EMPTY_SET.contains("foo".toCharArray(),0,3));
   }
   

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharTokenizers.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharTokenizers.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharTokenizers.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharTokenizers.java Sat Feb 27 19:14:01 2010
@@ -172,7 +172,7 @@
       return Character.isLetter(c);
     }
 
-    @Override
+    @Deprecated @Override
     protected boolean isTokenChar(char c) {
       return Character.isLetter(c);
     }
@@ -183,7 +183,7 @@
       super(matchVersion, input);
     }
 
-    @Override
+    @Deprecated @Override
     protected char normalize(char c) {
       return c;
     }
@@ -200,7 +200,7 @@
       super(matchVersion, input);
     }
 
-    @Override
+    @Deprecated @Override
     protected char normalize(char c) {
       return c;
     }
@@ -215,7 +215,7 @@
       return Character.isLetter(c);
     }
 
-    @Override
+    @Deprecated @Override
     protected boolean isTokenChar(char c) {
       return Character.isLetter(c);
     }

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java Sat Feb 27 19:14:01 2010
@@ -38,7 +38,7 @@
   private IndexSearcher searcher;
 
   @Override
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
     super.setUp();
     directory = new RAMDirectory();
     IndexWriter writer = new IndexWriter(directory,

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestMappingCharFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestMappingCharFilter.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestMappingCharFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestMappingCharFilter.java Sat Feb 27 19:14:01 2010
@@ -24,7 +24,7 @@
   NormalizeCharMap normMap;
 
   @Override
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
     super.setUp();
     normMap = new NormalizeCharMap();
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestToken.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestToken.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestToken.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestToken.java Sat Feb 27 19:14:01 2010
@@ -35,7 +35,6 @@
     Token t = new Token();
     char[] content = "hello".toCharArray();
     t.setTermBuffer(content, 0, content.length);
-    char[] buf = t.termBuffer();
     assertNotSame(t.termBuffer(), content);
     assertEquals("hello", t.term());
     assertEquals("word", t.type());

Modified: lucene/java/trunk/src/test/org/apache/lucene/collation/CollationTestBase.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/collation/CollationTestBase.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/collation/CollationTestBase.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/collation/CollationTestBase.java Sat Feb 27 19:14:01 2010
@@ -40,9 +40,6 @@
 import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
-import java.nio.CharBuffer;
-import java.nio.ByteBuffer;
-
 
 public class CollationTestBase extends LuceneTestCase {
 
@@ -60,13 +57,11 @@
    * @return The encoded collation key for the original String
    */
   protected String encodeCollationKey(byte[] keyBits) {
-    ByteBuffer begBuf = ByteBuffer.wrap(keyBits);
     // Ensure that the backing char[] array is large enough to hold the encoded
     // Binary String
-    char[] encodedBegArray 
-      = new char[IndexableBinaryStringTools.getEncodedLength(begBuf)];
-    CharBuffer encodedBegBuf = CharBuffer.wrap(encodedBegArray); 
-    IndexableBinaryStringTools.encode(begBuf, encodedBegBuf);
+    int encodedLength = IndexableBinaryStringTools.getEncodedLength(keyBits, 0, keyBits.length);
+    char[] encodedBegArray = new char[encodedLength];
+    IndexableBinaryStringTools.encode(keyBits, 0, keyBits.length, encodedBegArray, 0, encodedLength);
     return new String(encodedBegArray);
   }
     

Modified: lucene/java/trunk/src/test/org/apache/lucene/collation/TestCollationKeyFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/collation/TestCollationKeyFilter.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/collation/TestCollationKeyFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/collation/TestCollationKeyFilter.java Sat Feb 27 19:14:01 2010
@@ -46,16 +46,16 @@
 
   
   public class TestAnalyzer extends Analyzer {
-    private Collator collator;
+    private Collator _collator;
 
     TestAnalyzer(Collator collator) {
-      this.collator = collator;
+      _collator = collator;
     }
 
     @Override
     public TokenStream tokenStream(String fieldName, Reader reader) {
       TokenStream result = new KeywordTokenizer(reader);
-      result = new CollationKeyFilter(result, collator);
+      result = new CollationKeyFilter(result, _collator);
       return result;
     }
   }

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=917019&r1=917018&r2=917019&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 Sat Feb 27 19:14:01 2010
@@ -36,7 +36,7 @@
   public void testBinaryFieldInIndex()
     throws Exception
   {
-    Fieldable binaryFldStored = new Field("binaryStored", binaryValStored.getBytes(), Field.Store.YES);
+    Fieldable binaryFldStored = new Field("binaryStored", binaryValStored.getBytes());
     Fieldable stringFldStored = new Field("stringStored", binaryValStored, Field.Store.YES, Field.Index.NO, Field.TermVector.NO);
 
     try {
@@ -45,7 +45,6 @@
       fail();
     }
     catch (IllegalArgumentException iae) {
-      ;
     }
     
     Document doc = new Document();
@@ -87,8 +86,8 @@
   public void testCompressionTools()
     throws Exception
   {
-    Fieldable binaryFldCompressed = new Field("binaryCompressed", CompressionTools.compress(binaryValCompressed.getBytes()), Field.Store.YES);
-    Fieldable stringFldCompressed = new Field("stringCompressed", CompressionTools.compressString(binaryValCompressed), Field.Store.YES);
+    Fieldable binaryFldCompressed = new Field("binaryCompressed", CompressionTools.compress(binaryValCompressed.getBytes()));
+    Fieldable stringFldCompressed = new Field("stringCompressed", CompressionTools.compressString(binaryValCompressed));
     
     Document doc = new Document();
     

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=917019&r1=917018&r2=917019&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 Sat Feb 27 19:14:01 2010
@@ -42,8 +42,8 @@
   {
     Document doc = new Document();
     Fieldable stringFld = new Field("string", binaryVal, Field.Store.YES, Field.Index.NO);
-    Fieldable binaryFld = new Field("binary", binaryVal.getBytes(), Field.Store.YES);
-    Fieldable binaryFld2 = new Field("binary", binaryVal2.getBytes(), Field.Store.YES);
+    Fieldable binaryFld = new Field("binary", binaryVal.getBytes());
+    Fieldable binaryFld2 = new Field("binary", binaryVal2.getBytes());
     
     doc.add(stringFld);
     doc.add(binaryFld);
@@ -259,8 +259,7 @@
     }
 
   public void testFieldSetValueChangeBinary() {
-    Field field1 = new Field("field1", new byte[0],
-                             Field.Store.YES);
+    Field field1 = new Field("field1", new byte[0]);
     Field field2 = new Field("field2", "",
                              Field.Store.YES, Field.Index.ANALYZED);
     try {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/DocHelper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/DocHelper.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/DocHelper.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/DocHelper.java Sat Feb 27 19:14:01 2010
@@ -154,7 +154,7 @@
       LAZY_FIELD_BINARY_BYTES = "These are some binary field bytes".getBytes("UTF8");
     } catch (UnsupportedEncodingException e) {
     }
-    lazyFieldBinary = new Field(LAZY_FIELD_BINARY_KEY, LAZY_FIELD_BINARY_BYTES, Field.Store.YES);
+    lazyFieldBinary = new Field(LAZY_FIELD_BINARY_KEY, LAZY_FIELD_BINARY_BYTES);
     fields[fields.length - 2] = lazyFieldBinary;
     LARGE_LAZY_FIELD_TEXT = buffer.toString();
     largeLazyField = new Field(LARGE_LAZY_FIELD_KEY, LARGE_LAZY_FIELD_TEXT, Field.Store.YES, Field.Index.ANALYZED);

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestAtomicUpdate.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestAtomicUpdate.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestAtomicUpdate.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestAtomicUpdate.java Sat Feb 27 19:14:01 2010
@@ -85,8 +85,6 @@
 
   private static class IndexerThread extends TimedThread {
     IndexWriter writer;
-    public int count;
-
     public IndexerThread(IndexWriter writer, TimedThread[] threads) {
       super(threads);
       this.writer = writer;

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java Sat Feb 27 19:14:01 2010
@@ -78,11 +78,9 @@
      first */
   public void unzip(String zipName, String destDirName) throws IOException {
 
-    Enumeration entries;
-    ZipFile zipFile;
-    zipFile = new ZipFile(zipName + ".zip");
+    ZipFile zipFile = new ZipFile(zipName + ".zip");
 
-    entries = zipFile.entries();
+    Enumeration<? extends ZipEntry> entries = zipFile.entries();
 
     String dirName = fullDir(destDirName);
 
@@ -92,7 +90,7 @@
     fileDir.mkdir();
 
     while (entries.hasMoreElements()) {
-      ZipEntry entry = (ZipEntry) entries.nextElement();
+      ZipEntry entry = entries.nextElement();
 
       InputStream in = zipFile.getInputStream(entry);
       OutputStream out = new BufferedOutputStream(new FileOutputStream(new File(fileDir, entry.getName())));

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestCompoundFile.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestCompoundFile.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestCompoundFile.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestCompoundFile.java Sat Feb 27 19:14:01 2010
@@ -55,7 +55,7 @@
 
 
     @Override
-    public void setUp() throws Exception {
+    protected void setUp() throws Exception {
        super.setUp();
        File file = new File(System.getProperty("tempDir"), "testIndex");
        _TestUtil.rmDir(file);
@@ -64,7 +64,7 @@
     }
 
     @Override
-    public void tearDown() throws Exception {
+    protected void tearDown() throws Exception {
        dir.close();
        super.tearDown();
     }
@@ -329,14 +329,14 @@
         IndexInput in = fsdir.openInput(file);
 
         // This read primes the buffer in IndexInput
-        byte b = in.readByte();
+        in.readByte();
 
         // Close the file
         in.close();
 
         // ERROR: this call should fail, but succeeds because the buffer
         // is still filled
-        b = in.readByte();
+        in.readByte();
 
         // ERROR: this call should fail, but succeeds for some reason as well
         in.seek(1099);
@@ -344,7 +344,7 @@
         try {
             // OK: this call correctly fails. We are now past the 1024 internal
             // buffer, so an actual IO is attempted, which fails
-            b = in.readByte();
+            in.readByte();
             fail("expected readByte() to throw exception");
         } catch (IOException e) {
           // expected exception
@@ -587,7 +587,7 @@
 
         // Open two files
         try {
-            IndexInput e1 = cr.openInput("bogus");
+            cr.openInput("bogus");
             fail("File not found");
 
         } catch (IOException e) {
@@ -608,7 +608,7 @@
         is.readBytes(b, 0, 10);
 
         try {
-            byte test = is.readByte();
+            is.readByte();
             fail("Single byte read past end of file");
         } catch (IOException e) {
             /* success */

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=917019&r1=917018&r2=917019&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 Sat Feb 27 19:14:01 2010
@@ -122,13 +122,6 @@
     assertEquals( 1, reader.numDocs() );
   }
         
-  
-  public void _testTermVectors() {
-    MultiReader reader = new MultiReader(readers);
-    assertTrue(reader != null);
-  }
-  
-
   public void testIsCurrent() throws IOException {
     RAMDirectory ramDir1=new RAMDirectory();
     addDoc(ramDir1, "test foo", true);

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java Sat Feb 27 19:14:01 2010
@@ -55,7 +55,7 @@
      *  a few text files created in the current working directory.
      */
     @Override
-    public void setUp() throws Exception {
+    protected void setUp() throws Exception {
         super.setUp();
         workDir = new File(System.getProperty("tempDir"),"TestDoc");
         workDir.mkdirs();

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java Sat Feb 27 19:14:01 2010
@@ -60,7 +60,6 @@
     assertTrue(dir != null);
     assertTrue(fieldInfos != null);
     FieldsReader reader = new FieldsReader(dir, TEST_SEGMENT_NAME, fieldInfos);
-    assertTrue(reader != null);
     assertTrue(reader.size() == 1);
     Document doc = reader.doc(0, null);
     assertTrue(doc != null);
@@ -98,7 +97,6 @@
     assertTrue(dir != null);
     assertTrue(fieldInfos != null);
     FieldsReader reader = new FieldsReader(dir, TEST_SEGMENT_NAME, fieldInfos);
-    assertTrue(reader != null);
     assertTrue(reader.size() == 1);
     Set<String> loadFieldNames = new HashSet<String>();
     loadFieldNames.add(DocHelper.TEXT_FIELD_1_KEY);
@@ -148,7 +146,6 @@
     assertTrue(dir != null);
     assertTrue(fieldInfos != null);
     FieldsReader reader = new FieldsReader(dir, TEST_SEGMENT_NAME, fieldInfos);
-    assertTrue(reader != null);
     assertTrue(reader.size() == 1);
     Set<String> loadFieldNames = new HashSet<String>();
     loadFieldNames.add(DocHelper.TEXT_FIELD_1_KEY);
@@ -177,7 +174,6 @@
     assertTrue(dir != null);
     assertTrue(fieldInfos != null);
     FieldsReader reader = new FieldsReader(dir, TEST_SEGMENT_NAME, fieldInfos);
-    assertTrue(reader != null);
     assertTrue(reader.size() == 1);
     LoadFirstFieldSelector fieldSelector = new LoadFirstFieldSelector();
     Document doc = reader.doc(0, fieldSelector);
@@ -227,13 +223,13 @@
 
     for (int i = 0; i < length; i++) {
       reader = new FieldsReader(tmpDir, TEST_SEGMENT_NAME, fieldInfos);
-      assertTrue(reader != null);
       assertTrue(reader.size() == 1);
 
       Document doc;
       doc = reader.doc(0, null);//Load all of them
       assertTrue("doc is null and it shouldn't be", doc != null);
       Fieldable field = doc.getFieldable(DocHelper.LARGE_LAZY_FIELD_KEY);
+      assertTrue("field is null and it shouldn't be", field != null);
       assertTrue("field is lazy", field.isLazy() == false);
       String value;
       long start;
@@ -243,7 +239,6 @@
       value = field.stringValue();
       finish = System.currentTimeMillis();
       assertTrue("value is null and it shouldn't be", value != null);
-      assertTrue("field is null and it shouldn't be", field != null);
       regularTime += (finish - start);
       reader.close();
       reader = null;

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=917019&r1=917018&r2=917019&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 Sat Feb 27 19:14:01 2010
@@ -366,7 +366,7 @@
         writer.close();
         writer = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
         Document doc = new Document();
-        doc.add(new Field("bin1", bin, Field.Store.YES));
+        doc.add(new Field("bin1", bin));
         doc.add(new Field("junk", "junk text", Field.Store.NO, Field.Index.ANALYZED));
         writer.addDocument(doc);
         writer.close();
@@ -511,11 +511,8 @@
 
     // Make sure you can set norms & commit even if a reader
     // is open against the index:
-    public void testWritingNorms() throws IOException
-    {
+    public void testWritingNorms() throws IOException {
         String tempDir = "target/test";
-        if (tempDir == null)
-            throw new IOException("tempDir undefined, cannot run test");
 
         File indexDir = new File(tempDir, "lucenetestnormwriter");
         Directory dir = FSDirectory.open(indexDir);

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=917019&r1=917018&r2=917019&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 Sat Feb 27 19:14:01 2010
@@ -247,11 +247,6 @@
     iw.close();
   }
 
-  private void modifyNormsForF1(Directory dir) throws IOException {
-    IndexReader ir = IndexReader.open(dir, false);
-    modifyNormsForF1(ir);
-  }
-
   private void modifyNormsForF1(IndexReader ir) throws IOException {
     int n = ir.maxDoc();
     // System.out.println("modifyNormsForF1 maxDoc: "+n);

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=917019&r1=917018&r2=917019&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 Sat Feb 27 19:14:01 2010
@@ -3493,14 +3493,14 @@
       final TermAttribute termAtt = addAttribute(TermAttribute.class);
       final PositionIncrementAttribute posIncrAtt = addAttribute(PositionIncrementAttribute.class);
       
-      final Iterator<String> tokens = Arrays.asList(new String[]{"a","b","c"}).iterator();
+      final Iterator<String> terms = Arrays.asList("a","b","c").iterator();
       boolean first = true;
       
       @Override
       public boolean incrementToken() {
-        if (!tokens.hasNext()) return false;
+        if (!terms.hasNext()) return false;
         clearAttributes();
-        termAtt.setTermBuffer( tokens.next());
+        termAtt.setTermBuffer( terms.next());
         posIncrAtt.setPositionIncrement(first ? 0 : 1);
         first = false;
         return true;
@@ -3784,7 +3784,7 @@
 
     c.joinThreads();
 
-    assertEquals(100+NUM_COPY*(3*NUM_ITER/4)*c.NUM_THREADS*c.NUM_INIT_DOCS, c.writer2.numDocs());
+    assertEquals(100+NUM_COPY*(3*NUM_ITER/4)*RunAddIndexesThreads.NUM_THREADS*RunAddIndexesThreads.NUM_INIT_DOCS, c.writer2.numDocs());
 
     c.close(true);
 
@@ -3793,7 +3793,7 @@
     _TestUtil.checkIndex(c.dir2);
 
     IndexReader reader = IndexReader.open(c.dir2, true);
-    assertEquals(100+NUM_COPY*(3*NUM_ITER/4)*c.NUM_THREADS*c.NUM_INIT_DOCS, reader.numDocs());
+    assertEquals(100+NUM_COPY*(3*NUM_ITER/4)*RunAddIndexesThreads.NUM_THREADS*RunAddIndexesThreads.NUM_INIT_DOCS, reader.numDocs());
     reader.close();
 
     c.closeDir();
@@ -3969,7 +3969,7 @@
       b[i] = (byte) (i+77);
     
     Document doc = new Document();
-    Field f = new Field("binary", b, 10, 17, Field.Store.YES);
+    Field f = new Field("binary", b, 10, 17);
     byte[] bx = f.getBinaryValue();
     assertTrue(bx != null);
     assertEquals(50, bx.length);
@@ -4516,7 +4516,7 @@
       b[i] = (byte) (i+77);
 
     Document doc = new Document();
-    Field f = new Field("binary", b, 10, 17, Field.Store.YES);
+    Field f = new Field("binary", b, 10, 17);
     f.setTokenStream(new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("doc1field1")));
     Field f2 = new Field("string", "value", Field.Store.YES,Field.Index.ANALYZED);
     f2.setTokenStream(new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("doc1field2")));
@@ -4688,7 +4688,7 @@
 
     for(int iter=0;iter<2;iter++) {
       Directory dir = new MockRAMDirectory();
-      IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
+      IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.UNLIMITED);
       Document doc = new Document();
       doc.add(new Field("field", "go", Field.Store.NO, Field.Index.ANALYZED));
       w.addDocument(doc);

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=917019&r1=917018&r2=917019&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 Sat Feb 27 19:14:01 2010
@@ -34,7 +34,7 @@
     private java.io.File __test_dir;
 
     @Override
-    public void setUp() throws Exception {
+    protected void setUp() throws Exception {
         super.setUp();
         if (this.__test_dir == null) {
             String tmp_dir = System.getProperty("java.io.tmpdir", "tmp");
@@ -52,8 +52,7 @@
     }
 
     @Override
-    public void tearDown() throws Exception {
-        super.tearDown();
+    protected void tearDown() throws Exception {
         if (this.__test_dir != null) {
             File[] files = this.__test_dir.listFiles();
 
@@ -69,16 +68,16 @@
                 throw new IOException("unable to remove test directory \"" + this.__test_dir.getPath() + "\" (please remove by hand)");
             }
         }
+        super.tearDown();
     }
 
     public void testIndexWriterLockRelease() throws IOException {
-        IndexWriter im;
         FSDirectory dir = FSDirectory.open(this.__test_dir);
         try {
-            im = new IndexWriter(dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(TEST_VERSION_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
+            new IndexWriter(dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(TEST_VERSION_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
         } catch (FileNotFoundException e) {
             try {
-                im = new IndexWriter(dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(TEST_VERSION_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
+                new IndexWriter(dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(TEST_VERSION_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED);
             } catch (FileNotFoundException e1) {
             }
         } finally {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterReader.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterReader.java Sat Feb 27 19:14:01 2010
@@ -20,7 +20,6 @@
 import java.io.PrintStream;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Random;
 
@@ -302,70 +301,6 @@
     mainDir.close();
   }
   
-  private class DeleteThreads {
-    final static int NUM_THREADS = 5;
-    final Thread[] threads = new Thread[NUM_THREADS];
-    IndexWriter mainWriter;
-    List<Term> deletedTerms = new ArrayList<Term>();
-    LinkedList<Term> toDeleteTerms = new LinkedList<Term>();
-    Random random;
-    final List<Throwable> failures = new ArrayList<Throwable>();
-    
-    public DeleteThreads(IndexWriter mainWriter) throws IOException {
-      this.mainWriter = mainWriter;
-      IndexReader reader = mainWriter.getReader();
-      int maxDoc = reader.maxDoc();
-      random = newRandom();
-      int iter = random.nextInt(maxDoc);
-      for (int x=0; x < iter; x++) {
-        int doc = random.nextInt(iter);
-        String id = reader.document(doc).get("id");
-        toDeleteTerms.add(new Term("id", id));
-      }
-    }
-    
-    Term getDeleteTerm() {
-      synchronized (toDeleteTerms) {
-        return toDeleteTerms.removeFirst();
-      }
-    }
-    
-    void launchThreads(final int numIter) {
-      for (int i = 0; i < NUM_THREADS; i++) {
-        threads[i] = new Thread() {
-          @Override
-          public void run() {
-            try {
-              Term term = getDeleteTerm();
-              mainWriter.deleteDocuments(term);
-              synchronized (deletedTerms) {
-                deletedTerms.add(term);
-              }
-            } catch (Throwable t) {
-              handle(t);
-            }
-          }
-        };
-      }
-    }
-    
-    void handle(Throwable t) {
-      t.printStackTrace(System.out);
-      synchronized (failures) {
-        failures.add(t);
-      }
-    }
-    
-    void joinThreads() {
-      for (int i = 0; i < NUM_THREADS; i++)
-        try {
-          threads[i].join();
-        } catch (InterruptedException ie) {
-          throw new ThreadInterruptedException(ie);
-        }
-    }
-  }
-  
   private class AddDirectoriesThreads {
     Directory addDir;
     final static int NUM_THREADS = 5;
@@ -558,16 +493,15 @@
     return doc;
   }
 
-  /**
+  /*
    * Delete a document by term and return the doc id
    * 
-   * @return
-   * 
    * public static int deleteDocument(Term term, IndexWriter writer) throws
    * IOException { IndexReader reader = writer.getReader(); TermDocs td =
    * reader.termDocs(term); int doc = -1; //if (td.next()) { // doc = td.doc();
    * //} //writer.deleteDocuments(term); td.close(); return doc; }
    */
+  
   public static void createIndex(Directory dir1, String indexName,
       boolean multiSegment) throws IOException {
     IndexWriter w = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT),

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiReader.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiReader.java Sat Feb 27 19:14:01 2010
@@ -40,7 +40,6 @@
 
     assertTrue(dir != null);
     assertTrue(sis != null);
-    assertTrue(reader != null);
     
     return reader;
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java Sat Feb 27 19:14:01 2010
@@ -17,7 +17,8 @@
  * limitations under the License.
  */
 
-import org.apache.lucene.util.LuceneTestCase;
+import java.io.IOException;
+import java.util.ArrayList;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
@@ -29,10 +30,7 @@
 import org.apache.lucene.search.Similarity;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
+import org.apache.lucene.util.LuceneTestCase;
 
 /**
  * Test that norms info is preserved during index life - including
@@ -158,8 +156,8 @@
     int n = ir.maxDoc();
     for (int i = 0; i < n; i+=3) { // modify for every third doc
       int k = (i*3) % modifiedNorms.size();
-      float origNorm = ((Float)modifiedNorms.get(i)).floatValue();
-      float newNorm = ((Float)modifiedNorms.get(k)).floatValue();
+      float origNorm = modifiedNorms.get(i).floatValue();
+      float newNorm = modifiedNorms.get(k).floatValue();
       //System.out.println("Modifying: for "+i+" from "+origNorm+" to "+newNorm);
       //System.out.println("      and: for "+k+" from "+newNorm+" to "+origNorm);
       modifiedNorms.set(i, Float.valueOf(newNorm));

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java Sat Feb 27 19:14:01 2010
@@ -67,10 +67,9 @@
 
     @Override
     protected void tearDown() throws Exception {
-        super.tearDown();
-
         ir1.close();
         ir2.close();
+        super.tearDown();
     }
 
     public void test1() throws IOException {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java Sat Feb 27 19:14:01 2010
@@ -445,11 +445,8 @@
             boolean hasNext = input.incrementToken();
             if (hasNext) {
                 if (offset + length <= data.length) {
-                    Payload p = null;
-                    if (p == null) {
-                        p = new Payload();
-                        payloadAtt.setPayload(p);
-                    }
+                    Payload p = new Payload();
+                    payloadAtt.setPayload(p);
                     p.setData(data, offset, length);
                     offset += length;                
                 } else {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentReader.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentReader.java Sat Feb 27 19:14:01 2010
@@ -134,8 +134,8 @@
 
     
     TermPositions positions = reader.termPositions();
-    positions.seek(new Term(DocHelper.TEXT_FIELD_1_KEY, "field"));
     assertTrue(positions != null);
+    positions.seek(new Term(DocHelper.TEXT_FIELD_1_KEY, "field"));
     assertTrue(positions.doc() == 0);
     assertTrue(positions.nextPosition() >= 0);
   }    

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java Sat Feb 27 19:14:01 2010
@@ -57,7 +57,6 @@
     assertTrue(reader != null);
     assertEquals(indexDivisor, reader.getTermInfosIndexDivisor());
     SegmentTermDocs segTermDocs = new SegmentTermDocs(reader);
-    assertTrue(segTermDocs != null);
     segTermDocs.seek(new Term(DocHelper.TEXT_FIELD_2_KEY, "field"));
     if (segTermDocs.next() == true)
     {
@@ -79,7 +78,6 @@
       SegmentReader reader = SegmentReader.get(true, info, indexDivisor);
       assertTrue(reader != null);
       SegmentTermDocs segTermDocs = new SegmentTermDocs(reader);
-      assertTrue(segTermDocs != null);
       segTermDocs.seek(new Term("textField2", "bad"));
       assertTrue(segTermDocs.next() == false);
       reader.close();
@@ -89,7 +87,6 @@
       SegmentReader reader = SegmentReader.get(true, info, indexDivisor);
       assertTrue(reader != null);
       SegmentTermDocs segTermDocs = new SegmentTermDocs(reader);
-      assertTrue(segTermDocs != null);
       segTermDocs.seek(new Term("junk", "bad"));
       assertTrue(segTermDocs.next() == false);
       reader.close();

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java Sat Feb 27 19:14:01 2010
@@ -70,7 +70,6 @@
 
   private class IndexerThread extends TimedThread {
     IndexWriter writer;
-    public int count;
     int nextID;
 
     public IndexerThread(IndexWriter writer, TimedThread[] threads) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing2.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing2.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing2.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing2.java Sat Feb 27 19:14:01 2010
@@ -26,7 +26,7 @@
 import java.util.*;
 import java.io.IOException;
 
-import junit.framework.TestCase;
+import junit.framework.Assert;
 
 public class TestStressIndexing2 extends LuceneTestCase {
   static int maxFields=4;
@@ -644,7 +644,7 @@
         }
       } catch (Throwable e) {
         e.printStackTrace();
-        TestCase.fail(e.toString());
+        Assert.fail(e.toString());
       }
 
       synchronized (this) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestTermVectorsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestTermVectorsReader.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestTermVectorsReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestTermVectorsReader.java Sat Feb 27 19:14:01 2010
@@ -166,7 +166,6 @@
 
   public void testReader() throws IOException {
     TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
-    assertTrue(reader != null);
     for (int j = 0; j < 5; j++) {
       TermFreqVector vector = reader.get(j, testFields[0]);
       assertTrue(vector != null);
@@ -183,7 +182,6 @@
 
   public void testPositionReader() throws IOException {
     TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
-    assertTrue(reader != null);
     TermPositionVector vector;
     String[] terms;
     vector = (TermPositionVector) reader.get(0, testFields[0]);
@@ -226,7 +224,6 @@
 
   public void testOffsetReader() throws IOException {
     TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
-    assertTrue(reader != null);
     TermPositionVector vector = (TermPositionVector) reader.get(0, testFields[0]);
     assertTrue(vector != null);
     String[] terms = vector.getTerms();
@@ -255,7 +252,6 @@
 
   public void testMapper() throws IOException {
     TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
-    assertTrue(reader != null);
     SortedTermVectorMapper mapper = new SortedTermVectorMapper(new TermVectorEntryFreqSortedComparator());
     reader.get(0, mapper);
     SortedSet<TermVectorEntry> set = mapper.getTermVectorEntrySet();
@@ -376,7 +372,6 @@
   public void testBadParams() {
     try {
       TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
-      assertTrue(reader != null);
       //Bad document number, good field number
       reader.get(50, testFields[0]);
       fail();
@@ -385,7 +380,6 @@
     }
     try {
       TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
-      assertTrue(reader != null);
       //Bad document number, no field
       reader.get(50);
       fail();
@@ -394,7 +388,6 @@
     }
     try {
       TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
-      assertTrue(reader != null);
       //good document number, bad field number
       TermFreqVector vector = reader.get(0, "f50");
       assertTrue(vector == null);

Modified: lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java Sat Feb 27 19:14:01 2010
@@ -150,7 +150,7 @@
   private int originalMaxClauses;
 
   @Override
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
     super.setUp();
     originalMaxClauses = BooleanQuery.getMaxClauseCount();
   }
@@ -1017,9 +1017,9 @@
   }
 
   @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
+  protected void tearDown() throws Exception {
     BooleanQuery.setMaxClauseCount(originalMaxClauses);
+    super.tearDown();
   }
 
   // LUCENE-2002: make sure defaults for StandardAnalyzer's

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/CachingWrapperFilterHelper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/CachingWrapperFilterHelper.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/CachingWrapperFilterHelper.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/CachingWrapperFilterHelper.java Sat Feb 27 19:14:01 2010
@@ -20,8 +20,7 @@
 import java.io.IOException;
 import java.util.WeakHashMap;
 
-import junit.framework.TestCase;
-
+import junit.framework.Assert;
 import org.apache.lucene.index.IndexReader;
 
 /**
@@ -51,9 +50,9 @@
     synchronized (cache) {  // check cache
       DocIdSet cached = cache.get(reader);
       if (shouldHaveCache) {
-        TestCase.assertNotNull("Cache should have data ", cached);
+        Assert.assertNotNull("Cache should have data ", cached);
       } else {
-        TestCase.assertNull("Cache should be null " + cached , cached);
+        Assert.assertNull("Cache should be null " + cached , cached);
       }
       if (cached != null) {
         return cached;
@@ -77,7 +76,7 @@
   @Override
   public boolean equals(Object o) {
     if (!(o instanceof CachingWrapperFilterHelper)) return false;
-    return this.filter.equals((CachingWrapperFilterHelper)o);
+    return this.filter.equals(o);
   }
   
   @Override

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java Sat Feb 27 19:14:01 2010
@@ -76,7 +76,7 @@
    * @param searcher the searcher to test the query against
    * @param defaultFieldName used for displaying the query in assertion messages
    * @param results a list of documentIds that must match the query
-   * @see Searcher#search(Query,HitCollector)
+   * @see Searcher#search(Query,Collector)
    * @see #checkHits
    */
   public static void checkHitCollector(Query query, String defaultFieldName,
@@ -149,7 +149,7 @@
    * @param searcher the searcher to test the query against
    * @param defaultFieldName used for displaing the query in assertion messages
    * @param results a list of documentIds that must match the query
-   * @see Searcher#search(Query)
+   * @see Searcher#search(Query, int)
    * @see #checkHitCollector
    */
   public static void checkHits(
@@ -159,7 +159,7 @@
         int[] results)
           throws IOException {
 
-    ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
+    ScoreDoc[] hits = searcher.search(query, 1000).scoreDocs;
 
     Set<Integer> correct = new TreeSet<Integer>();
     for (int i = 0; i < results.length; i++) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/JustCompileSearch.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/JustCompileSearch.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/JustCompileSearch.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/JustCompileSearch.java Sat Feb 27 19:14:01 2010
@@ -245,7 +245,7 @@
     }
 
     @Override
-    public Comparable value(int slot) {
+    public Comparable<?> value(int slot) {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
     

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java Sat Feb 27 19:14:01 2010
@@ -47,7 +47,7 @@
   private int mulFactor;
 
   @Override
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
     super.setUp();
     RAMDirectory directory = new RAMDirectory();
     IndexWriter writer= new IndexWriter(directory, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
@@ -93,9 +93,10 @@
   }
 
   @Override
-  public void tearDown() throws Exception {
+  protected void tearDown() throws Exception {
     reader.close();
     dir2.close();
+    super.tearDown();
   }
 
   private String[] docFields = {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java Sat Feb 27 19:14:01 2010
@@ -18,7 +18,6 @@
  */
 
 
-import junit.framework.TestCase;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 import org.apache.lucene.document.Document;
@@ -42,7 +41,7 @@
     public IndexSearcher s;
 
     @Override
-    public void setUp() throws Exception {
+    protected void setUp() throws Exception {
         super.setUp();
 
 
@@ -338,7 +337,7 @@
         // The constrained query
         // should be a superset to the unconstrained query.
         if (top2.totalHits > top1.totalHits) {
-          TestCase.fail("Constrained results not a subset:\n"
+          fail("Constrained results not a subset:\n"
                         + CheckHits.topdocsString(top1,0,0)
                         + CheckHits.topdocsString(top2,0,0)
                         + "for query:" + q2.toString());
@@ -355,7 +354,7 @@
               float otherScore = top1.scoreDocs[other].score;
               // check if scores match
               if (Math.abs(otherScore-score)>1.0e-6f) {
-                        TestCase.fail("Doc " + id + " scores don't match\n"
+                        fail("Doc " + id + " scores don't match\n"
                 + CheckHits.topdocsString(top1,0,0)
                 + CheckHits.topdocsString(top2,0,0)
                 + "for query:" + q2.toString());
@@ -364,7 +363,7 @@
           }
 
           // check if subset
-          if (!found) TestCase.fail("Doc " + id + " not found\n"
+          if (!found) fail("Doc " + id + " not found\n"
                 + CheckHits.topdocsString(top1,0,0)
                 + CheckHits.topdocsString(top2,0,0)
                 + "for query:" + q2.toString());

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestComplexExplanations.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestComplexExplanations.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestComplexExplanations.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestComplexExplanations.java Sat Feb 27 19:14:01 2010
@@ -32,7 +32,7 @@
    * nice with boosts of 0.0
    */
   @Override
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
     super.setUp();
     searcher.setSimilarity(createQnorm1Similarity());
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestCustomSearcherSort.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestCustomSearcherSort.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestCustomSearcherSort.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestCustomSearcherSort.java Sat Feb 27 19:14:01 2010
@@ -93,7 +93,7 @@
    * Create index and query for test cases. 
    */
   @Override
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
           super.setUp();
           index = getIndex();
           query = new TermQuery( new Term("content", "test"));

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestDateSort.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestDateSort.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestDateSort.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestDateSort.java Sat Feb 27 19:14:01 2010
@@ -46,7 +46,7 @@
   private static Directory directory;
 
   @Override
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
     super.setUp();
     // Create an index writer.
     directory = new RAMDirectory();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java Sat Feb 27 19:14:01 2010
@@ -74,7 +74,7 @@
     public IndexSearcher s;
 
     @Override
-    public void setUp() throws Exception {
+    protected void setUp() throws Exception {
         super.setUp();
 
         index = new RAMDirectory();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestDocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestDocIdSet.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestDocIdSet.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestDocIdSet.java Sat Feb 27 19:14:01 2010
@@ -35,7 +35,6 @@
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util._TestUtil;
 
 public class TestDocIdSet extends LuceneTestCase {
   public void testFilteredDocIdSet() throws Exception {
@@ -95,8 +94,8 @@
     int[] answer = new int[]{4,6,8};
     boolean same = Arrays.equals(answer, docs);
     if (!same) {
-      System.out.println("answer: "+_TestUtil.arrayToString(answer));
-      System.out.println("gotten: "+_TestUtil.arrayToString(docs));
+      System.out.println("answer: " + Arrays.toString(answer));
+      System.out.println("gotten: " + Arrays.toString(docs));
       fail();
     }
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestElevationComparator.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestElevationComparator.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestElevationComparator.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestElevationComparator.java Sat Feb 27 19:14:01 2010
@@ -21,6 +21,7 @@
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.*;
+import org.apache.lucene.search.FieldValueHitQueue.Entry;
 import org.apache.lucene.store.*;
 import org.apache.lucene.util.LuceneTestCase;
 import java.io.IOException;
@@ -70,7 +71,7 @@
         new SortField(null, SortField.SCORE, reversed)
       );
 
-    TopDocsCollector topCollector = TopFieldCollector.create(sort, 50, false, true, true, true);
+    TopDocsCollector<Entry> topCollector = TopFieldCollector.create(sort, 50, false, true, true, true);
     searcher.search(newq, null, topCollector);
 
     TopDocs topDocs = topCollector.topDocs(0, 10);
@@ -171,7 +172,7 @@
      }
 
      @Override
-     public Comparable value(int slot) {
+     public Comparable<?> value(int slot) {
        return Integer.valueOf(values[slot]);
      }
    };

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestExplanations.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestExplanations.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestExplanations.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestExplanations.java Sat Feb 27 19:14:01 2010
@@ -54,13 +54,13 @@
     new QueryParser(TEST_VERSION_CURRENT, FIELD, new WhitespaceAnalyzer(TEST_VERSION_CURRENT));
 
   @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
+  protected void tearDown() throws Exception {
     searcher.close();
+    super.tearDown();
   }
   
   @Override
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
     super.setUp();
     RAMDirectory directory = new RAMDirectory();
     IndexWriter writer= new IndexWriter(directory, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true,

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCache.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCache.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCache.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCache.java Sat Feb 27 19:14:01 2010
@@ -65,8 +65,8 @@
       FieldCache cache = FieldCache.DEFAULT;
       ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
       cache.setInfoStream(new PrintStream(bos));
-      double [] doubles = cache.getDoubles(reader, "theDouble");
-      float [] floats = cache.getFloats(reader, "theDouble");
+      cache.getDoubles(reader, "theDouble");
+      cache.getFloats(reader, "theDouble");
       assertTrue(bos.toString().indexOf("WARNING") != -1);
     } finally {
       FieldCache.DEFAULT.purgeAllCaches();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java Sat Feb 27 19:14:01 2010
@@ -479,7 +479,7 @@
 
     int numDocs = reader.numDocs();
     Float minIdO = Float.valueOf(minId + .5f);
-    Float medIdO = Float.valueOf(minIdO.floatValue() + ((float) (maxId-minId))/2.0f);
+    Float medIdO = Float.valueOf(minIdO.floatValue() + ((maxId-minId))/2.0f);
         
     ScoreDoc[] result;
     Query q = new TermQuery(new Term("body","body"));
@@ -507,7 +507,7 @@
 
     int numDocs = reader.numDocs();
     Double minIdO = Double.valueOf(minId + .5);
-    Double medIdO = Double.valueOf(minIdO.floatValue() + ((double) (maxId-minId))/2.0);
+    Double medIdO = Double.valueOf(minIdO.floatValue() + ((maxId-minId))/2.0);
         
     ScoreDoc[] result;
     Query q = new TermQuery(new Term("body","body"));

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestFilteredQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestFilteredQuery.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestFilteredQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestFilteredQuery.java Sat Feb 27 19:14:01 2010
@@ -45,7 +45,7 @@
   private Filter filter;
 
   @Override
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
     super.setUp();
     directory = new RAMDirectory();
     IndexWriter writer = new IndexWriter (directory, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
@@ -92,8 +92,7 @@
   }
 
   @Override
-  public void tearDown()
-  throws Exception {
+  protected void tearDown() throws Exception {
     searcher.close();
     directory.close();
     super.tearDown();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java Sat Feb 27 19:14:01 2010
@@ -56,7 +56,7 @@
   }
 
   @Override
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
     super.setUp();
 
     String[] data = new String[] { "A 1 2 3 4 5 6", "Z       4 5 6", null,

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java Sat Feb 27 19:14:01 2010
@@ -38,7 +38,7 @@
   }
   
   @Override
-  public void setUp() throws Exception {
+  protected void setUp() throws Exception {
     super.setUp();
     IndexWriter writer
             = new IndexWriter(directory, new SimpleAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java Sat Feb 27 19:14:01 2010
@@ -86,10 +86,10 @@
   }
 
   @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
+  protected void tearDown() throws Exception {
     searcher.close();
     directory.close();
+    super.tearDown();
   }
 
   public void testNotCloseEnough() throws Exception {
@@ -474,7 +474,7 @@
     query.add(new Term("palindrome", "three"));
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("just sloppy enough", 1, hits.length);
-    float score2 = hits[0].score;
+    //float score2 = hits[0].score;
     //System.out.println("palindrome: two three: "+score2);
     QueryUtils.check(query,searcher);
     
@@ -488,7 +488,7 @@
     query.add(new Term("palindrome", "two"));
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("just sloppy enough", 1, hits.length);
-    float score3 = hits[0].score;
+    //float score3 = hits[0].score;
     //System.out.println("palindrome: three two: "+score3);
     QueryUtils.check(query,searcher);
 
@@ -536,7 +536,7 @@
     query.add(new Term("palindrome", "three"));
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("just sloppy enough", 1, hits.length);
-    float score2 = hits[0].score;
+    //float score2 = hits[0].score;
     //System.out.println("palindrome: one two three: "+score2);
     QueryUtils.check(query,searcher);
     
@@ -551,7 +551,7 @@
     query.add(new Term("palindrome", "one"));
     hits = searcher.search(query, null, 1000).scoreDocs;
     assertEquals("just sloppy enough", 1, hits.length);
-    float score3 = hits[0].score;
+    //float score3 = hits[0].score;
     //System.out.println("palindrome: three two one: "+score3);
     QueryUtils.check(query,searcher);
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestQueryTermVector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestQueryTermVector.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestQueryTermVector.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestQueryTermVector.java Sat Feb 27 19:14:01 2010
@@ -33,7 +33,6 @@
     String [] gold = {"again", "bar", "foo", "go"};
     int [] goldFreqs = {1, 2, 3, 3};
     QueryTermVector result = new QueryTermVector(queryTerm);
-    assertTrue(result != null);
     String [] terms = result.getTerms();
     assertTrue(terms.length == 4);
     int [] freq = result.getTermFrequencies();
@@ -43,7 +42,6 @@
     assertTrue(result.getTerms().length == 0);
     
     result = new QueryTermVector("foo bar foo again foo bar go go go", new WhitespaceAnalyzer(TEST_VERSION_CURRENT));
-    assertTrue(result != null);
     terms = result.getTerms();
     assertTrue(terms.length == 4);
     freq = result.getTermFrequencies();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java?rev=917019&r1=917018&r2=917019&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java Sat Feb 27 19:14:01 2010
@@ -143,7 +143,7 @@
       @Override
       public DocIdSet getDocIdSet(IndexReader reader) {
         return new DocIdBitSet(rnd);
-      };
+      }
     });
     bq.add(q, BooleanClause.Occur.MUST);
     if (validate) {



Mime
View raw message