You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2016/02/24 07:12:08 UTC

[01/53] [abbrv] lucene-solr git commit: LUCENE-7037: Switch all exceptions tests to expectThrows()

Repository: lucene-solr
Updated Branches:
  refs/heads/apiv2 589363176 -> c0b91afb9


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
index 877d74a..f09be9d 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
@@ -222,12 +222,10 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
     si.setFiles(Collections.emptyList());
     si.getCodec().compoundFormat().write(dir, si, IOContext.DEFAULT);
     Directory cfs = si.getCodec().compoundFormat().getCompoundReader(dir, si, IOContext.DEFAULT);
-    try {
+    expectThrows(UnsupportedOperationException.class, () -> {
       cfs.createOutput("bogus", IOContext.DEFAULT);
-      fail("didn't get expected exception");
-    } catch (UnsupportedOperationException expected) {
-      // expected UOE
-    }
+    });
+
     cfs.close();
     dir.close();
   }
@@ -245,12 +243,10 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
     si.setFiles(Collections.emptyList());
     si.getCodec().compoundFormat().write(dir, si, IOContext.DEFAULT);
     Directory cfs = si.getCodec().compoundFormat().getCompoundReader(dir, si, IOContext.DEFAULT);
-    try {
+    expectThrows(UnsupportedOperationException.class, () -> {
       cfs.deleteFile(testfile);
-      fail("didn't get expected exception");
-    } catch (UnsupportedOperationException expected) {
-      // expected UOE
-    }
+    });
+
     cfs.close();
     dir.close();
   }
@@ -268,12 +264,10 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
     si.setFiles(Collections.emptyList());
     si.getCodec().compoundFormat().write(dir, si, IOContext.DEFAULT);
     Directory cfs = si.getCodec().compoundFormat().getCompoundReader(dir, si, IOContext.DEFAULT);
-    try {
+    expectThrows(UnsupportedOperationException.class, () -> {
       cfs.renameFile(testfile, "bogus");
-      fail("didn't get expected exception");
-    } catch (UnsupportedOperationException expected) {
-      // expected UOE
-    }
+    });
+
     cfs.close();
     dir.close();
   }
@@ -291,12 +285,10 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
     si.setFiles(Collections.emptyList());
     si.getCodec().compoundFormat().write(dir, si, IOContext.DEFAULT);
     Directory cfs = si.getCodec().compoundFormat().getCompoundReader(dir, si, IOContext.DEFAULT);
-    try {
+    expectThrows(UnsupportedOperationException.class, () -> {
       cfs.sync(Collections.singleton(testfile));
-      fail("didn't get expected exception");
-    } catch (UnsupportedOperationException expected) {
-      // expected UOE
-    }
+    });
+
     cfs.close();
     dir.close();
   }
@@ -314,12 +306,10 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
     si.setFiles(Collections.emptyList());
     si.getCodec().compoundFormat().write(dir, si, IOContext.DEFAULT);
     Directory cfs = si.getCodec().compoundFormat().getCompoundReader(dir, si, IOContext.DEFAULT);
-    try {
+    expectThrows(UnsupportedOperationException.class, () -> {
       cfs.obtainLock("foobar");
-      fail("didn't get expected exception");
-    } catch (UnsupportedOperationException expected) {
-      // expected UOE
-    }
+    });
+
     cfs.close();
     dir.close();
   }
@@ -602,12 +592,9 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
     Directory cr = createLargeCFS(dir);
     
     // Open bogus file
-    try {
+    expectThrows(IOException.class, () -> {
       cr.openInput("bogus", newIOContext(random()));
-      fail("File not found");
-    } catch (IOException e) {
-      /* success */;
-    }
+    });
     
     cr.close();
     dir.close();
@@ -620,21 +607,18 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
     is.seek(is.length() - 10);
     byte b[] = new byte[100];
     is.readBytes(b, 0, 10);
-    
-    try {
+
+    // Single byte read past end of file
+    expectThrows(IOException.class, () -> {
       is.readByte();
-      fail("Single byte read past end of file");
-    } catch (IOException e) {
-      /* success */
-    }
-    
+    });
+
     is.seek(is.length() - 10);
-    try {
+
+    // Block read past end of file
+    expectThrows(IOException.class, () -> {
       is.readBytes(b, 0, 50);
-      fail("Block read past end of file");
-    } catch (IOException e) {
-      /* success */
-    }
+    });
     
     is.close();
     cr.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java
index d81f188..d8e2296 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java
@@ -87,12 +87,11 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes
     assertEquals(1, infos2.size());
     assertNotNull(infos2.fieldInfo("field"));
     Map<String,String> attributes = infos2.fieldInfo("field").attributes();
-    try {
+    // shouldn't be able to modify attributes
+    expectThrows(UnsupportedOperationException.class, () -> {
       attributes.put("bogus", "bogus");
-      fail("shouldn't be able to modify attributes");
-    } catch (UnsupportedOperationException expected) {
-      // ok
-    }
+    });
+
     dir.close();
   }
   
@@ -123,14 +122,10 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes
     FieldInfos infos = builder.finish();
     
     fail.setDoFail();
-    try {
+    expectThrows(FakeIOException.class, () -> {
       codec.fieldInfosFormat().write(dir, segmentInfo, "", infos, IOContext.DEFAULT);
-      fail("didn't get expected exception");
-    } catch (FakeIOException expected) {
-      // ok
-    } finally {
-      fail.clearDoFail();
-    }
+    });
+    fail.clearDoFail();
     
     dir.close();
   }
@@ -162,14 +157,10 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes
     FieldInfos infos = builder.finish();
     
     fail.setDoFail();
-    try {
+    expectThrows(FakeIOException.class, () -> {
       codec.fieldInfosFormat().write(dir, segmentInfo, "", infos, IOContext.DEFAULT);
-      fail("didn't get expected exception");
-    } catch (FakeIOException expected) {
-      // ok
-    } finally {
-      fail.clearDoFail();
-    }
+    });
+    fail.clearDoFail();
     
     dir.close();
   }
@@ -202,14 +193,10 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes
     codec.fieldInfosFormat().write(dir, segmentInfo, "", infos, IOContext.DEFAULT);
     
     fail.setDoFail();
-    try {
-      codec.fieldInfosFormat().read(dir, segmentInfo, "", IOContext.DEFAULT);      
-      fail("didn't get expected exception");
-    } catch (FakeIOException expected) {
-      // ok
-    } finally {
-      fail.clearDoFail();
-    }
+    expectThrows(FakeIOException.class, () -> {
+      codec.fieldInfosFormat().read(dir, segmentInfo, "", IOContext.DEFAULT);
+    });
+    fail.clearDoFail();
     
     dir.close();
   }
@@ -242,14 +229,10 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes
     codec.fieldInfosFormat().write(dir, segmentInfo, "", infos, IOContext.DEFAULT);
     
     fail.setDoFail();
-    try {
-      codec.fieldInfosFormat().read(dir, segmentInfo, "", IOContext.DEFAULT);      
-      fail("didn't get expected exception");
-    } catch (FakeIOException expected) {
-      // ok
-    } finally {
-      fail.clearDoFail();
-    }
+    expectThrows(FakeIOException.class, () -> {
+      codec.fieldInfosFormat().read(dir, segmentInfo, "", IOContext.DEFAULT);
+    });
+    fail.clearDoFail();
     
     dir.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java
index 3a4ebf7..1136afa 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java
@@ -77,12 +77,12 @@ public abstract class BaseSegmentInfoFormatTestCase extends BaseIndexFileFormatT
     
     SegmentInfo info2 = codec.segmentInfoFormat().read(dir, "_123", id, IOContext.DEFAULT);
     assertEquals(info.files(), info2.files());
-    try {
+
+    // files set should be immutable
+    expectThrows(UnsupportedOperationException.class, () -> {
       info2.files().add("bogus");
-      fail("files set should be immutable");
-    } catch (UnsupportedOperationException expected) {
-      // ok
-    }
+    });
+
     dir.close();
   }
   
@@ -100,12 +100,12 @@ public abstract class BaseSegmentInfoFormatTestCase extends BaseIndexFileFormatT
     codec.segmentInfoFormat().write(dir, info, IOContext.DEFAULT);
     SegmentInfo info2 = codec.segmentInfoFormat().read(dir, "_123", id, IOContext.DEFAULT);
     assertEquals(diagnostics, info2.getDiagnostics());
-    try {
+
+    // diagnostics map should be immutable
+    expectThrows(UnsupportedOperationException.class, () -> {
       info2.getDiagnostics().put("bogus", "bogus");
-      fail("diagnostics map should be immutable");
-    } catch (UnsupportedOperationException expected) {
-      // ok
-    }
+    });
+
     dir.close();
   }
   
@@ -123,12 +123,12 @@ public abstract class BaseSegmentInfoFormatTestCase extends BaseIndexFileFormatT
     codec.segmentInfoFormat().write(dir, info, IOContext.DEFAULT);
     SegmentInfo info2 = codec.segmentInfoFormat().read(dir, "_123", id, IOContext.DEFAULT);
     assertEquals(attributes, info2.getAttributes());
-    try {
+    
+    // attributes map should be immutable
+    expectThrows(UnsupportedOperationException.class, () -> {
       info2.getAttributes().put("bogus", "bogus");
-      fail("attributes map should be immutable");
-    } catch (UnsupportedOperationException expected) {
-      // ok
-    }
+    });
+
     dir.close();
   }
   
@@ -187,14 +187,10 @@ public abstract class BaseSegmentInfoFormatTestCase extends BaseIndexFileFormatT
     info.setFiles(Collections.<String>emptySet());
     
     fail.setDoFail();
-    try {
+    expectThrows(FakeIOException.class, () -> {
       codec.segmentInfoFormat().write(dir, info, IOContext.DEFAULT);
-      fail("didn't get expected exception");
-    } catch (FakeIOException expected) {
-      // ok
-    } finally {
-      fail.clearDoFail();
-    }
+    });
+    fail.clearDoFail();
     
     dir.close();
   }
@@ -224,14 +220,10 @@ public abstract class BaseSegmentInfoFormatTestCase extends BaseIndexFileFormatT
     info.setFiles(Collections.<String>emptySet());
     
     fail.setDoFail();
-    try {
+    expectThrows(FakeIOException.class, () -> {
       codec.segmentInfoFormat().write(dir, info, IOContext.DEFAULT);
-      fail("didn't get expected exception");
-    } catch (FakeIOException expected) {
-      // ok
-    } finally {
-      fail.clearDoFail();
-    }
+    });
+    fail.clearDoFail();
     
     dir.close();
   }
@@ -262,14 +254,10 @@ public abstract class BaseSegmentInfoFormatTestCase extends BaseIndexFileFormatT
     codec.segmentInfoFormat().write(dir, info, IOContext.DEFAULT);
     
     fail.setDoFail();
-    try {
+    expectThrows(FakeIOException.class, () -> {
       codec.segmentInfoFormat().read(dir, "_123", id, IOContext.DEFAULT);
-      fail("didn't get expected exception");
-    } catch (FakeIOException expected) {
-      // ok
-    } finally {
-      fail.clearDoFail();
-    }
+    });
+    fail.clearDoFail();
     
     dir.close();
   }
@@ -300,14 +288,11 @@ public abstract class BaseSegmentInfoFormatTestCase extends BaseIndexFileFormatT
     codec.segmentInfoFormat().write(dir, info, IOContext.DEFAULT);
     
     fail.setDoFail();
-    try {
+    expectThrows(FakeIOException.class, () -> {
       codec.segmentInfoFormat().read(dir, "_123", id, IOContext.DEFAULT);
-      fail("didn't get expected exception");
-    } catch (FakeIOException expected) {
-      // ok
-    } finally {
-      fail.clearDoFail();
-    }
+    });
+    fail.clearDoFail();
+
     dir.close();
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/test-framework/src/java/org/apache/lucene/index/BaseTestCheckIndex.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseTestCheckIndex.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseTestCheckIndex.java
index f396457..cdec720 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseTestCheckIndex.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseTestCheckIndex.java
@@ -172,13 +172,10 @@ public class BaseTestCheckIndex extends LuceneTestCase {
     iw.addDocument(new Document());
     iw.commit();
     
-    // keep IW open...
-    try {
+    // keep IW open... should not be able to obtain write lock
+    expectThrows(LockObtainFailedException.class, () -> {
       new CheckIndex(dir);
-      fail("should not have obtained write lock");
-    } catch (LockObtainFailedException expected) {
-      // ok
-    }
+    });
     
     iw.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java b/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java
index 240f445..cac861e 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java
@@ -18,6 +18,7 @@ package org.apache.lucene.index;
 
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Random;
@@ -190,10 +191,7 @@ class DocHelper {
       buffer.append("Lazily loading lengths of language in lieu of laughing ");
     }
     
-    try {
-      LAZY_FIELD_BINARY_BYTES = "These are some binary field bytes".getBytes("UTF8");
-    } catch (UnsupportedEncodingException e) {
-    }
+    LAZY_FIELD_BINARY_BYTES = "These are some binary field bytes".getBytes(StandardCharsets.UTF_8);
     lazyFieldBinary = new StoredField(LAZY_FIELD_BINARY_KEY, LAZY_FIELD_BINARY_BYTES);
     fields[fields.length - 2] = lazyFieldBinary;
     LARGE_LAZY_FIELD_TEXT = buffer.toString();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java b/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java
index 973fa5e..90064c4 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java
@@ -1239,12 +1239,9 @@ public class RandomPostingsTester {
       }
     }
     assertFalse(iterator.hasNext());
-    try {
+    LuceneTestCase.expectThrows(NoSuchElementException.class, () -> {
       iterator.next();
-      throw new AssertionError("Fields.iterator() doesn't throw NoSuchElementException when past the end");
-    } catch (NoSuchElementException expected) {
-      // expected
-    }
+    });
   }
 
   /** Indexes all fields/terms at the specified

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
index 3d9c20d..5f66074 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
@@ -365,32 +365,26 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
     output.close();
     
     IndexInput input = dir.openInput("stringset", newIOContext(random()));
-    Set<String> set = input.readSetOfStrings();
-    assertEquals(asSet("test1", "test2"), set);
-    try {
-      set.add("bogus");
-      fail("set should be immutable");
-    } catch (UnsupportedOperationException expected) {
-      // ok
-    }
-    
-    set = input.readSetOfStrings();
-    assertEquals(Collections.emptySet(), set);
-    try {
-      set.add("bogus");
-      fail("set should be immutable");
-    } catch (UnsupportedOperationException expected) {
-      // ok
-    }
-    
-    set = input.readSetOfStrings();
-    assertEquals(Collections.singleton("test3"), set);
-    try {
-      set.add("bogus");
-      fail("set should be immutable");
-    } catch (UnsupportedOperationException expected) {
-      // ok
-    }
+    Set<String> set1 = input.readSetOfStrings();
+    assertEquals(asSet("test1", "test2"), set1);
+    // set should be immutable
+    expectThrows(UnsupportedOperationException.class, () -> {
+      set1.add("bogus");
+    });
+    
+    Set<String> set2 = input.readSetOfStrings();
+    assertEquals(Collections.emptySet(), set2);
+    // set should be immutable
+    expectThrows(UnsupportedOperationException.class, () -> {
+      set2.add("bogus");
+    });
+    
+    Set<String> set3 = input.readSetOfStrings();
+    assertEquals(Collections.singleton("test3"), set3);
+    // set should be immutable
+    expectThrows(UnsupportedOperationException.class, () -> {
+      set3.add("bogus");
+    });
     
     assertEquals(input.length(), input.getFilePointer());
     input.close();
@@ -410,32 +404,26 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
     output.close();
     
     IndexInput input = dir.openInput("stringmap", newIOContext(random()));
-    Map<String,String> map = input.readMapOfStrings();
-    assertEquals(m, map);
-    try {
-      map.put("bogus1", "bogus2");
-      fail("map should be immutable");
-    } catch (UnsupportedOperationException expected) {
-      // ok
-    }
-    
-    map = input.readMapOfStrings();
-    assertEquals(Collections.emptyMap(), map);
-    try {
-      map.put("bogus1", "bogus2");
-      fail("map should be immutable");
-    } catch (UnsupportedOperationException expected) {
-      // ok
-    }
-    
-    map = input.readMapOfStrings();
-    assertEquals(Collections.singletonMap("key", "value"), map);
-    try {
-      map.put("bogus1", "bogus2");
-      fail("map should be immutable");
-    } catch (UnsupportedOperationException expected) {
-      // ok
-    }
+    Map<String,String> map1 = input.readMapOfStrings();
+    assertEquals(m, map1);
+    // map should be immutable
+    expectThrows(UnsupportedOperationException.class, () -> {
+      map1.put("bogus1", "bogus2");
+    });
+    
+    Map<String,String> map2 = input.readMapOfStrings();
+    assertEquals(Collections.emptyMap(), map2);
+    // map should be immutable
+    expectThrows(UnsupportedOperationException.class, () -> {
+      map2.put("bogus1", "bogus2");
+    });
+    
+    Map<String,String> map3 = input.readMapOfStrings();
+    assertEquals(Collections.singletonMap("key", "value"), map3);
+    // map should be immutable
+    expectThrows(UnsupportedOperationException.class, () -> {
+      map3.put("bogus1", "bogus2");
+    });
     
     assertEquals(input.length(), input.getFilePointer());
     input.close();
@@ -468,12 +456,9 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
   public void testDetectClose() throws Throwable {
     Directory dir = getDirectory(createTempDir("testDetectClose"));
     dir.close();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {      
       dir.createOutput("test", newIOContext(random()));
-      fail("did not hit expected exception");
-    } catch (AlreadyClosedException ace) {
-      // expected
-    }
+    });
   }
   
   public void testThreadSafety() throws Exception {
@@ -622,13 +607,11 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
     o.writeBytes(b, 0, len);
     o.close();
     IndexInput i = dir.openInput("out", newIOContext(random()));
-    try {
+    expectThrows(EOFException.class, () -> {      
       i.seek(len + random().nextInt(2048));
       i.readByte();
-      fail("Did not get EOFException");
-    } catch (EOFException eof) {
-      // pass
-    }
+    });
+
     i.close();
     dir.close();
   }
@@ -641,25 +624,19 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
     o.writeBytes(b, 0, len);
     o.close();
     IndexInput i = dir.openInput("out", newIOContext(random()));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {      
       i.slice("slice1", 0, len + 1);
-      fail("Did not get IllegalArgumentException");
-    } catch (IllegalArgumentException iae) {
-      // pass
-    }
-    try {
+    });
+
+    expectThrows(IllegalArgumentException.class, () -> {      
       i.slice("slice2", -1, len);
-      fail("Did not get IllegalArgumentException");
-    } catch (IllegalArgumentException iae) {
-      // pass
-    }
+    });
+
     IndexInput slice = i.slice("slice3", 4, len / 2);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {      
       slice.slice("slice3sub", 1, len / 2);
-      fail("Did not get IllegalArgumentException");
-    } catch (IllegalArgumentException iae) {
-      // pass
-    }
+    });
+
     i.close();
     dir.close();    
   }
@@ -1215,12 +1192,9 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
       try (IndexInput in = dir.openInput("a", IOContext.DEFAULT)) {
         in.seek(100);
         assertEquals(100, in.getFilePointer());
-        try {
+        expectThrows(EOFException.class, () -> {      
           in.seek(1025);
-          fail("didn't hit expected exception");
-        } catch (EOFException eofe) {
-          // expected
-        }
+        });
       }
     }
   }
@@ -1232,17 +1206,18 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
       FSDirectory fsDir = (FSDirectory) dir;
 
       // Keep trying until virus checker refuses to delete:
-      String fileName;
+      final String fileName;
       while (true) {
-        fileName = TestUtil.randomSimpleString(random());
-        if (fileName.length() == 0) {
+        String candidate = TestUtil.randomSimpleString(random());
+        if (candidate.length() == 0) {
           continue;
         }
-        try (IndexOutput out = dir.createOutput(fileName, IOContext.DEFAULT)) {
+        try (IndexOutput out = dir.createOutput(candidate, IOContext.DEFAULT)) {
         }
-        fsDir.deleteFile(fileName);
+        fsDir.deleteFile(candidate);
         if (fsDir.checkPendingDeletions()) {
           // good: virus checker struck and prevented deletion of fileName
+          fileName = candidate;
           break;
         }
       }
@@ -1251,35 +1226,23 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
       assertFalse(Arrays.asList(fsDir.listAll()).contains(fileName));
 
       // Make sure fileLength claims it's deleted:
-      try {
+      expectThrows(NoSuchFileException.class, () -> {      
         fsDir.fileLength(fileName);
-        fail("did not hit exception");
-      } catch (NoSuchFileException nsfe) {
-        // expected
-      }
+      });
 
       // Make sure rename fails:
-      try {
+      expectThrows(NoSuchFileException.class, () -> {      
         fsDir.renameFile(fileName, "file2");
-        fail("did not hit exception");
-      } catch (NoSuchFileException nsfe) {
-        // expected
-      }
+      });
 
       // Make sure delete fails:
-      try {
+      expectThrows(NoSuchFileException.class, () -> {      
         fsDir.deleteFile(fileName);
-        fail("did not hit exception");
-      } catch (NoSuchFileException nsfe) {
-        // expected
-      }
+      });
 
-      try {
+      expectThrows(NoSuchFileException.class, () -> {      
         fsDir.openInput(fileName, IOContext.DEFAULT);
-        fail("did not hit exception");
-      } catch (NoSuchFileException nsfe) {
-        // expected
-      }
+      });
 
       if (random().nextBoolean()) {
         try (IndexOutput out = fsDir.createOutput(fileName + "z", IOContext.DEFAULT)) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
index b2ad178..b5b3c53 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.PrintStream;
 import java.io.UnsupportedEncodingException;
 import java.nio.file.AccessDeniedException;
+import java.nio.file.NoSuchFileException;
 import java.nio.file.Path;
 import java.util.concurrent.CyclicBarrier;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -58,10 +59,10 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
     Directory dir = getDirectory(tempPath);
     
     Lock l = dir.obtainLock("commit");
-    try {
+    // shouldn't be able to get the lock twice
+    expectThrows(LockObtainFailedException.class, () -> {      
       dir.obtainLock("commit");
-      fail("succeeded in obtaining lock twice, didn't get exception");
-    } catch (LockObtainFailedException expected) {}
+    });
     l.close();
     
     // Make sure we can obtain first one again:
@@ -101,10 +102,10 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
     Lock l = dir.obtainLock("commit");
     l.close();
 
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {      
       l.ensureValid();
-      fail("didn't get exception");
-    } catch (AlreadyClosedException expected) {}
+    });
+
     dir.close();
   }
   


[36/53] [abbrv] lucene-solr git commit: LUCENE-7039: Improve PointRangeQuery & co

Posted by no...@apache.org.
LUCENE-7039: Improve PointRangeQuery & co


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/54a544b3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/54a544b3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/54a544b3

Branch: refs/heads/apiv2
Commit: 54a544b3075fe4a5a775d8774d0b462c5324b287
Parents: 1203264
Author: Robert Muir <rm...@apache.org>
Authored: Mon Feb 22 15:09:40 2016 -0500
Committer: Robert Muir <rm...@apache.org>
Committed: Mon Feb 22 15:10:15 2016 -0500

----------------------------------------------------------------------
 .../org/apache/lucene/document/DoublePoint.java |  26 +
 .../org/apache/lucene/document/FloatPoint.java  |  26 +
 .../org/apache/lucene/document/IntPoint.java    |  26 +
 .../org/apache/lucene/document/LongPoint.java   |  26 +
 .../apache/lucene/search/ExactPointQuery.java   | 153 ------
 .../apache/lucene/search/PointRangeQuery.java   | 491 ++++++++++++++++---
 .../index/TestDemoParallelLeafReader.java       |   2 +-
 .../apache/lucene/search/TestPointQueries.java  | 106 ++--
 .../TestUsageTrackingFilterCachingPolicy.java   |   2 +-
 .../demo/facet/DistanceFacetsExample.java       |   8 +-
 .../lucene/demo/facet/RangeFacetsExample.java   |   2 +-
 .../facet/range/TestRangeFacetCounts.java       |  20 +-
 .../search/highlight/HighlighterTest.java       |   2 +-
 .../lucene/search/TestDocValuesRangeQuery.java  |   8 +-
 .../suggest/document/TestSuggestField.java      |   2 +-
 .../lucene/index/BasePointFormatTestCase.java   |   6 +-
 16 files changed, 626 insertions(+), 280 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java b/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
index b3534fc..1619857 100644
--- a/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
@@ -89,4 +89,30 @@ public final class DoublePoint extends Field {
   public DoublePoint(String name, double... point) {
     super(name, pack(point), getType(point.length));
   }
+  
+  // public helper methods (e.g. for queries)
+  // TODO: try to rectify with pack() above, which works on a single concatenated array...
+
+  /** Encode n-dimensional double point into binary encoding */
+  public static byte[][] encode(Double value[]) {
+    byte[][] encoded = new byte[value.length][];
+    for (int i = 0; i < value.length; i++) {
+      if (value[i] != null) {
+        encoded[i] = encodeDimension(value[i]);
+      }
+    }
+    return encoded;
+  }
+  
+  /** Encode single double dimension */
+  public static byte[] encodeDimension(Double value) {
+    byte encoded[] = new byte[Long.BYTES];
+    NumericUtils.longToBytesDirect(NumericUtils.doubleToSortableLong(value), encoded, 0);
+    return encoded;
+  }
+  
+  /** Decode single double value */
+  public static Double decodeDimension(byte value[]) {
+    return NumericUtils.sortableLongToDouble(NumericUtils.bytesToLongDirect(value, 0));
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java b/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
index 92ea9d6..cfd6c7c 100644
--- a/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
@@ -89,4 +89,30 @@ public final class FloatPoint extends Field {
   public FloatPoint(String name, float... point) {
     super(name, pack(point), getType(point.length));
   }
+  
+  // public helper methods (e.g. for queries)
+  // TODO: try to rectify with pack() above, which works on a single concatenated array...
+
+  /** Encode n-dimensional float values into binary encoding */
+  public static byte[][] encode(Float value[]) {
+    byte[][] encoded = new byte[value.length][];
+    for (int i = 0; i < value.length; i++) {
+      if (value[i] != null) {
+        encoded[i] = encodeDimension(value[i]);
+      }
+    }
+    return encoded;
+  }
+  
+  /** Encode single float dimension */
+  public static byte[] encodeDimension(Float value) {
+    byte encoded[] = new byte[Integer.BYTES];
+    NumericUtils.intToBytesDirect(NumericUtils.floatToSortableInt(value), encoded, 0);
+    return encoded;
+  }
+  
+  /** Decode single float dimension */
+  public static Float decodeDimension(byte value[]) {
+    return NumericUtils.sortableIntToFloat(NumericUtils.bytesToIntDirect(value, 0));
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/IntPoint.java b/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
index e4a88e4..40ddf07 100644
--- a/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
@@ -89,4 +89,30 @@ public final class IntPoint extends Field {
   public IntPoint(String name, int... point) {
     super(name, pack(point), getType(point.length));
   }
+
+  // public helper methods (e.g. for queries)
+  // TODO: try to rectify with pack() above, which works on a single concatenated array...
+
+  /** Encode n-dimensional integer values into binary encoding */
+  public static byte[][] encode(Integer value[]) {
+    byte[][] encoded = new byte[value.length][];
+    for (int i = 0; i < value.length; i++) {
+      if (value[i] != null) {
+        encoded[i] = encodeDimension(value[i]);
+      }
+    }
+    return encoded;
+  }
+  
+  /** Encode single integer dimension */
+  public static byte[] encodeDimension(Integer value) {
+    byte encoded[] = new byte[Integer.BYTES];
+    NumericUtils.intToBytes(value, encoded, 0);
+    return encoded;
+  }
+  
+  /** Decode single integer dimension */
+  public static Integer decodeDimension(byte value[]) {
+    return NumericUtils.bytesToInt(value, 0);
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/LongPoint.java b/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
index 950101f..08a904c 100644
--- a/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
@@ -89,4 +89,30 @@ public final class LongPoint extends Field {
   public LongPoint(String name, long... point) {
     super(name, pack(point), getType(point.length));
   }
+  
+  // public helper methods (e.g. for queries)
+  // TODO: try to rectify with pack() above, which works on a single concatenated array...
+
+  /** Encode n-dimensional long values into binary encoding */
+  public static byte[][] encode(Long value[]) {
+    byte[][] encoded = new byte[value.length][];
+    for (int i = 0; i < value.length; i++) {
+      if (value[i] != null) {
+        encoded[i] = encodeDimension(value[i]);
+      }
+    }
+    return encoded;
+  }
+  
+  /** Encode single long dimension */
+  public static byte[] encodeDimension(Long value) {
+    byte encoded[] = new byte[Long.BYTES];
+    NumericUtils.longToBytes(value, encoded, 0);
+    return encoded;
+  }
+  
+  /** Decode single long dimension */
+  public static Long decodeDimension(byte value[]) {
+    return NumericUtils.bytesToLong(value, 0);
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/core/src/java/org/apache/lucene/search/ExactPointQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/ExactPointQuery.java b/lucene/core/src/java/org/apache/lucene/search/ExactPointQuery.java
deleted file mode 100644
index 5bcf113..0000000
--- a/lucene/core/src/java/org/apache/lucene/search/ExactPointQuery.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.lucene.search;
-
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Objects;
-
-import org.apache.lucene.index.FieldInfo;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.LeafReader;
-import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.index.PointValues.IntersectVisitor;
-import org.apache.lucene.index.PointValues.Relation;
-import org.apache.lucene.index.PointValues;
-import org.apache.lucene.util.DocIdSetBuilder;
-import org.apache.lucene.util.NumericUtils;
-import org.apache.lucene.util.RamUsageEstimator;
-import org.apache.lucene.util.StringHelper;
-
-/** Searches for single points in fields previously indexed using points
- *  e.g. {@link org.apache.lucene.document.LongPoint}. */
-
-public class ExactPointQuery extends Query {
-  final String field;
-  final int numDims;
-  final byte[][] point;
-  final int bytesPerDim;
-
-  public ExactPointQuery(String field, byte[][] point) {
-    this.field = field;
-    if (point == null) {
-      throw new IllegalArgumentException("point must not be null");
-    }
-    this.point = point;
-    this.numDims = point.length;
-
-    int bytesPerDim = -1;
-    for(byte[] value : point) {
-      if (value == null) {
-        throw new IllegalArgumentException("point's dimensional values must not be null");
-      }
-      if (bytesPerDim == -1) {
-        bytesPerDim = value.length;
-      } else if (value.length != bytesPerDim) {
-        throw new IllegalArgumentException("all dimensions must have same bytes length, but saw " + bytesPerDim + " and " + value.length);
-      }
-    }
-    this.bytesPerDim = bytesPerDim;
-  }
-
-  /** Use in the 1D case when you indexed 1D int values using {@link org.apache.lucene.document.IntPoint} */
-  public static ExactPointQuery new1DIntExact(String field, int value) {
-    return new ExactPointQuery(field, pack(value));
-  }
-
-  /** Use in the 1D case when you indexed 1D long values using {@link org.apache.lucene.document.LongPoint} */
-  public static ExactPointQuery new1DLongExact(String field, long value) {
-    return new ExactPointQuery(field, pack(value));
-  }
-
-  /** Use in the 1D case when you indexed 1D float values using {@link org.apache.lucene.document.FloatPoint} */
-  public static ExactPointQuery new1DFloatExact(String field, float value) {
-    return new ExactPointQuery(field, pack(value));
-  }
-
-  /** Use in the 1D case when you indexed 1D double values using {@link org.apache.lucene.document.DoublePoint} */
-  public static ExactPointQuery new1DDoubleExact(String field, double value) {
-    return new ExactPointQuery(field, pack(value));
-  }
-
-  private static byte[][] pack(long value) {
-    byte[][] result = new byte[][] {new byte[RamUsageEstimator.NUM_BYTES_LONG]};
-    NumericUtils.longToBytes(value, result[0], 0);
-    return result;
-  }
-
-  private static byte[][] pack(double value) {
-    byte[][] result = new byte[][] {new byte[RamUsageEstimator.NUM_BYTES_LONG]};
-    NumericUtils.longToBytesDirect(NumericUtils.doubleToSortableLong(value), result[0], 0);
-    return result;
-  }
-
-  private static byte[][] pack(int value) {
-    byte[][] result = new byte[][] {new byte[RamUsageEstimator.NUM_BYTES_INT]};
-    NumericUtils.intToBytes(value, result[0], 0);
-    return result;
-  }
-
-  private static byte[][] pack(float value) {
-    byte[][] result = new byte[][] {new byte[RamUsageEstimator.NUM_BYTES_INT]};
-    NumericUtils.intToBytesDirect(NumericUtils.floatToSortableInt(value), result[0], 0);
-    return result;
-  }
-
-  @Override
-  public Query rewrite(IndexReader reader) throws IOException {
-    boolean[] inclusive = new boolean[] {true};
-    return new PointRangeQuery(field, point, inclusive, point, inclusive);
-  }
-
-  @Override
-  public int hashCode() {
-    int hash = super.hashCode();
-    hash += Arrays.hashCode(point)^0x14fa55fb;
-    hash += numDims^0x14fa55fb;
-    hash += Objects.hashCode(bytesPerDim);
-    return hash;
-  }
-
-  @Override
-  public boolean equals(Object other) {
-    if (super.equals(other)) {
-      final ExactPointQuery q = (ExactPointQuery) other;
-      return q.numDims == numDims &&
-        q.bytesPerDim == bytesPerDim &&
-        Arrays.equals(point, q.point);
-    }
-
-    return false;
-  }
-
-  @Override
-  public String toString(String field) {
-    final StringBuilder sb = new StringBuilder();
-    sb.append(getClass().getSimpleName());
-    sb.append(':');
-    if (this.field.equals(field) == false) {
-      sb.append("field=");
-      sb.append(this.field);
-      sb.append(':');
-    }
-
-    return sb.append(" point=")
-      .append(Arrays.toString(point))
-      .toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java b/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
index 58f6d07..949cffe 100644
--- a/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
@@ -24,18 +24,22 @@ import java.util.Objects;
 import org.apache.lucene.index.PointValues;
 import org.apache.lucene.index.PointValues.IntersectVisitor;
 import org.apache.lucene.index.PointValues.Relation;
+import org.apache.lucene.document.BinaryPoint;
+import org.apache.lucene.document.DoublePoint;
+import org.apache.lucene.document.FloatPoint;
+import org.apache.lucene.document.IntPoint;
+import org.apache.lucene.document.LongPoint;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.util.DocIdSetBuilder;
 import org.apache.lucene.util.NumericUtils;
-import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.lucene.util.StringHelper;
 
 /** Searches for ranges in fields previously indexed using points e.g.
  *  {@link org.apache.lucene.document.LongPoint}.  In a 1D field this is
  *  a simple range query; in a multi-dimensional field it's a box shape. */
-
+// TODO: enhance this and add simple example
 public class PointRangeQuery extends Query {
   final String field;
   final int numDims;
@@ -46,16 +50,37 @@ public class PointRangeQuery extends Query {
   // This is null only in the "fully open range" case
   final Integer bytesPerDim;
 
-  public PointRangeQuery(String field,
+  /** 
+   * Expert: create a multidimensional range query for point values.
+   * <p>
+   * This is for subclasses and works on the underlying binary encoding: to
+   * create range queries for lucene's standard {@code Point} types, refer to these factory methods:
+   * <ul>
+   *   <li>{@link #newIntRange newIntRange()}/{@link #newMultiIntRange newMultiIntRange()} for fields indexed with {@link IntPoint}
+   *   <li>{@link #newIntRange newLongRange()}/{@link #newMultiIntRange newMultiLongRange()} for fields indexed with {@link LongPoint}
+   *   <li>{@link #newIntRange newFloatRange()}/{@link #newMultiIntRange newMultiFloatRange()} for fields indexed with {@link FloatPoint}
+   *   <li>{@link #newIntRange newDoubleRange()}/{@link #newMultiIntRange newMultiDoubleRange()} for fields indexed with {@link DoublePoint}
+   *   <li>{@link #newIntRange newBinaryRange()}/{@link #newMultiIntRange newMultiBinaryRange()} for fields indexed with {@link BinaryPoint}
+   * </ul>
+   * <p>
+   * You can have half-open ranges (which are in fact &lt;/&le; or &gt;/&ge; queries)
+   * by setting a {@code lowerValue} element or {@code upperValue} element to {@code null}. 
+   * <p>
+   * By setting a dimension's inclusive ({@code lowerInclusive} or {@code upperInclusive}) to false, it will
+   * match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param lowerPoint lower portion of the range. {@code null} values mean "open" for that dimension.
+   * @param lowerInclusive {@code true} if the lower portion of the range is inclusive, {@code false} if it should be excluded.
+   * @param upperPoint upper portion of the range. {@code null} values mean "open" for that dimension.
+   * @param upperInclusive {@code true} if the upper portion of the range is inclusive, {@code false} if it should be excluded.
+   * @throws IllegalArgumentException if {@code field} is null, or if {@code lowerValue.length != upperValue.length}
+   */
+  protected PointRangeQuery(String field,
                          byte[][] lowerPoint, boolean[] lowerInclusive,
                          byte[][] upperPoint, boolean[] upperInclusive) {
+    checkArgs(field, lowerPoint, upperPoint);
     this.field = field;
-    if (lowerPoint == null) {
-      throw new IllegalArgumentException("lowerPoint must not be null");
-    }
-    if (upperPoint == null) {
-      throw new IllegalArgumentException("upperPoint must not be null");
-    }
     numDims = lowerPoint.length;
     if (upperPoint.length != numDims) {
       throw new IllegalArgumentException("lowerPoint has length=" + numDims + " but upperPoint has different length=" + upperPoint.length);
@@ -91,69 +116,361 @@ public class PointRangeQuery extends Query {
     }
   }
 
-  /** Use in the 1D case when you indexed 1D int values using {@link org.apache.lucene.document.IntPoint} */
-  public static PointRangeQuery new1DIntRange(String field, Integer lowerValue, boolean lowerInclusive, Integer upperValue, boolean upperInclusive) {
-    return new PointRangeQuery(field, pack(lowerValue), new boolean[] {lowerInclusive}, pack(upperValue), new boolean[] {upperInclusive});
+  /** Check preconditions for all factory methods */
+  private static void checkArgs(String field, Object lowerPoint, Object upperPoint) {
+    if (field == null) {
+      throw new IllegalArgumentException("field must not be null");
+    }
+    if (lowerPoint == null) {
+      throw new IllegalArgumentException("lowerPoint must not be null");
+    }
+    if (upperPoint == null) {
+      throw new IllegalArgumentException("upperPoint must not be null");
+    }
   }
 
-  /** Use in the 1D case when you indexed 1D long values using {@link org.apache.lucene.document.LongPoint} */
-  public static PointRangeQuery new1DLongRange(String field, Long lowerValue, boolean lowerInclusive, Long upperValue, boolean upperInclusive) {
-    return new PointRangeQuery(field, pack(lowerValue), new boolean[] {lowerInclusive}, pack(upperValue), new boolean[] {upperInclusive});
+  /** 
+   * Create a range query for matching an exact integer value.
+   * <p>
+   * This is for simple one-dimension points, for multidimensional points use
+   * {@link #newMultiIntRange newMultiIntRange()} instead.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param value exact value
+   * @throws IllegalArgumentException if {@code field} is null.
+   * @return a query matching documents with this exact value
+   */
+  public static PointRangeQuery newIntExact(String field, int value) {
+    return newIntRange(field, value, true, value, true);
   }
 
-  /** Use in the 1D case when you indexed 1D float values using {@link org.apache.lucene.document.FloatPoint} */
-  public static PointRangeQuery new1DFloatRange(String field, Float lowerValue, boolean lowerInclusive, Float upperValue, boolean upperInclusive) {
-    return new PointRangeQuery(field, pack(lowerValue), new boolean[] {lowerInclusive}, pack(upperValue), new boolean[] {upperInclusive});
+  /** 
+   * Create a range query for integer values indexed with {@link IntPoint}.
+   * <p>
+   * This is for simple one-dimension ranges, for multidimensional ranges use
+   * {@link #newMultiIntRange newMultiIntRange()} instead.
+   * <p>
+   * You can have half-open ranges (which are in fact &lt;/&le; or &gt;/&ge; queries)
+   * by setting the {@code lowerValue} or {@code upperValue} to {@code null}. 
+   * <p>
+   * By setting inclusive ({@code lowerInclusive} or {@code upperInclusive}) to false, it will
+   * match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param lowerValue lower portion of the range. {@code null} means "open".
+   * @param lowerInclusive {@code true} if the lower portion of the range is inclusive, {@code false} if it should be excluded.
+   * @param upperValue upper portion of the range. {@code null} means "open".
+   * @param upperInclusive {@code true} if the upper portion of the range is inclusive, {@code false} if it should be excluded.
+   * @throws IllegalArgumentException if {@code field} is null.
+   * @return a query matching documents within this range.
+   */
+  public static PointRangeQuery newIntRange(String field, Integer lowerValue, boolean lowerInclusive, Integer upperValue, boolean upperInclusive) {
+    return newMultiIntRange(field, 
+                            new Integer[] { lowerValue },
+                            new boolean[] { lowerInclusive }, 
+                            new Integer[] { upperValue },
+                            new boolean[] { upperInclusive });
   }
 
-  /** Use in the 1D case when you indexed 1D double values using {@link org.apache.lucene.document.DoublePoint} */
-  public static PointRangeQuery new1DDoubleRange(String field, Double lowerValue, boolean lowerInclusive, Double upperValue, boolean upperInclusive) {
-    return new PointRangeQuery(field, pack(lowerValue), new boolean[] {lowerInclusive}, pack(upperValue), new boolean[] {upperInclusive});
+  /** 
+   * Create a multidimensional range query for integer values indexed with {@link IntPoint}.
+   * <p>
+   * You can have half-open ranges (which are in fact &lt;/&le; or &gt;/&ge; queries)
+   * by setting a {@code lowerValue} element or {@code upperValue} element to {@code null}. 
+   * <p>
+   * By setting a dimension's inclusive ({@code lowerInclusive} or {@code upperInclusive}) to false, it will
+   * match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param lowerValue lower portion of the range. {@code null} values mean "open" for that dimension.
+   * @param lowerInclusive {@code true} if the lower portion of the range is inclusive, {@code false} if it should be excluded.
+   * @param upperValue upper portion of the range. {@code null} values mean "open" for that dimension.
+   * @param upperInclusive {@code true} if the upper portion of the range is inclusive, {@code false} if it should be excluded.
+   * @throws IllegalArgumentException if {@code field} is null, or if {@code lowerValue.length != upperValue.length}
+   * @return a query matching documents within this range.
+   */
+  public static PointRangeQuery newMultiIntRange(String field, Integer[] lowerValue, boolean lowerInclusive[], Integer[] upperValue, boolean upperInclusive[]) {
+    checkArgs(field, lowerValue, upperValue);
+    return new PointRangeQuery(field, IntPoint.encode(lowerValue), lowerInclusive, IntPoint.encode(upperValue), upperInclusive) {
+      @Override
+      protected String toString(byte[] value) {
+        return IntPoint.decodeDimension(value).toString();
+      }
+    };
   }
 
-  /** Use in the 1D case when you indexed binary values using {@link org.apache.lucene.document.BinaryPoint} */
-  public static PointRangeQuery new1DBinaryRange(String field, byte[] lowerValue, boolean lowerInclusive, byte[] upperValue, boolean upperInclusive) {
-    return new PointRangeQuery(field, new byte[][] {lowerValue}, new boolean[] {lowerInclusive}, new byte[][] {upperValue}, new boolean[] {upperInclusive});
+  /** 
+   * Create a range query for matching an exact long value.
+   * <p>
+   * This is for simple one-dimension points, for multidimensional points use
+   * {@link #newMultiLongRange newMultiLongRange()} instead.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param value exact value
+   * @throws IllegalArgumentException if {@code field} is null.
+   * @return a query matching documents with this exact value
+   */
+  public static PointRangeQuery newLongExact(String field, long value) {
+    return newLongRange(field, value, true, value, true);
   }
 
-  private static byte[][] pack(Long value) {
-    if (value == null) {
-      // OK: open ended range
-      return new byte[1][];
-    }
-    byte[][] result = new byte[][] {new byte[RamUsageEstimator.NUM_BYTES_LONG]};
-    NumericUtils.longToBytes(value, result[0], 0);
-    return result;
+  /** 
+   * Create a range query for long values indexed with {@link LongPoint}.
+   * <p>
+   * This is for simple one-dimension ranges, for multidimensional ranges use
+   * {@link #newMultiLongRange newMultiLongRange()} instead.
+   * <p>
+   * You can have half-open ranges (which are in fact &lt;/&le; or &gt;/&ge; queries)
+   * by setting the {@code lowerValue} or {@code upperValue} to {@code null}. 
+   * <p>
+   * By setting inclusive ({@code lowerInclusive} or {@code upperInclusive}) to false, it will
+   * match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param lowerValue lower portion of the range. {@code null} means "open".
+   * @param lowerInclusive {@code true} if the lower portion of the range is inclusive, {@code false} if it should be excluded.
+   * @param upperValue upper portion of the range. {@code null} means "open".
+   * @param upperInclusive {@code true} if the upper portion of the range is inclusive, {@code false} if it should be excluded.
+   * @throws IllegalArgumentException if {@code field} is null.
+   * @return a query matching documents within this range.
+   */
+  public static PointRangeQuery newLongRange(String field, Long lowerValue, boolean lowerInclusive, Long upperValue, boolean upperInclusive) {
+    return newMultiLongRange(field, 
+                             new Long[] { lowerValue },
+                             new boolean[] { lowerInclusive }, 
+                             new Long[] { upperValue },
+                             new boolean[] { upperInclusive });
   }
 
-  private static byte[][] pack(Double value) {
-    if (value == null) {
-      // OK: open ended range
-      return new byte[1][];
-    }
-    byte[][] result = new byte[][] {new byte[RamUsageEstimator.NUM_BYTES_LONG]};
-    NumericUtils.longToBytesDirect(NumericUtils.doubleToSortableLong(value), result[0], 0);
-    return result;
+  /** 
+   * Create a multidimensional range query for long values indexed with {@link LongPoint}.
+   * <p>
+   * You can have half-open ranges (which are in fact &lt;/&le; or &gt;/&ge; queries)
+   * by setting a {@code lowerValue} element or {@code upperValue} element to {@code null}. 
+   * <p>
+   * By setting a dimension's inclusive ({@code lowerInclusive} or {@code upperInclusive}) to false, it will
+   * match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param lowerValue lower portion of the range. {@code null} values mean "open" for that dimension.
+   * @param lowerInclusive {@code true} if the lower portion of the range is inclusive, {@code false} if it should be excluded.
+   * @param upperValue upper portion of the range. {@code null} values mean "open" for that dimension.
+   * @param upperInclusive {@code true} if the upper portion of the range is inclusive, {@code false} if it should be excluded.
+   * @throws IllegalArgumentException if {@code field} is null, or if {@code lowerValue.length != upperValue.length}
+   * @return a query matching documents within this range.
+   */
+  public static PointRangeQuery newMultiLongRange(String field, Long[] lowerValue, boolean lowerInclusive[], Long[] upperValue, boolean upperInclusive[]) {
+    checkArgs(field, lowerValue, upperValue);
+    return new PointRangeQuery(field, LongPoint.encode(lowerValue), lowerInclusive, LongPoint.encode(upperValue), upperInclusive) {
+      @Override
+      protected String toString(byte[] value) {
+        return LongPoint.decodeDimension(value).toString();
+      }
+    };
   }
 
-  private static byte[][] pack(Integer value) {
-    if (value == null) {
-      // OK: open ended range
-      return new byte[1][];
-    }
-    byte[][] result = new byte[][] {new byte[RamUsageEstimator.NUM_BYTES_INT]};
-    NumericUtils.intToBytes(value, result[0], 0);
-    return result;
+  /** 
+   * Create a range query for matching an exact float value.
+   * <p>
+   * This is for simple one-dimension points, for multidimensional points use
+   * {@link #newMultiFloatRange newMultiFloatRange()} instead.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param value float value
+   * @throws IllegalArgumentException if {@code field} is null.
+   * @return a query matching documents with this exact value
+   */
+  public static PointRangeQuery newFloatExact(String field, float value) {
+    return newFloatRange(field, value, true, value, true);
+  }
+  
+  /** 
+   * Create a range query for float values indexed with {@link FloatPoint}.
+   * <p>
+   * This is for simple one-dimension ranges, for multidimensional ranges use
+   * {@link #newMultiFloatRange newMultiFloatRange()} instead.
+   * <p>
+   * You can have half-open ranges (which are in fact &lt;/&le; or &gt;/&ge; queries)
+   * by setting the {@code lowerValue} or {@code upperValue} to {@code null}. 
+   * <p>
+   * By setting inclusive ({@code lowerInclusive} or {@code upperInclusive}) to false, it will
+   * match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param lowerValue lower portion of the range. {@code null} means "open".
+   * @param lowerInclusive {@code true} if the lower portion of the range is inclusive, {@code false} if it should be excluded.
+   * @param upperValue upper portion of the range. {@code null} means "open".
+   * @param upperInclusive {@code true} if the upper portion of the range is inclusive, {@code false} if it should be excluded.
+   * @throws IllegalArgumentException if {@code field} is null.
+   * @return a query matching documents within this range.
+   */
+  public static PointRangeQuery newFloatRange(String field, Float lowerValue, boolean lowerInclusive, Float upperValue, boolean upperInclusive) {
+    return newMultiFloatRange(field, 
+                            new Float[] { lowerValue },
+                            new boolean[] { lowerInclusive }, 
+                            new Float[] { upperValue },
+                            new boolean[] { upperInclusive });
   }
 
-  private static byte[][] pack(Float value) {
+  /** 
+   * Create a multidimensional range query for float values indexed with {@link FloatPoint}.
+   * <p>
+   * You can have half-open ranges (which are in fact &lt;/&le; or &gt;/&ge; queries)
+   * by setting a {@code lowerValue} element or {@code upperValue} element to {@code null}. 
+   * <p>
+   * By setting a dimension's inclusive ({@code lowerInclusive} or {@code upperInclusive}) to false, it will
+   * match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param lowerValue lower portion of the range. {@code null} values mean "open" for that dimension.
+   * @param lowerInclusive {@code true} if the lower portion of the range is inclusive, {@code false} if it should be excluded.
+   * @param upperValue upper portion of the range. {@code null} values mean "open" for that dimension.
+   * @param upperInclusive {@code true} if the upper portion of the range is inclusive, {@code false} if it should be excluded.
+   * @throws IllegalArgumentException if {@code field} is null, or if {@code lowerValue.length != upperValue.length}
+   * @return a query matching documents within this range.
+   */
+  public static PointRangeQuery newMultiFloatRange(String field, Float[] lowerValue, boolean lowerInclusive[], Float[] upperValue, boolean upperInclusive[]) {
+    checkArgs(field, lowerValue, upperValue);
+    return new PointRangeQuery(field, FloatPoint.encode(lowerValue), lowerInclusive, FloatPoint.encode(upperValue), upperInclusive) {
+      @Override
+      protected String toString(byte[] value) {
+        return FloatPoint.decodeDimension(value).toString();
+      }
+    };
+  }
+
+  /** 
+   * Create a range query for matching an exact double value.
+   * <p>
+   * This is for simple one-dimension points, for multidimensional points use
+   * {@link #newMultiDoubleRange newMultiDoubleRange()} instead.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param value double value
+   * @throws IllegalArgumentException if {@code field} is null.
+   * @return a query matching documents with this exact value
+   */
+  public static PointRangeQuery newDoubleExact(String field, double value) {
+    return newDoubleRange(field, value, true, value, true);
+  }
+  
+  /** 
+   * Create a range query for double values indexed with {@link DoublePoint}.
+   * <p>
+   * This is for simple one-dimension ranges, for multidimensional ranges use
+   * {@link #newMultiDoubleRange newMultiDoubleRange()} instead.
+   * <p>
+   * You can have half-open ranges (which are in fact &lt;/&le; or &gt;/&ge; queries)
+   * by setting the {@code lowerValue} or {@code upperValue} to {@code null}. 
+   * <p>
+   * By setting inclusive ({@code lowerInclusive} or {@code upperInclusive}) to false, it will
+   * match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param lowerValue lower portion of the range. {@code null} means "open".
+   * @param lowerInclusive {@code true} if the lower portion of the range is inclusive, {@code false} if it should be excluded.
+   * @param upperValue upper portion of the range. {@code null} means "open".
+   * @param upperInclusive {@code true} if the upper portion of the range is inclusive, {@code false} if it should be excluded.
+   * @throws IllegalArgumentException if {@code field} is null.
+   * @return a query matching documents within this range.
+   */
+  public static PointRangeQuery newDoubleRange(String field, Double lowerValue, boolean lowerInclusive, Double upperValue, boolean upperInclusive) {
+    return newMultiDoubleRange(field, 
+                            new Double[] { lowerValue },
+                            new boolean[] { lowerInclusive }, 
+                            new Double[] { upperValue },
+                            new boolean[] { upperInclusive });
+  }
+
+  /** 
+   * Create a multidimensional range query for double values indexed with {@link DoublePoint}.
+   * <p>
+   * You can have half-open ranges (which are in fact &lt;/&le; or &gt;/&ge; queries)
+   * by setting a {@code lowerValue} element or {@code upperValue} element to {@code null}. 
+   * <p>
+   * By setting a dimension's inclusive ({@code lowerInclusive} or {@code upperInclusive}) to false, it will
+   * match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param lowerValue lower portion of the range. {@code null} values mean "open" for that dimension.
+   * @param lowerInclusive {@code true} if the lower portion of the range is inclusive, {@code false} if it should be excluded.
+   * @param upperValue upper portion of the range. {@code null} values mean "open" for that dimension.
+   * @param upperInclusive {@code true} if the upper portion of the range is inclusive, {@code false} if it should be excluded.
+   * @throws IllegalArgumentException if {@code field} is null, or if {@code lowerValue.length != upperValue.length}
+   * @return a query matching documents within this range.
+   */
+  public static PointRangeQuery newMultiDoubleRange(String field, Double[] lowerValue, boolean lowerInclusive[], Double[] upperValue, boolean upperInclusive[]) {
+    checkArgs(field, lowerValue, upperValue);
+    return new PointRangeQuery(field, DoublePoint.encode(lowerValue), lowerInclusive, DoublePoint.encode(upperValue), upperInclusive) {
+      @Override
+      protected String toString(byte[] value) {
+        return DoublePoint.decodeDimension(value).toString();
+      }
+    };
+  }
+
+  /** 
+   * Create a range query for matching an exact binary value.
+   * <p>
+   * This is for simple one-dimension points, for multidimensional points use
+   * {@link #newMultiBinaryRange newMultiBinaryRange()} instead.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param value binary value
+   * @throws IllegalArgumentException if {@code field} is null or {@code value} is null
+   * @return a query matching documents with this exact value
+   */
+  public static PointRangeQuery newBinaryExact(String field, byte[] value) {
     if (value == null) {
-      // OK: open ended range
-      return new byte[1][];
+      throw new IllegalArgumentException("value cannot be null");
     }
-    byte[][] result = new byte[][] {new byte[RamUsageEstimator.NUM_BYTES_INT]};
-    NumericUtils.intToBytesDirect(NumericUtils.floatToSortableInt(value), result[0], 0);
-    return result;
+    return newBinaryRange(field, value, true, value, true);
+  }
+
+  /** 
+   * Create a range query for binary values indexed with {@link BinaryPoint}.
+   * <p>
+   * This is for simple one-dimension ranges, for multidimensional ranges use
+   * {@link #newMultiBinaryRange newMultiBinaryRange()} instead.
+   * <p>
+   * You can have half-open ranges (which are in fact &lt;/&le; or &gt;/&ge; queries)
+   * by setting the {@code lowerValue} or {@code upperValue} to {@code null}. 
+   * <p>
+   * By setting inclusive ({@code lowerInclusive} or {@code upperInclusive}) to false, it will
+   * match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param lowerValue lower portion of the range. {@code null} means "open".
+   * @param lowerInclusive {@code true} if the lower portion of the range is inclusive, {@code false} if it should be excluded.
+   * @param upperValue upper portion of the range. {@code null} means "open".
+   * @param upperInclusive {@code true} if the upper portion of the range is inclusive, {@code false} if it should be excluded.
+   * @throws IllegalArgumentException if {@code field} is null.
+   * @return a query matching documents within this range.
+   */
+  public static PointRangeQuery newBinaryRange(String field, byte[] lowerValue, boolean lowerInclusive, byte[] upperValue, boolean upperInclusive) {
+    return newMultiBinaryRange(field, new byte[][] {lowerValue}, new boolean[] {lowerInclusive}, new byte[][] {upperValue}, new boolean[] {upperInclusive});
+  }
+  
+  /** 
+   * Create a multidimensional range query for binary values indexed with {@link BinaryPoint}.
+   * <p>
+   * You can have half-open ranges (which are in fact &lt;/&le; or &gt;/&ge; queries)
+   * by setting a {@code lowerValue} element or {@code upperValue} element to {@code null}. 
+   * <p>
+   * By setting a dimension's inclusive ({@code lowerInclusive} or {@code upperInclusive}) to false, it will
+   * match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
+   *
+   * @param field field name. must not be {@code null}.
+   * @param lowerValue lower portion of the range. {@code null} values mean "open" for that dimension.
+   * @param lowerInclusive {@code true} if the lower portion of the range is inclusive, {@code false} if it should be excluded.
+   * @param upperValue upper portion of the range. {@code null} values mean "open" for that dimension.
+   * @param upperInclusive {@code true} if the upper portion of the range is inclusive, {@code false} if it should be excluded.
+   * @throws IllegalArgumentException if {@code field} is null, or if {@code lowerValue.length != upperValue.length}
+   * @return a query matching documents within this range.
+   */
+  public static PointRangeQuery newMultiBinaryRange(String field, byte[][] lowerValue, boolean[] lowerInclusive, byte[][] upperValue, boolean[] upperInclusive) {
+    checkArgs(field, lowerValue, upperValue);
+    return new PointRangeQuery(field, lowerValue, lowerInclusive, upperValue, upperInclusive);
   }
 
   @Override
@@ -330,19 +647,67 @@ public class PointRangeQuery extends Query {
   @Override
   public String toString(String field) {
     final StringBuilder sb = new StringBuilder();
-    sb.append(getClass().getSimpleName());
-    sb.append(':');
     if (this.field.equals(field) == false) {
-      sb.append("field=");
       sb.append(this.field);
       sb.append(':');
     }
 
-    return sb.append('[')
-      .append(Arrays.toString(lowerPoint))
-      .append(" TO ")
-      .append(Arrays.toString(upperPoint))
-      .append(']')
-      .toString();
+    // print ourselves as "range per dimension"
+    for (int i = 0; i < numDims; i++) {
+      if (i > 0) {
+        sb.append(',');
+      }
+
+      if (lowerInclusive[i]) {
+        sb.append('[');
+      } else {
+        sb.append('{');
+      }
+
+      if (lowerPoint[i] == null) {
+        sb.append('*');
+      } else {
+        sb.append(toString(lowerPoint[i]));
+      }
+
+      sb.append(" TO ");
+
+      if (upperPoint[i] == null) {
+        sb.append('*');
+      } else {
+        sb.append(toString(upperPoint[i]));
+      }
+
+      if (upperInclusive[i]) {
+        sb.append(']');
+      } else {
+        sb.append('}');
+      }
+    }
+
+    return sb.toString();
+  }
+
+  /**
+   * Returns a string of a single value in a human-readable format for debugging.
+   * This is used by {@link #toString()}.
+   *
+   * The default implementation encodes the individual byte values.
+   *
+   * @param value single value, never null
+   * @return human readable value for debugging
+   */
+  protected String toString(byte[] value) {
+    assert value != null;
+    StringBuilder sb = new StringBuilder();
+    sb.append("binary(");
+    for (int i = 0; i < value.length; i++) {
+      if (i > 0) {
+        sb.append(' ');
+      }
+      sb.append(Integer.toHexString(value[i] & 0xFF));
+    }
+    sb.append(')');
+    return sb.toString();
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java b/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
index 59bf1c5..9a74231 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
@@ -1352,7 +1352,7 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
         max = x;
       }
 
-      TopDocs hits = s.search(PointRangeQuery.new1DLongRange("number", min, true, max, true), 100);
+      TopDocs hits = s.search(PointRangeQuery.newLongRange("number", min, true, max, true), 100);
       for(ScoreDoc scoreDoc : hits.scoreDocs) {
         long value = Long.parseLong(s.doc(scoreDoc.doc).get("text").split(" ")[1]);
         assertTrue(value >= min);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
index 5758546..cfab5fb 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
@@ -56,7 +56,6 @@ import org.apache.lucene.index.SegmentReadState;
 import org.apache.lucene.index.SegmentWriteState;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase;
@@ -305,7 +304,7 @@ public class TestPointQueries extends LuceneTestCase {
               }
 
               if (random().nextBoolean()) {
-                query = PointRangeQuery.new1DLongRange("sn_value", lower, includeLower, upper, includeUpper);
+                query = PointRangeQuery.newLongRange("sn_value", lower, includeLower, upper, includeUpper);
               } else {
                 byte[] lowerBytes;
                 if (lower == null) {
@@ -321,7 +320,7 @@ public class TestPointQueries extends LuceneTestCase {
                   upperBytes = new byte[8];
                   NumericUtils.longToBytes(upper, upperBytes, 0);
                 }
-                query = PointRangeQuery.new1DBinaryRange("ss_value", lowerBytes, includeLower, upperBytes, includeUpper);
+                query = PointRangeQuery.newBinaryRange("ss_value", lowerBytes, includeLower, upperBytes, includeUpper);
               }
 
               if (VERBOSE) {
@@ -737,9 +736,9 @@ public class TestPointQueries extends LuceneTestCase {
 
     IndexSearcher s = newSearcher(r);
 
-    assertEquals(1, s.count(PointRangeQuery.new1DLongRange("value", Long.MIN_VALUE, true, 0L, true)));
-    assertEquals(1, s.count(PointRangeQuery.new1DLongRange("value", 0L, true, Long.MAX_VALUE, true)));
-    assertEquals(2, s.count(PointRangeQuery.new1DLongRange("value", Long.MIN_VALUE, true, Long.MAX_VALUE, true)));
+    assertEquals(1, s.count(PointRangeQuery.newLongRange("value", Long.MIN_VALUE, true, 0L, true)));
+    assertEquals(1, s.count(PointRangeQuery.newLongRange("value", 0L, true, Long.MAX_VALUE, true)));
+    assertEquals(2, s.count(PointRangeQuery.newLongRange("value", Long.MIN_VALUE, true, Long.MAX_VALUE, true)));
 
     IOUtils.close(r, w, dir);
   }
@@ -775,47 +774,47 @@ public class TestPointQueries extends LuceneTestCase {
 
     IndexSearcher s = newSearcher(r);
 
-    assertEquals(1, s.count(PointRangeQuery.new1DBinaryRange("value",
+    assertEquals(1, s.count(PointRangeQuery.newBinaryRange("value",
         toUTF8("aaa"),
         true,
         toUTF8("bbb"),
         true)));
-    assertEquals(1, s.count(PointRangeQuery.new1DBinaryRange("value",
+    assertEquals(1, s.count(PointRangeQuery.newBinaryRange("value",
         toUTF8("c", 3),
         true,
         toUTF8("e", 3),
         true)));
-    assertEquals(2, s.count(PointRangeQuery.new1DBinaryRange("value",
+    assertEquals(2, s.count(PointRangeQuery.newBinaryRange("value",
         toUTF8("a", 3),
         true,
         toUTF8("z", 3),
         true)));
-    assertEquals(1, s.count(PointRangeQuery.new1DBinaryRange("value",
+    assertEquals(1, s.count(PointRangeQuery.newBinaryRange("value",
         null,
         true,
         toUTF8("abc"),
         true)));
-    assertEquals(1, s.count(PointRangeQuery.new1DBinaryRange("value",
+    assertEquals(1, s.count(PointRangeQuery.newBinaryRange("value",
         toUTF8("a", 3),
         true,
         toUTF8("abc"),
         true)));
-    assertEquals(0, s.count(PointRangeQuery.new1DBinaryRange("value",
+    assertEquals(0, s.count(PointRangeQuery.newBinaryRange("value",
         toUTF8("a", 3),
         true,
         toUTF8("abc"),
         false)));
-    assertEquals(1, s.count(PointRangeQuery.new1DBinaryRange("value",
+    assertEquals(1, s.count(PointRangeQuery.newBinaryRange("value",
         toUTF8("def"),
         true,
         null,
         false)));
-    assertEquals(1, s.count(PointRangeQuery.new1DBinaryRange("value",
+    assertEquals(1, s.count(PointRangeQuery.newBinaryRange("value",
         toUTF8(("def")),
         true,
         toUTF8("z", 3),
         true)));
-    assertEquals(0, s.count(PointRangeQuery.new1DBinaryRange("value",
+    assertEquals(0, s.count(PointRangeQuery.newBinaryRange("value",
         toUTF8("def"),
         false,
         toUTF8("z", 3),
@@ -840,12 +839,12 @@ public class TestPointQueries extends LuceneTestCase {
 
     IndexSearcher s = newSearcher(r);
 
-    assertEquals(2, s.count(PointRangeQuery.new1DLongRange("value", Long.MIN_VALUE, true, Long.MAX_VALUE, true)));
-    assertEquals(1, s.count(PointRangeQuery.new1DLongRange("value", Long.MIN_VALUE, true, Long.MAX_VALUE, false)));
-    assertEquals(1, s.count(PointRangeQuery.new1DLongRange("value", Long.MIN_VALUE, false, Long.MAX_VALUE, true)));
-    assertEquals(0, s.count(PointRangeQuery.new1DLongRange("value", Long.MIN_VALUE, false, Long.MAX_VALUE, false)));
+    assertEquals(2, s.count(PointRangeQuery.newLongRange("value", Long.MIN_VALUE, true, Long.MAX_VALUE, true)));
+    assertEquals(1, s.count(PointRangeQuery.newLongRange("value", Long.MIN_VALUE, true, Long.MAX_VALUE, false)));
+    assertEquals(1, s.count(PointRangeQuery.newLongRange("value", Long.MIN_VALUE, false, Long.MAX_VALUE, true)));
+    assertEquals(0, s.count(PointRangeQuery.newLongRange("value", Long.MIN_VALUE, false, Long.MAX_VALUE, false)));
 
-    assertEquals(2, s.count(PointRangeQuery.new1DBinaryRange("value", (byte[]) null, true, null, true)));
+    assertEquals(2, s.count(PointRangeQuery.newBinaryRange("value", (byte[]) null, true, null, true)));
 
     IOUtils.close(r, w, dir);
   }
@@ -867,12 +866,12 @@ public class TestPointQueries extends LuceneTestCase {
     // We can't wrap with "exotic" readers because the query must see the RangeTreeDVFormat:
     IndexSearcher s = newSearcher(r, false);
 
-    assertEquals(2, s.count(PointRangeQuery.new1DLongRange("value", Long.MIN_VALUE, true, Long.MAX_VALUE, true)));
-    assertEquals(1, s.count(PointRangeQuery.new1DLongRange("value", Long.MIN_VALUE, true, Long.MAX_VALUE, false)));
-    assertEquals(1, s.count(PointRangeQuery.new1DLongRange("value", Long.MIN_VALUE, false, Long.MAX_VALUE, true)));
-    assertEquals(0, s.count(PointRangeQuery.new1DLongRange("value", Long.MIN_VALUE, false, Long.MAX_VALUE, false)));
+    assertEquals(2, s.count(PointRangeQuery.newLongRange("value", Long.MIN_VALUE, true, Long.MAX_VALUE, true)));
+    assertEquals(1, s.count(PointRangeQuery.newLongRange("value", Long.MIN_VALUE, true, Long.MAX_VALUE, false)));
+    assertEquals(1, s.count(PointRangeQuery.newLongRange("value", Long.MIN_VALUE, false, Long.MAX_VALUE, true)));
+    assertEquals(0, s.count(PointRangeQuery.newLongRange("value", Long.MIN_VALUE, false, Long.MAX_VALUE, false)));
 
-    assertEquals(2, s.count(PointRangeQuery.new1DLongRange("value", (Long) null, true, null, true)));
+    assertEquals(2, s.count(PointRangeQuery.newLongRange("value", (Long) null, true, null, true)));
 
     IOUtils.close(r, w, dir);
   }
@@ -892,9 +891,9 @@ public class TestPointQueries extends LuceneTestCase {
     IndexReader r = w.getReader();
 
     IndexSearcher s = newSearcher(r);
-    assertEquals(0, s.count(PointRangeQuery.new1DBinaryRange("value", toUTF8("m"), true, toUTF8("n"), false)));
+    assertEquals(0, s.count(PointRangeQuery.newBinaryRange("value", toUTF8("m"), true, toUTF8("n"), false)));
 
-    assertEquals(2, s.count(PointRangeQuery.new1DBinaryRange("value", (byte[]) null, true, null, true)));
+    assertEquals(2, s.count(PointRangeQuery.newBinaryRange("value", (byte[]) null, true, null, true)));
 
     IOUtils.close(r, w, dir);
   }
@@ -914,7 +913,7 @@ public class TestPointQueries extends LuceneTestCase {
     IndexReader r = w.getReader();
 
     IndexSearcher s = new IndexSearcher(r);
-    assertEquals(0, s.count(PointRangeQuery.new1DLongRange("value", 17L, true, 13L, false)));
+    assertEquals(0, s.count(PointRangeQuery.newLongRange("value", 17L, true, 13L, false)));
 
     IOUtils.close(r, w, dir);
   }
@@ -929,7 +928,7 @@ public class TestPointQueries extends LuceneTestCase {
     IndexReader r = w.getReader();
 
     IndexSearcher s = newSearcher(r);
-    assertEquals(0, s.count(PointRangeQuery.new1DLongRange("value", 17L, true, 13L, false)));
+    assertEquals(0, s.count(PointRangeQuery.newLongRange("value", 17L, true, 13L, false)));
 
     IOUtils.close(r, w, dir);
   }
@@ -1045,7 +1044,7 @@ public class TestPointQueries extends LuceneTestCase {
     }
   }
 
-  public void testExactPointQuery() throws Exception {
+  public void testExactPoints() throws Exception {
     Directory dir = newDirectory();
     IndexWriterConfig iwc = newIndexWriterConfig();
     iwc.setCodec(getCodec());
@@ -1069,19 +1068,50 @@ public class TestPointQueries extends LuceneTestCase {
 
     IndexReader r = DirectoryReader.open(w);
     IndexSearcher s = newSearcher(r);
-    assertEquals(1, s.count(ExactPointQuery.new1DIntExact("int", 42)));
-    assertEquals(0, s.count(ExactPointQuery.new1DIntExact("int", 41)));
+    assertEquals(1, s.count(PointRangeQuery.newIntExact("int", 42)));
+    assertEquals(0, s.count(PointRangeQuery.newIntExact("int", 41)));
 
-    assertEquals(1, s.count(ExactPointQuery.new1DLongExact("long", 5L)));
-    assertEquals(0, s.count(ExactPointQuery.new1DLongExact("long", -1L)));
+    assertEquals(1, s.count(PointRangeQuery.newLongExact("long", 5L)));
+    assertEquals(0, s.count(PointRangeQuery.newLongExact("long", -1L)));
 
-    assertEquals(1, s.count(ExactPointQuery.new1DFloatExact("float", 2.0f)));
-    assertEquals(0, s.count(ExactPointQuery.new1DFloatExact("float", 1.0f)));
+    assertEquals(1, s.count(PointRangeQuery.newFloatExact("float", 2.0f)));
+    assertEquals(0, s.count(PointRangeQuery.newFloatExact("float", 1.0f)));
 
-    assertEquals(1, s.count(ExactPointQuery.new1DDoubleExact("double", 1.0)));
-    assertEquals(0, s.count(ExactPointQuery.new1DDoubleExact("double", 2.0)));
+    assertEquals(1, s.count(PointRangeQuery.newDoubleExact("double", 1.0)));
+    assertEquals(0, s.count(PointRangeQuery.newDoubleExact("double", 2.0)));
     w.close();
     r.close();
     dir.close();
   }
+
+  public void testToString() throws Exception {
+    
+    // ints
+    assertEquals("field:[1 TO 2}", PointRangeQuery.newIntRange("field", 1, true, 2, false).toString());
+    assertEquals("field:{-2 TO 1]", PointRangeQuery.newIntRange("field", -2, false, 1, true).toString());
+    assertEquals("field:[* TO 2}", PointRangeQuery.newIntRange("field", null, true, 2, false).toString());
+
+    // longs
+    assertEquals("field:[1099511627776 TO 2199023255552}", PointRangeQuery.newLongRange("field", 1L<<40, true, 1L<<41, false).toString());
+    assertEquals("field:{-5 TO 6]", PointRangeQuery.newLongRange("field", -5L, false, 6L, true).toString());
+    assertEquals("field:[* TO 2}", PointRangeQuery.newLongRange("field", null, true, 2L, false).toString());
+    
+    // floats
+    assertEquals("field:[1.3 TO 2.5}", PointRangeQuery.newFloatRange("field", 1.3F, true, 2.5F, false).toString());
+    assertEquals("field:{-2.9 TO 1.0]", PointRangeQuery.newFloatRange("field", -2.9F, false, 1.0F, true).toString());
+    assertEquals("field:{-2.9 TO *]", PointRangeQuery.newFloatRange("field", -2.9F, false, null, true).toString());
+    
+    // doubles
+    assertEquals("field:[1.3 TO 2.5}", PointRangeQuery.newDoubleRange("field", 1.3, true, 2.5, false).toString());
+    assertEquals("field:{-2.9 TO 1.0]", PointRangeQuery.newDoubleRange("field", -2.9, false, 1.0, true).toString());
+    assertEquals("field:{-2.9 TO *]", PointRangeQuery.newDoubleRange("field", -2.9, false, null, true).toString());
+    
+    // n-dimensional double
+    assertEquals("field:[1.3 TO 2.5},{-2.9 TO 1.0]", PointRangeQuery.newMultiDoubleRange("field", 
+                                                                      new Double[] { 1.3, -2.9 }, 
+                                                                      new boolean[] { true, false }, 
+                                                                      new Double[] { 2.5, 1.0 },
+                                                                      new boolean[] { false, true }).toString());
+
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/core/src/test/org/apache/lucene/search/TestUsageTrackingFilterCachingPolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestUsageTrackingFilterCachingPolicy.java b/lucene/core/src/test/org/apache/lucene/search/TestUsageTrackingFilterCachingPolicy.java
index 33c9458..323351e 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestUsageTrackingFilterCachingPolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestUsageTrackingFilterCachingPolicy.java
@@ -26,7 +26,7 @@ public class TestUsageTrackingFilterCachingPolicy extends LuceneTestCase {
 
   public void testCostlyFilter() {
     assertTrue(UsageTrackingQueryCachingPolicy.isCostly(new PrefixQuery(new Term("field", "prefix"))));
-    assertTrue(UsageTrackingQueryCachingPolicy.isCostly(PointRangeQuery.new1DIntRange("intField", 1, true, 1000, true)));
+    assertTrue(UsageTrackingQueryCachingPolicy.isCostly(PointRangeQuery.newIntRange("intField", 1, true, 1000, true)));
     assertFalse(UsageTrackingQueryCachingPolicy.isCostly(new TermQuery(new Term("field", "value"))));
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/demo/src/java/org/apache/lucene/demo/facet/DistanceFacetsExample.java
----------------------------------------------------------------------
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/DistanceFacetsExample.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/DistanceFacetsExample.java
index bf3f185..083e41c 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/DistanceFacetsExample.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/DistanceFacetsExample.java
@@ -181,7 +181,7 @@ public class DistanceFacetsExample implements Closeable {
     BooleanQuery.Builder f = new BooleanQuery.Builder();
 
     // Add latitude range filter:
-    f.add(PointRangeQuery.new1DDoubleRange("latitude", Math.toDegrees(minLat), true, Math.toDegrees(maxLat), true),
+    f.add(PointRangeQuery.newDoubleRange("latitude", Math.toDegrees(minLat), true, Math.toDegrees(maxLat), true),
           BooleanClause.Occur.FILTER);
 
     // Add longitude range filter:
@@ -189,13 +189,13 @@ public class DistanceFacetsExample implements Closeable {
       // The bounding box crosses the international date
       // line:
       BooleanQuery.Builder lonF = new BooleanQuery.Builder();
-      lonF.add(PointRangeQuery.new1DDoubleRange("longitude", Math.toDegrees(minLng), true, null, true),
+      lonF.add(PointRangeQuery.newDoubleRange("longitude", Math.toDegrees(minLng), true, null, true),
                BooleanClause.Occur.SHOULD);
-      lonF.add(PointRangeQuery.new1DDoubleRange("longitude", null, true, Math.toDegrees(maxLng), true),
+      lonF.add(PointRangeQuery.newDoubleRange("longitude", null, true, Math.toDegrees(maxLng), true),
                BooleanClause.Occur.SHOULD);
       f.add(lonF.build(), BooleanClause.Occur.MUST);
     } else {
-      f.add(PointRangeQuery.new1DDoubleRange("longitude", Math.toDegrees(minLng), true, Math.toDegrees(maxLng), true),
+      f.add(PointRangeQuery.newDoubleRange("longitude", Math.toDegrees(minLng), true, Math.toDegrees(maxLng), true),
             BooleanClause.Occur.FILTER);
     }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/demo/src/java/org/apache/lucene/demo/facet/RangeFacetsExample.java
----------------------------------------------------------------------
diff --git a/lucene/demo/src/java/org/apache/lucene/demo/facet/RangeFacetsExample.java b/lucene/demo/src/java/org/apache/lucene/demo/facet/RangeFacetsExample.java
index cbc19b8..1a7a984 100644
--- a/lucene/demo/src/java/org/apache/lucene/demo/facet/RangeFacetsExample.java
+++ b/lucene/demo/src/java/org/apache/lucene/demo/facet/RangeFacetsExample.java
@@ -107,7 +107,7 @@ public class RangeFacetsExample implements Closeable {
     // documents ("browse only"):
     DrillDownQuery q = new DrillDownQuery(getConfig());
 
-    q.add("timestamp", PointRangeQuery.new1DLongRange("timestamp", range.min, range.minInclusive, range.max, range.maxInclusive));
+    q.add("timestamp", PointRangeQuery.newLongRange("timestamp", range.min, range.minInclusive, range.max, range.maxInclusive));
 
     return searcher.search(q, 10);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java b/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
index 7d154b3..87f0579 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
@@ -281,7 +281,7 @@ public class TestRangeFacetCounts extends FacetTestCase {
 
     // Third search, drill down on "less than or equal to 10":
     ddq = new DrillDownQuery(config);
-    ddq.add("field", PointRangeQuery.new1DLongRange("field", 0L, true, 10L, true));
+    ddq.add("field", PointRangeQuery.newLongRange("field", 0L, true, 10L, true));
     dsr = ds.search(null, ddq, 10);
 
     assertEquals(11, dsr.hits.totalHits);
@@ -461,9 +461,9 @@ public class TestRangeFacetCounts extends FacetTestCase {
       Query fastMatchQuery;
       if (random().nextBoolean()) {
         if (random().nextBoolean()) {
-          fastMatchQuery = PointRangeQuery.new1DLongRange("field", minValue, true, maxValue, true);
+          fastMatchQuery = PointRangeQuery.newLongRange("field", minValue, true, maxValue, true);
         } else {
-          fastMatchQuery = PointRangeQuery.new1DLongRange("field", minAcceptedValue, true, maxAcceptedValue, true);
+          fastMatchQuery = PointRangeQuery.newLongRange("field", minAcceptedValue, true, maxAcceptedValue, true);
         }
       } else {
         fastMatchQuery = null;
@@ -485,7 +485,7 @@ public class TestRangeFacetCounts extends FacetTestCase {
         // Test drill-down:
         DrillDownQuery ddq = new DrillDownQuery(config);
         if (random().nextBoolean()) {
-          ddq.add("field", PointRangeQuery.new1DLongRange("field", range.min, range.minInclusive, range.max, range.maxInclusive));
+          ddq.add("field", PointRangeQuery.newLongRange("field", range.min, range.minInclusive, range.max, range.maxInclusive));
         } else {
           ddq.add("field", range.getQuery(fastMatchQuery, vs));
         }
@@ -616,9 +616,9 @@ public class TestRangeFacetCounts extends FacetTestCase {
       Query fastMatchQuery;
       if (random().nextBoolean()) {
         if (random().nextBoolean()) {
-          fastMatchQuery = PointRangeQuery.new1DFloatRange("field", minValue, true, maxValue, true);
+          fastMatchQuery = PointRangeQuery.newFloatRange("field", minValue, true, maxValue, true);
         } else {
-          fastMatchQuery = PointRangeQuery.new1DFloatRange("field", minAcceptedValue, true, maxAcceptedValue, true);
+          fastMatchQuery = PointRangeQuery.newFloatRange("field", minAcceptedValue, true, maxAcceptedValue, true);
         }
       } else {
         fastMatchQuery = null;
@@ -640,7 +640,7 @@ public class TestRangeFacetCounts extends FacetTestCase {
         // Test drill-down:
         DrillDownQuery ddq = new DrillDownQuery(config);
         if (random().nextBoolean()) {
-          ddq.add("field", PointRangeQuery.new1DFloatRange("field", (float) range.min, range.minInclusive, (float) range.max, range.maxInclusive));
+          ddq.add("field", PointRangeQuery.newFloatRange("field", (float) range.min, range.minInclusive, (float) range.max, range.maxInclusive));
         } else {
           ddq.add("field", range.getQuery(fastMatchQuery, vs));
         }
@@ -755,9 +755,9 @@ public class TestRangeFacetCounts extends FacetTestCase {
       Query fastMatchFilter;
       if (random().nextBoolean()) {
         if (random().nextBoolean()) {
-          fastMatchFilter = PointRangeQuery.new1DDoubleRange("field", minValue, true, maxValue, true);
+          fastMatchFilter = PointRangeQuery.newDoubleRange("field", minValue, true, maxValue, true);
         } else {
-          fastMatchFilter = PointRangeQuery.new1DDoubleRange("field", minAcceptedValue, true, maxAcceptedValue, true);
+          fastMatchFilter = PointRangeQuery.newDoubleRange("field", minAcceptedValue, true, maxAcceptedValue, true);
         }
       } else {
         fastMatchFilter = null;
@@ -779,7 +779,7 @@ public class TestRangeFacetCounts extends FacetTestCase {
         // Test drill-down:
         DrillDownQuery ddq = new DrillDownQuery(config);
         if (random().nextBoolean()) {
-          ddq.add("field", PointRangeQuery.new1DDoubleRange("field", range.min, range.minInclusive, range.max, range.maxInclusive));
+          ddq.add("field", PointRangeQuery.newDoubleRange("field", range.min, range.minInclusive, range.max, range.maxInclusive));
         } else {
           ddq.add("field", range.getQuery(fastMatchFilter, vs));
         }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
----------------------------------------------------------------------
diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
index 26ad755..58f1eb9 100644
--- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
+++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
@@ -584,7 +584,7 @@ public class HighlighterTest extends BaseTokenStreamTestCase implements Formatte
   
   public void testDimensionalRangeQuery() throws Exception {
     // doesn't currently highlight, but make sure it doesn't cause exception either
-    query = PointRangeQuery.new1DIntRange(NUMERIC_FIELD_NAME, 2, true, 6, true);
+    query = PointRangeQuery.newIntRange(NUMERIC_FIELD_NAME, 2, true, 6, true);
     searcher = newSearcher(reader);
     hits = searcher.search(query, 100);
     int maxNumFragmentsRequired = 2;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java b/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java
index 7960ce0..7e23aad 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java
@@ -57,7 +57,7 @@ public class TestDocValuesRangeQuery extends LuceneTestCase {
         iw.addDocument(doc);
       }
       if (random().nextBoolean()) {
-        iw.deleteDocuments(PointRangeQuery.new1DLongRange("idx", 0L, true, 10L, true));
+        iw.deleteDocuments(PointRangeQuery.newLongRange("idx", 0L, true, 10L, true));
       }
       iw.commit();
       final IndexReader reader = iw.getReader();
@@ -69,7 +69,7 @@ public class TestDocValuesRangeQuery extends LuceneTestCase {
         final Long max = random().nextBoolean() ? null : TestUtil.nextLong(random(), -100, 1000);
         final boolean minInclusive = random().nextBoolean();
         final boolean maxInclusive = random().nextBoolean();
-        final Query q1 = PointRangeQuery.new1DLongRange("idx", min, minInclusive, max, maxInclusive);
+        final Query q1 = PointRangeQuery.newLongRange("idx", min, minInclusive, max, maxInclusive);
         final Query q2 = DocValuesRangeQuery.newLongRange("dv", min, max, minInclusive, maxInclusive);
         assertSameMatches(searcher, q1, q2, false);
       }
@@ -185,7 +185,7 @@ public class TestDocValuesRangeQuery extends LuceneTestCase {
       iw.addDocument(doc);
     }
     if (random().nextBoolean()) {
-      iw.deleteDocuments(PointRangeQuery.new1DLongRange("idx", 0L, true, 10L, true));
+      iw.deleteDocuments(PointRangeQuery.newLongRange("idx", 0L, true, 10L, true));
     }
     iw.commit();
     final IndexReader reader = iw.getReader();
@@ -199,7 +199,7 @@ public class TestDocValuesRangeQuery extends LuceneTestCase {
       final boolean maxInclusive = random().nextBoolean();
 
       BooleanQuery.Builder ref = new BooleanQuery.Builder();
-      ref.add(PointRangeQuery.new1DLongRange("idx", min, minInclusive, max, maxInclusive), Occur.FILTER);
+      ref.add(PointRangeQuery.newLongRange("idx", min, minInclusive, max, maxInclusive), Occur.FILTER);
       ref.add(new TermQuery(new Term("f", "a")), Occur.MUST);
 
       BooleanQuery.Builder bq1 = new BooleanQuery.Builder();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
index 3d2759d..05f38bb 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
@@ -302,7 +302,7 @@ public class TestSuggestField extends LuceneTestCase {
       }
     }
 
-    iw.deleteDocuments(PointRangeQuery.new1DIntRange("weight_fld", 2, true, null, false));
+    iw.deleteDocuments(PointRangeQuery.newIntRange("weight_fld", 2, true, null, false));
 
     DirectoryReader reader = DirectoryReader.open(iw);
     SuggestIndexSearcher indexSearcher = new SuggestIndexSearcher(reader);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/54a544b3/lucene/test-framework/src/java/org/apache/lucene/index/BasePointFormatTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BasePointFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BasePointFormatTestCase.java
index 653fc33..99f8f89 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BasePointFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BasePointFormatTestCase.java
@@ -33,8 +33,8 @@ import org.apache.lucene.document.NumericDocValuesField;
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.index.PointValues.IntersectVisitor;
 import org.apache.lucene.index.PointValues.Relation;
-import org.apache.lucene.search.ExactPointQuery;
 import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.PointRangeQuery;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.util.Bits;
@@ -847,8 +847,8 @@ public abstract class BasePointFormatTestCase extends BaseIndexFileFormatTestCas
 
     DirectoryReader r = w.getReader();
     IndexSearcher s = newSearcher(r);
-    assertEquals(2, s.count(ExactPointQuery.new1DIntExact("int1", 17)));
-    assertEquals(2, s.count(ExactPointQuery.new1DIntExact("int2", 42)));
+    assertEquals(2, s.count(PointRangeQuery.newIntExact("int1", 17)));
+    assertEquals(2, s.count(PointRangeQuery.newIntExact("int2", 42)));
     r.close();
     w.close();
     dir.close();


[32/53] [abbrv] lucene-solr git commit: SOLR-8711: Upgrade Carrot2 clustering dependency to 3.12.0 SOLR-8710: Upgrade morfologik-stemming to version 2.1.0 LUCENE-7040: Upgrade morfologik-stemming to version 2.1.0

Posted by no...@apache.org.
SOLR-8711: Upgrade Carrot2 clustering dependency to 3.12.0
SOLR-8710: Upgrade morfologik-stemming to version 2.1.0
LUCENE-7040: Upgrade morfologik-stemming to version 2.1.0


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ed90697d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ed90697d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ed90697d

Branch: refs/heads/apiv2
Commit: ed90697dd2db5233b46cbf6902a7186538864102
Parents: b14fb50
Author: Dawid Weiss <da...@carrotsearch.com>
Authored: Mon Feb 22 18:23:50 2016 +0100
Committer: Dawid Weiss <da...@carrotsearch.com>
Committed: Mon Feb 22 18:23:50 2016 +0100

----------------------------------------------------------------------
 lucene/CHANGES.txt                                  |  3 +++
 lucene/ivy-versions.properties                      |  4 ++--
 lucene/licenses/morfologik-fsa-2.0.1.jar.sha1       |  1 -
 lucene/licenses/morfologik-fsa-2.1.0.jar.sha1       |  1 +
 lucene/licenses/morfologik-fsa-LICENSE-BSD.txt      |  2 +-
 lucene/licenses/morfologik-polish-2.0.1.jar.sha1    |  1 -
 lucene/licenses/morfologik-polish-2.1.0.jar.sha1    |  1 +
 lucene/licenses/morfologik-polish-LICENSE-BSD.txt   | 16 +++++++++-------
 lucene/licenses/morfologik-stemming-2.0.1.jar.sha1  |  1 -
 lucene/licenses/morfologik-stemming-2.1.0.jar.sha1  |  1 +
 lucene/licenses/morfologik-stemming-LICENSE-BSD.txt |  2 +-
 solr/CHANGES.txt                                    |  6 +++++-
 solr/licenses/carrot2-mini-3.10.4.jar.sha1          |  1 -
 solr/licenses/carrot2-mini-3.12.0.jar.sha1          |  1 +
 solr/licenses/morfologik-fsa-2.0.1.jar.sha1         |  1 -
 solr/licenses/morfologik-fsa-2.1.0.jar.sha1         |  1 +
 solr/licenses/morfologik-fsa-LICENSE-BSD.txt        |  2 +-
 solr/licenses/morfologik-polish-2.0.1.jar.sha1      |  1 -
 solr/licenses/morfologik-polish-2.1.0.jar.sha1      |  1 +
 solr/licenses/morfologik-polish-LICENSE-BSD.txt     | 16 +++++++++-------
 solr/licenses/morfologik-stemming-2.0.1.jar.sha1    |  1 -
 solr/licenses/morfologik-stemming-2.1.0.jar.sha1    |  1 +
 solr/licenses/morfologik-stemming-LICENSE-BSD.txt   |  2 +-
 23 files changed, 39 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 9df0150..9794611 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -64,6 +64,9 @@ New Features
 * LUCENE-6989: Add preliminary support for MMapDirectory unmapping in Java 9.
   (Uwe Schindler, Chris Hegarty, Peter Levart)
 
+* LUCENE-7040: Upgrade morfologik-stemming to version 2.1.0.
+  (Dawid Weiss)
+
 API Changes
 
 * LUCENE-6067: Accountable.getChildResources has a default

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/lucene/ivy-versions.properties
----------------------------------------------------------------------
diff --git a/lucene/ivy-versions.properties b/lucene/ivy-versions.properties
index 1f832e9..0c2808b 100644
--- a/lucene/ivy-versions.properties
+++ b/lucene/ivy-versions.properties
@@ -213,9 +213,9 @@ org.bouncycastle.version = 1.45
 /org.carrot2.attributes/attributes-binder = 1.2.3
 /org.carrot2.shaded/carrot2-guava = 18.0
 
-/org.carrot2/carrot2-mini = 3.10.4
+/org.carrot2/carrot2-mini = 3.12.0
 
-org.carrot2.morfologik.version = 2.0.1
+org.carrot2.morfologik.version = 2.1.0
 /org.carrot2/morfologik-fsa = ${org.carrot2.morfologik.version}
 /org.carrot2/morfologik-polish = ${org.carrot2.morfologik.version}
 /org.carrot2/morfologik-stemming = ${org.carrot2.morfologik.version}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/lucene/licenses/morfologik-fsa-2.0.1.jar.sha1
----------------------------------------------------------------------
diff --git a/lucene/licenses/morfologik-fsa-2.0.1.jar.sha1 b/lucene/licenses/morfologik-fsa-2.0.1.jar.sha1
deleted file mode 100644
index 2d5f0a7..0000000
--- a/lucene/licenses/morfologik-fsa-2.0.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-23b4c04bb74f80e77573dc3ab84c8b4203f68d50

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/lucene/licenses/morfologik-fsa-2.1.0.jar.sha1
----------------------------------------------------------------------
diff --git a/lucene/licenses/morfologik-fsa-2.1.0.jar.sha1 b/lucene/licenses/morfologik-fsa-2.1.0.jar.sha1
new file mode 100644
index 0000000..42c0fb3
--- /dev/null
+++ b/lucene/licenses/morfologik-fsa-2.1.0.jar.sha1
@@ -0,0 +1 @@
+88e5993f73c102f378c711f6e47221b7a9e22d25

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/lucene/licenses/morfologik-fsa-LICENSE-BSD.txt
----------------------------------------------------------------------
diff --git a/lucene/licenses/morfologik-fsa-LICENSE-BSD.txt b/lucene/licenses/morfologik-fsa-LICENSE-BSD.txt
index 31ebad0..635227a 100644
--- a/lucene/licenses/morfologik-fsa-LICENSE-BSD.txt
+++ b/lucene/licenses/morfologik-fsa-LICENSE-BSD.txt
@@ -1,6 +1,6 @@
 
 Copyright (c) 2006 Dawid Weiss
-Copyright (c) 2007-2015 Dawid Weiss, Marcin Miłkowski
+Copyright (c) 2007-2016 Dawid Weiss, Marcin Miłkowski
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification, 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/lucene/licenses/morfologik-polish-2.0.1.jar.sha1
----------------------------------------------------------------------
diff --git a/lucene/licenses/morfologik-polish-2.0.1.jar.sha1 b/lucene/licenses/morfologik-polish-2.0.1.jar.sha1
deleted file mode 100644
index 4647d1c..0000000
--- a/lucene/licenses/morfologik-polish-2.0.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-b35034de153a79d0afeeeee2ff883d548a178961

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/lucene/licenses/morfologik-polish-2.1.0.jar.sha1
----------------------------------------------------------------------
diff --git a/lucene/licenses/morfologik-polish-2.1.0.jar.sha1 b/lucene/licenses/morfologik-polish-2.1.0.jar.sha1
new file mode 100644
index 0000000..7f8b4c2
--- /dev/null
+++ b/lucene/licenses/morfologik-polish-2.1.0.jar.sha1
@@ -0,0 +1 @@
+d5a9c7721bce2ef17444abbe25ac2e65bfaa181f

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/lucene/licenses/morfologik-polish-LICENSE-BSD.txt
----------------------------------------------------------------------
diff --git a/lucene/licenses/morfologik-polish-LICENSE-BSD.txt b/lucene/licenses/morfologik-polish-LICENSE-BSD.txt
index 660f633..f0af542 100644
--- a/lucene/licenses/morfologik-polish-LICENSE-BSD.txt
+++ b/lucene/licenses/morfologik-polish-LICENSE-BSD.txt
@@ -1,18 +1,20 @@
 BSD-licensed dictionary of Polish (Morfologik)
 
-Morfologik Polish dictionary.
-Version: 2.0 PoliMorf
-Copyright (c) 2013, Marcin Miłkowski
+VERSION: 2.1 PoliMorf
+BUILD:   2016-02-13 19:37:50+01:00
+GIT:     6e63b53
+
+Copyright (c) 2016, Marcin Miłkowski
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met: 
 
 1. Redistributions of source code must retain the above copyright notice, this
-  list of conditions and the following disclaimer. 
+   list of conditions and the following disclaimer. 
 2. Redistributions in binary form must reproduce the above copyright notice,
-  this list of conditions and the following disclaimer in the documentation
-  and/or other materials provided with the distribution. 
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution. 
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -23,4 +25,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/lucene/licenses/morfologik-stemming-2.0.1.jar.sha1
----------------------------------------------------------------------
diff --git a/lucene/licenses/morfologik-stemming-2.0.1.jar.sha1 b/lucene/licenses/morfologik-stemming-2.0.1.jar.sha1
deleted file mode 100644
index 808e482..0000000
--- a/lucene/licenses/morfologik-stemming-2.0.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-df9434b431bbed20ded67ede439c7dfb1e29e9f8

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/lucene/licenses/morfologik-stemming-2.1.0.jar.sha1
----------------------------------------------------------------------
diff --git a/lucene/licenses/morfologik-stemming-2.1.0.jar.sha1 b/lucene/licenses/morfologik-stemming-2.1.0.jar.sha1
new file mode 100644
index 0000000..78f1961
--- /dev/null
+++ b/lucene/licenses/morfologik-stemming-2.1.0.jar.sha1
@@ -0,0 +1 @@
+94167b64752138a246cc33cbf1a3b0bfe5274b7c

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/lucene/licenses/morfologik-stemming-LICENSE-BSD.txt
----------------------------------------------------------------------
diff --git a/lucene/licenses/morfologik-stemming-LICENSE-BSD.txt b/lucene/licenses/morfologik-stemming-LICENSE-BSD.txt
index 31ebad0..635227a 100644
--- a/lucene/licenses/morfologik-stemming-LICENSE-BSD.txt
+++ b/lucene/licenses/morfologik-stemming-LICENSE-BSD.txt
@@ -1,6 +1,6 @@
 
 Copyright (c) 2006 Dawid Weiss
-Copyright (c) 2007-2015 Dawid Weiss, Marcin Miłkowski
+Copyright (c) 2007-2016 Dawid Weiss, Marcin Miłkowski
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification, 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 25c3a50..6f6133f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -23,7 +23,7 @@ Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this r
 Versions of Major Components
 ---------------------
 Apache Tika 1.7
-Carrot2 3.10.4
+Carrot2 3.12.0
 Velocity 1.7 and Velocity Tools 2.0
 Apache UIMA 2.3.1
 Apache ZooKeeper 3.4.6
@@ -290,6 +290,10 @@ Other Changes
 
 * SOLR-8693: Improve ZkStateReader logging. (Scott Blum via Mark Miller)
 
+* SOLR-8710: Upgrade morfologik-stemming to version 2.1.0. (Dawid Weiss)
+
+* SOLR-8711: Upgrade Carrot2 clustering dependency to 3.12.0. (Dawid Weiss)
+
 ======================= 5.5.0 =======================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/licenses/carrot2-mini-3.10.4.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/carrot2-mini-3.10.4.jar.sha1 b/solr/licenses/carrot2-mini-3.10.4.jar.sha1
deleted file mode 100644
index 8bc4a85..0000000
--- a/solr/licenses/carrot2-mini-3.10.4.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-25b82ce95f12e123f2516bda25eb0305c57d7407

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/licenses/carrot2-mini-3.12.0.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/carrot2-mini-3.12.0.jar.sha1 b/solr/licenses/carrot2-mini-3.12.0.jar.sha1
new file mode 100644
index 0000000..5a90da6
--- /dev/null
+++ b/solr/licenses/carrot2-mini-3.12.0.jar.sha1
@@ -0,0 +1 @@
+9d8b42afe43ba5c0a0c5d67208d5c919e45c3584

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/licenses/morfologik-fsa-2.0.1.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/morfologik-fsa-2.0.1.jar.sha1 b/solr/licenses/morfologik-fsa-2.0.1.jar.sha1
deleted file mode 100644
index 2d5f0a7..0000000
--- a/solr/licenses/morfologik-fsa-2.0.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-23b4c04bb74f80e77573dc3ab84c8b4203f68d50

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/licenses/morfologik-fsa-2.1.0.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/morfologik-fsa-2.1.0.jar.sha1 b/solr/licenses/morfologik-fsa-2.1.0.jar.sha1
new file mode 100644
index 0000000..42c0fb3
--- /dev/null
+++ b/solr/licenses/morfologik-fsa-2.1.0.jar.sha1
@@ -0,0 +1 @@
+88e5993f73c102f378c711f6e47221b7a9e22d25

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/licenses/morfologik-fsa-LICENSE-BSD.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/morfologik-fsa-LICENSE-BSD.txt b/solr/licenses/morfologik-fsa-LICENSE-BSD.txt
index 4daba47..635227a 100644
--- a/solr/licenses/morfologik-fsa-LICENSE-BSD.txt
+++ b/solr/licenses/morfologik-fsa-LICENSE-BSD.txt
@@ -1,6 +1,6 @@
 
 Copyright (c) 2006 Dawid Weiss
-Copyright (c) 2007-2013 Dawid Weiss, Marcin Miłkowski
+Copyright (c) 2007-2016 Dawid Weiss, Marcin Miłkowski
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification, 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/licenses/morfologik-polish-2.0.1.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/morfologik-polish-2.0.1.jar.sha1 b/solr/licenses/morfologik-polish-2.0.1.jar.sha1
deleted file mode 100644
index 4647d1c..0000000
--- a/solr/licenses/morfologik-polish-2.0.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-b35034de153a79d0afeeeee2ff883d548a178961

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/licenses/morfologik-polish-2.1.0.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/morfologik-polish-2.1.0.jar.sha1 b/solr/licenses/morfologik-polish-2.1.0.jar.sha1
new file mode 100644
index 0000000..7f8b4c2
--- /dev/null
+++ b/solr/licenses/morfologik-polish-2.1.0.jar.sha1
@@ -0,0 +1 @@
+d5a9c7721bce2ef17444abbe25ac2e65bfaa181f

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/licenses/morfologik-polish-LICENSE-BSD.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/morfologik-polish-LICENSE-BSD.txt b/solr/licenses/morfologik-polish-LICENSE-BSD.txt
index 660f633..f0af542 100644
--- a/solr/licenses/morfologik-polish-LICENSE-BSD.txt
+++ b/solr/licenses/morfologik-polish-LICENSE-BSD.txt
@@ -1,18 +1,20 @@
 BSD-licensed dictionary of Polish (Morfologik)
 
-Morfologik Polish dictionary.
-Version: 2.0 PoliMorf
-Copyright (c) 2013, Marcin Miłkowski
+VERSION: 2.1 PoliMorf
+BUILD:   2016-02-13 19:37:50+01:00
+GIT:     6e63b53
+
+Copyright (c) 2016, Marcin Miłkowski
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met: 
 
 1. Redistributions of source code must retain the above copyright notice, this
-  list of conditions and the following disclaimer. 
+   list of conditions and the following disclaimer. 
 2. Redistributions in binary form must reproduce the above copyright notice,
-  this list of conditions and the following disclaimer in the documentation
-  and/or other materials provided with the distribution. 
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution. 
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -23,4 +25,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/licenses/morfologik-stemming-2.0.1.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/morfologik-stemming-2.0.1.jar.sha1 b/solr/licenses/morfologik-stemming-2.0.1.jar.sha1
deleted file mode 100644
index 808e482..0000000
--- a/solr/licenses/morfologik-stemming-2.0.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-df9434b431bbed20ded67ede439c7dfb1e29e9f8

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/licenses/morfologik-stemming-2.1.0.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/morfologik-stemming-2.1.0.jar.sha1 b/solr/licenses/morfologik-stemming-2.1.0.jar.sha1
new file mode 100644
index 0000000..78f1961
--- /dev/null
+++ b/solr/licenses/morfologik-stemming-2.1.0.jar.sha1
@@ -0,0 +1 @@
+94167b64752138a246cc33cbf1a3b0bfe5274b7c

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed90697d/solr/licenses/morfologik-stemming-LICENSE-BSD.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/morfologik-stemming-LICENSE-BSD.txt b/solr/licenses/morfologik-stemming-LICENSE-BSD.txt
index 4daba47..635227a 100644
--- a/solr/licenses/morfologik-stemming-LICENSE-BSD.txt
+++ b/solr/licenses/morfologik-stemming-LICENSE-BSD.txt
@@ -1,6 +1,6 @@
 
 Copyright (c) 2006 Dawid Weiss
-Copyright (c) 2007-2013 Dawid Weiss, Marcin Miłkowski
+Copyright (c) 2007-2016 Dawid Weiss, Marcin Miłkowski
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification, 


[07/53] [abbrv] lucene-solr git commit: LUCENE-7037: Switch all exceptions tests to expectThrows()

Posted by no...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilterFactory.java
index 026d1b7..985b309 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilterFactory.java
@@ -39,29 +39,25 @@ public class TestCodepointCountFilterFactory extends BaseTokenStreamFactoryTestC
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("CodepointCount", 
           "min", "4", 
           "max", "5", 
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 
   /** Test that invalid arguments result in exception */
   public void testInvalidArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       Reader reader = new StringReader("foo foobar super-duper-trooper");
       TokenStream stream = new MockTokenizer(MockTokenizer.WHITESPACE, false);
       ((Tokenizer)stream).setReader(reader);
       tokenFilterFactory("CodepointCount",
           CodepointCountFilterFactory.MIN_KEY, "5",
           CodepointCountFilterFactory.MAX_KEY, "4").create(stream);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("maximum length must not be greater than minimum length"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("maximum length must not be greater than minimum length"));
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilterFactory.java
index 766429f..ed2bd3e 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilterFactory.java
@@ -50,13 +50,11 @@ public class TestFingerprintFilterFactory extends BaseTokenStreamFactoryTestCase
    * Test that bogus arguments result in exception
    */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Fingerprint",
           FingerprintFilterFactory.MAX_OUTPUT_TOKEN_SIZE_KEY, "3",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepFilterFactory.java
index 387ff5b..6110e2b 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepFilterFactory.java
@@ -44,11 +44,9 @@ public class TestKeepFilterFactory extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("KeepWord", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilterFactory.java
index 0de8882..7bdf151 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilterFactory.java
@@ -93,11 +93,9 @@ public class TestKeywordMarkerFilterFactory extends BaseTokenStreamFactoryTestCa
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("KeywordMarker", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilterFactory.java
index 6e754ef..183d95f 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilterFactory.java
@@ -39,29 +39,25 @@ public class TestLengthFilterFactory extends BaseTokenStreamFactoryTestCase {
 
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Length",
           LengthFilterFactory.MIN_KEY, "4",
           LengthFilterFactory.MAX_KEY, "5",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 
   /** Test that invalid arguments result in exception */
   public void testInvalidArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       Reader reader = new StringReader("foo foobar super-duper-trooper");
       TokenStream stream = new MockTokenizer(MockTokenizer.WHITESPACE, false);
       ((Tokenizer)stream).setReader(reader);
       tokenFilterFactory("Length",
           LengthFilterFactory.MIN_KEY, "5",
           LengthFilterFactory.MAX_KEY, "4").create(stream);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("maximum length must not be greater than minimum length"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("maximum length must not be greater than minimum length"));
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilterFactory.java
index 41b2a35..1f32994 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilterFactory.java
@@ -43,26 +43,22 @@ public class TestLimitTokenCountFilterFactory extends BaseTokenStreamFactoryTest
 
   public void testRequired() throws Exception {
     // param is required
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("LimitTokenCount");
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertTrue("exception doesn't mention param: " + e.getMessage(),
-          0 < e.getMessage().indexOf(LimitTokenCountFilterFactory.MAX_TOKEN_COUNT_KEY));
-    }
+    });
+    assertTrue("exception doesn't mention param: " + expected.getMessage(),
+        0 < expected.getMessage().indexOf(LimitTokenCountFilterFactory.MAX_TOKEN_COUNT_KEY));
   }
 
   /**
    * Test that bogus arguments result in exception
    */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("LimitTokenCount",
           LimitTokenCountFilterFactory.MAX_TOKEN_COUNT_KEY, "3",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilterFactory.java
index eaef676..3840b9e 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilterFactory.java
@@ -43,26 +43,22 @@ public class TestLimitTokenOffsetFilterFactory extends BaseTokenStreamFactoryTes
 
   public void testRequired() throws Exception {
     // param is required
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("LimitTokenOffset");
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertTrue("exception doesn't mention param: " + e.getMessage(),
-          0 < e.getMessage().indexOf(LimitTokenOffsetFilterFactory.MAX_START_OFFSET));
-    }
+    });
+    assertTrue("exception doesn't mention param: " + expected.getMessage(),
+          0 < expected.getMessage().indexOf(LimitTokenOffsetFilterFactory.MAX_START_OFFSET));
   }
 
   /**
    * Test that bogus arguments result in exception
    */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("LimitTokenOffset",
           LimitTokenOffsetFilterFactory.MAX_START_OFFSET, "3",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilterFactory.java
index a537af4..014cc88 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilterFactory.java
@@ -41,13 +41,11 @@ public class TestLimitTokenPositionFilterFactory extends BaseTokenStreamFactoryT
   }
 
   public void testMissingParam() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("LimitTokenPosition");
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertTrue("exception doesn't mention param: " + e.getMessage(),
-          0 < e.getMessage().indexOf(LimitTokenPositionFilterFactory.MAX_TOKEN_POSITION_KEY));
-    }
+    });
+    assertTrue("exception doesn't mention param: " + expected.getMessage(),
+        0 < expected.getMessage().indexOf(LimitTokenPositionFilterFactory.MAX_TOKEN_POSITION_KEY));
   }
 
   public void testMaxPosition1WithShingles() throws Exception {
@@ -73,13 +71,11 @@ public class TestLimitTokenPositionFilterFactory extends BaseTokenStreamFactoryT
    * Test that bogus arguments result in exception
    */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("LimitTokenPosition",
           "maxTokenPosition", "3",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilterFactory.java
index 8b1c77f..3b771f4 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilterFactory.java
@@ -50,11 +50,9 @@ public class TestRemoveDuplicatesTokenFilterFactory extends BaseTokenStreamFacto
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("RemoveDuplicates", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilterFactory.java
index 9811bba..969e891 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilterFactory.java
@@ -33,12 +33,10 @@ public class TestScandinavianFoldingFilterFactory extends BaseTokenStreamFactory
 
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("ScandinavianFolding",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilterFactory.java
index 65c3b82..f4dd48c 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilterFactory.java
@@ -29,12 +29,10 @@ public class TestScandinavianNormalizationFilterFactory extends BaseTokenStreamF
 
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("ScandinavianNormalization",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilterFactory.java
index ed2631f..395f343 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilterFactory.java
@@ -55,11 +55,9 @@ public class TestStemmerOverrideFilterFactory extends BaseTokenStreamFactoryTest
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("StemmerOverride", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilterFactory.java
index 986bc1c..e52e61a 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilterFactory.java
@@ -37,11 +37,9 @@ public class TestTrimFilterFactory extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Trim", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilterFactory.java
index 29f75ba..d0e74c9 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilterFactory.java
@@ -45,28 +45,24 @@ public class TestTruncateTokenFilterFactory extends BaseTokenStreamFactoryTestCa
    * Test that bogus arguments result in exception
    */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Truncate",
           TruncateTokenFilterFactory.PREFIX_LENGTH_KEY, "5",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameter(s):"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameter(s):"));
   }
 
   /**
    * Test that negative prefix length result in exception
    */
   public void testNonPositivePrefixLengthArgument() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Truncate",
           TruncateTokenFilterFactory.PREFIX_LENGTH_KEY, "-5"
       );
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains(TruncateTokenFilterFactory.PREFIX_LENGTH_KEY + " parameter must be a positive number: -5"));
-    }
+    });
+    assertTrue(expected.getMessage().contains(TruncateTokenFilterFactory.PREFIX_LENGTH_KEY + " parameter must be a positive number: -5"));
   }
 }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilterTest.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilterTest.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilterTest.java
index 3d0877f..d7536e7 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilterTest.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilterTest.java
@@ -49,33 +49,21 @@ public class EdgeNGramTokenFilterTest extends BaseTokenStreamTestCase {
   }
 
   public void testInvalidInput() throws Exception {
-    boolean gotException = false;
-    try {        
+    expectThrows(IllegalArgumentException.class, () -> {
       new EdgeNGramTokenFilter(input, 0, 0);
-    } catch (IllegalArgumentException e) {
-      gotException = true;
-    }
-    assertTrue(gotException);
+    });
   }
 
   public void testInvalidInput2() throws Exception {
-    boolean gotException = false;
-    try {        
+    expectThrows(IllegalArgumentException.class, () -> {   
       new EdgeNGramTokenFilter(input, 2, 1);
-    } catch (IllegalArgumentException e) {
-      gotException = true;
-    }
-    assertTrue(gotException);
+    });
   }
 
   public void testInvalidInput3() throws Exception {
-    boolean gotException = false;
-    try {        
+    expectThrows(IllegalArgumentException.class, () -> {      
       new EdgeNGramTokenFilter(input, -1, 2);
-    } catch (IllegalArgumentException e) {
-      gotException = true;
-    }
-    assertTrue(gotException);
+    });
   }
 
   public void testFrontUnigram() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenizerTest.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenizerTest.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenizerTest.java
index c7ca4fe..7fbea5f 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenizerTest.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/EdgeNGramTokenizerTest.java
@@ -42,33 +42,21 @@ public class EdgeNGramTokenizerTest extends BaseTokenStreamTestCase {
   }
 
   public void testInvalidInput() throws Exception {
-    boolean gotException = false;
-    try {        
+    expectThrows(IllegalArgumentException.class, () -> {     
       new EdgeNGramTokenizer(0, 0).setReader(input);
-    } catch (IllegalArgumentException e) {
-      gotException = true;
-    }
-    assertTrue(gotException);
+    });
   }
 
   public void testInvalidInput2() throws Exception {
-    boolean gotException = false;
-    try {        
+    expectThrows(IllegalArgumentException.class, () -> {   
       new EdgeNGramTokenizer(2, 1).setReader(input);
-    } catch (IllegalArgumentException e) {
-      gotException = true;
-    }
-    assertTrue(gotException);
+    });
   }
 
   public void testInvalidInput3() throws Exception {
-    boolean gotException = false;
-    try {        
+    expectThrows(IllegalArgumentException.class, () -> {      
       new EdgeNGramTokenizer(-1, 2).setReader(input);
-    } catch (IllegalArgumentException e) {
-      gotException = true;
-    }
-    assertTrue(gotException);
+    });
   }
 
   public void testFrontUnigram() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenFilterTest.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenFilterTest.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenFilterTest.java
index 834933a..d8591a9 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenFilterTest.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenFilterTest.java
@@ -47,23 +47,15 @@ public class NGramTokenFilterTest extends BaseTokenStreamTestCase {
   }
   
   public void testInvalidInput() throws Exception {
-    boolean gotException = false;
-    try {        
+    expectThrows(IllegalArgumentException.class, () -> {
       new NGramTokenFilter(input, 2, 1);
-    } catch (IllegalArgumentException e) {
-      gotException = true;
-    }
-    assertTrue(gotException);
+    });
   }
   
   public void testInvalidInput2() throws Exception {
-    boolean gotException = false;
-    try {        
+    expectThrows(IllegalArgumentException.class, () -> {     
       new NGramTokenFilter(input, 0, 1);
-    } catch (IllegalArgumentException e) {
-      gotException = true;
-    }
-    assertTrue(gotException);
+    });
   }
 
   public void testUnigrams() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenizerTest.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenizerTest.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenizerTest.java
index 8655f3d..46a0c1c 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenizerTest.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/NGramTokenizerTest.java
@@ -46,25 +46,16 @@ public class NGramTokenizerTest extends BaseTokenStreamTestCase {
   }
   
   public void testInvalidInput() throws Exception {
-    boolean gotException = false;
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       NGramTokenizer tok = new NGramTokenizer(2, 1);
-      tok.setReader(input);
-    } catch (IllegalArgumentException e) {
-      gotException = true;
-    }
-    assertTrue(gotException);
+    });
   }
   
   public void testInvalidInput2() throws Exception {
-    boolean gotException = false;
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       NGramTokenizer tok = new NGramTokenizer(0, 1);
       tok.setReader(input);
-    } catch (IllegalArgumentException e) {
-      gotException = true;
-    }
-    assertTrue(gotException);
+    });
   }
   
   public void testUnigrams() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramFilters.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramFilters.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramFilters.java
index d429f61..1243352 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramFilters.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramFilters.java
@@ -126,32 +126,24 @@ public class TestNGramFilters extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("NGram", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("EdgeNGram", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("NGram", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("EdgeNGram", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilterFactory.java
index 6f7f876..cd2bc2f 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilterFactory.java
@@ -53,11 +53,9 @@ public class TestNorwegianLightStemFilterFactory extends BaseTokenStreamFactoryT
 
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("NorwegianLightStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilterFactory.java
index c433b76..91d021b 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilterFactory.java
@@ -57,11 +57,9 @@ public class TestNorwegianMinimalStemFilterFactory extends BaseTokenStreamFactor
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("NorwegianMinimalStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilterFactory.java
index f1c5553..624de9e 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilterFactory.java
@@ -71,13 +71,11 @@ public class TestPatternReplaceCharFilterFactory extends BaseTokenStreamFactoryT
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       charFilterFactory("PatternReplace",
           "pattern", "something",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilterFactory.java
index 24f751a..80ced7a 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilterFactory.java
@@ -42,13 +42,11 @@ public class TestPatternReplaceFilterFactory extends BaseTokenStreamFactoryTestC
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("PatternReplace",
           "pattern", "something",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizerFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizerFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizerFactory.java
index a0d1af4..02126f1 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizerFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizerFactory.java
@@ -36,13 +36,11 @@ public class TestPatternTokenizerFactory extends BaseTokenStreamFactoryTestCase
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("Pattern",
           "pattern", "something",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilterFactory.java
index a9bec99..65f5b72 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilterFactory.java
@@ -70,14 +70,12 @@ public class TestDelimitedPayloadTokenFilterFactory extends BaseTokenStreamFacto
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("DelimitedPayload", 
           "encoder", "float",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilterFactory.java
index 0af152a..5db7a59 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilterFactory.java
@@ -39,11 +39,9 @@ public class TestPortugueseLightStemFilterFactory extends BaseTokenStreamFactory
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("PortugueseLightStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilterFactory.java
index 5ad28b5..4fe74bb 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilterFactory.java
@@ -39,11 +39,9 @@ public class TestPortugueseMinimalStemFilterFactory extends BaseTokenStreamFacto
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("PortugueseMinimalStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilterFactory.java
index e00ba79..d07d794 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilterFactory.java
@@ -37,11 +37,9 @@ public class TestPortugueseStemFilterFactory extends BaseTokenStreamFactoryTestC
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("PortugueseStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilterFactory.java
index 72b2b33..874095c 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilterFactory.java
@@ -40,11 +40,9 @@ public class TestReverseStringFilterFactory extends BaseTokenStreamFactoryTestCa
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("ReverseString", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilterFactory.java
index bf82ea8..244c6fd 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilterFactory.java
@@ -37,11 +37,9 @@ public class TestRussianLightStemFilterFactory extends BaseTokenStreamFactoryTes
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("RussianLightStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilterFactory.java
index aed5f0b..2c894ed 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilterFactory.java
@@ -217,11 +217,9 @@ public class TestShingleFilterFactory extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Shingle", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballPorterFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballPorterFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballPorterFilterFactory.java
index 6dc1104..5696bf3 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballPorterFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballPorterFilterFactory.java
@@ -60,12 +60,10 @@ public class TestSnowballPorterFilterFactory extends BaseTokenStreamFactoryTestC
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("SnowballPorter", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilterFactory.java
index 8c45ed0..772f6fc 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilterFactory.java
@@ -47,12 +47,10 @@ public class TestSerbianNormalizationFilterFactory extends BaseTokenStreamFactor
    
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("SerbianNormalization", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/standard/TestStandardFactories.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/standard/TestStandardFactories.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/standard/TestStandardFactories.java
index 17d3468..0079678 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/standard/TestStandardFactories.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/standard/TestStandardFactories.java
@@ -149,60 +149,44 @@ public class TestStandardFactories extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("Standard", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("Classic", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("Whitespace", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("Letter", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("LowerCase", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("ASCIIFolding", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Standard", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Classic", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/standard/TestUAX29URLEmailTokenizerFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/standard/TestUAX29URLEmailTokenizerFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/standard/TestUAX29URLEmailTokenizerFactory.java
index f203464..12a4865 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/standard/TestUAX29URLEmailTokenizerFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/standard/TestUAX29URLEmailTokenizerFactory.java
@@ -165,20 +165,16 @@ public class TestUAX29URLEmailTokenizerFactory extends BaseTokenStreamFactoryTes
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("UAX29URLEmail", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 
- public void testIllegalArguments() throws Exception {
-    try {
+  public void testIllegalArguments() throws Exception {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("UAX29URLEmail", "maxTokenLength", "-1").create();
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("maxTokenLength must be greater than zero"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("maxTokenLength must be greater than zero"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilterFactory.java
index 04e946b..7c4f558 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilterFactory.java
@@ -36,11 +36,9 @@ public class TestSwedishLightStemFilterFactory extends BaseTokenStreamFactoryTes
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("SwedishLightStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSolrSynonymParser.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSolrSynonymParser.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSolrSynonymParser.java
index a7e2da9..9467137 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSolrSynonymParser.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSolrSynonymParser.java
@@ -77,12 +77,9 @@ public class TestSolrSynonymParser extends BaseSynonymParserTestCase {
     String testFile = "a => b => c";
     Analyzer analyzer = new MockAnalyzer(random());
     SolrSynonymParser parser = new SolrSynonymParser(true, true, analyzer);
-    try {
+    expectThrows(ParseException.class, () -> {
       parser.parse(new StringReader(testFile));
-      fail("didn't get expected exception");
-    } catch (ParseException expected) {
-      // expected exc
-    }
+    });
     analyzer.close();
   }
   
@@ -91,12 +88,9 @@ public class TestSolrSynonymParser extends BaseSynonymParserTestCase {
     String testFile = "a => 1"; 
     Analyzer analyzer = new MockAnalyzer(random(), MockTokenizer.SIMPLE, false);
     SolrSynonymParser parser = new SolrSynonymParser(true, true, analyzer);
-    try {
+    expectThrows(ParseException.class, () -> {
       parser.parse(new StringReader(testFile));
-      fail("didn't get expected exception");
-    } catch (ParseException expected) {
-      // expected exc
-    }
+    });
     analyzer.close();
   }
   
@@ -105,12 +99,9 @@ public class TestSolrSynonymParser extends BaseSynonymParserTestCase {
     String testFile = "1 => a";
     Analyzer analyzer = new MockAnalyzer(random(), MockTokenizer.SIMPLE, false);
     SolrSynonymParser parser = new SolrSynonymParser(true, true, analyzer);
-    try {
+    expectThrows(ParseException.class, () -> {
       parser.parse(new StringReader(testFile));
-      fail("didn't get expected exception");
-    } catch (ParseException expected) {
-      // expected exc
-    }
+    });
     analyzer.close();
   }
   
@@ -119,12 +110,9 @@ public class TestSolrSynonymParser extends BaseSynonymParserTestCase {
     String testFile = "testola => the test";
     Analyzer analyzer = new EnglishAnalyzer();
     SolrSynonymParser parser = new SolrSynonymParser(true, true, analyzer);
-    try {
+    expectThrows(ParseException.class, () -> {
       parser.parse(new StringReader(testFile));
-      fail("didn't get expected exception");
-    } catch (ParseException expected) {
-      // expected exc
-    }
+    });
     analyzer.close();
   }
   
@@ -133,12 +121,9 @@ public class TestSolrSynonymParser extends BaseSynonymParserTestCase {
     String testFile = "the test => testola";
     Analyzer analyzer = new EnglishAnalyzer();
     SolrSynonymParser parser = new SolrSynonymParser(true, true, analyzer);
-    try {
+    expectThrows(ParseException.class, () -> {
       parser.parse(new StringReader(testFile));
-      fail("didn't get expected exception");
-    } catch (ParseException expected) {
-      // expected exc
-    }
+    });
     analyzer.close();
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymFilterFactory.java
index eedf25b..e3bb00a 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymFilterFactory.java
@@ -76,14 +76,12 @@ public class TestSynonymFilterFactory extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Synonym", 
           "synonyms", "synonyms.txt", 
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 
   /** Test that analyzer and tokenizerFactory is both specified */
@@ -97,15 +95,13 @@ public class TestSynonymFilterFactory extends BaseTokenStreamFactoryTestCase {
         "analyzer", analyzer);
     assertNotNull(factory);
 
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Synonym",
           "synonyms", "synonyms.txt",
           "analyzer", analyzer,
           "tokenizerFactory", tokenizerFactory);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Analyzer and TokenizerFactory can't be specified both"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Analyzer and TokenizerFactory can't be specified both"));
   }
 
   static final String TOK_SYN_ARG_VAL = "argument";
@@ -132,27 +128,21 @@ public class TestSynonymFilterFactory extends BaseTokenStreamFactoryTestCase {
     assertNotNull(factory);
 
     // sanity check that sub-PatternTokenizerFactory fails w/o pattern
-    try {
-      factory = tokenFilterFactory("Synonym", 
+    expectThrows(Exception.class, () -> {
+      tokenFilterFactory("Synonym", 
           "synonyms", "synonyms.txt", 
           "tokenizerFactory", clazz);
-      fail("tokenizerFactory should have complained about missing pattern arg");
-    } catch (Exception expected) {
-      // :NOOP:
-    }
+    });
 
     // sanity check that sub-PatternTokenizerFactory fails on unexpected
-    try {
-      factory = tokenFilterFactory("Synonym", 
+    expectThrows(Exception.class, () -> {
+      tokenFilterFactory("Synonym", 
           "synonyms", "synonyms.txt", 
           "tokenizerFactory", clazz,
           "tokenizerFactory.pattern", "(.*)",
           "tokenizerFactory.bogusbogusbogus", "bogus",
           "tokenizerFactory.group", "0");
-      fail("tokenizerFactory should have complained about missing pattern arg");
-    } catch (Exception expected) {
-      // :NOOP:
-    }
+    });
   }
 
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymMapFilter.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymMapFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymMapFilter.java
index 9e1c095..0fbbd2e 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymMapFilter.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymMapFilter.java
@@ -946,12 +946,9 @@ public class TestSynonymMapFilter extends BaseTokenStreamTestCase {
   public void testEmpty() throws Exception {
     Tokenizer tokenizer = new MockTokenizer();
     tokenizer.setReader(new StringReader("aa bb"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new SynonymFilter(tokenizer, new SynonymMap.Builder(true).build(), true);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertEquals("fst must be non-null", iae.getMessage());
-    }
+    });
+    assertEquals("fst must be non-null", expected.getMessage());
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiTokenizerFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiTokenizerFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiTokenizerFactory.java
index f8bf8a6..428c36a 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiTokenizerFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiTokenizerFactory.java
@@ -40,11 +40,9 @@ public class TestThaiTokenizerFactory extends BaseTokenStreamFactoryTestCase {
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
     assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiTokenizer.DBBI_AVAILABLE);
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("Thai", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilterFactory.java
index f874467..b4ecc1c 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilterFactory.java
@@ -45,11 +45,9 @@ public class TestApostropheFilterFactory extends BaseTokenStreamFactoryTestCase
    * Test that bogus arguments result in exception
    */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Apostrophe", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameter(s):"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameter(s):"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilterFactory.java
index 12a829d..9b1638f 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilterFactory.java
@@ -42,11 +42,9 @@ public class TestTurkishLowerCaseFilterFactory extends BaseTokenStreamFactoryTes
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("TurkishLowerCase", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestAnalysisSPILoader.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestAnalysisSPILoader.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestAnalysisSPILoader.java
index 3e47fe2..098b98b 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestAnalysisSPILoader.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestAnalysisSPILoader.java
@@ -42,19 +42,13 @@ public class TestAnalysisSPILoader extends LuceneTestCase {
   }
   
   public void testBogusLookupTokenizer() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       TokenizerFactory.forName("sdfsdfsdfdsfsdfsdf", new HashMap<String,String>());
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       TokenizerFactory.forName("!(**#$U*#$*", new HashMap<String,String>());
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
   }
 
   public void testLookupTokenizerClass() {
@@ -64,19 +58,13 @@ public class TestAnalysisSPILoader extends LuceneTestCase {
   }
   
   public void testBogusLookupTokenizerClass() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       TokenizerFactory.lookupClass("sdfsdfsdfdsfsdfsdf");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       TokenizerFactory.lookupClass("!(**#$U*#$*");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
   }
   
   public void testAvailableTokenizers() {
@@ -94,19 +82,13 @@ public class TestAnalysisSPILoader extends LuceneTestCase {
   }
   
   public void testBogusLookupTokenFilter() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       TokenFilterFactory.forName("sdfsdfsdfdsfsdfsdf", new HashMap<String,String>());
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       TokenFilterFactory.forName("!(**#$U*#$*", new HashMap<String,String>());
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
   }
 
   public void testLookupTokenFilterClass() {
@@ -120,19 +102,13 @@ public class TestAnalysisSPILoader extends LuceneTestCase {
   }
   
   public void testBogusLookupTokenFilterClass() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       TokenFilterFactory.lookupClass("sdfsdfsdfdsfsdfsdf");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       TokenFilterFactory.lookupClass("!(**#$U*#$*");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
   }
   
   public void testAvailableTokenFilters() {
@@ -147,19 +123,13 @@ public class TestAnalysisSPILoader extends LuceneTestCase {
   }
   
   public void testBogusLookupCharFilter() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       CharFilterFactory.forName("sdfsdfsdfdsfsdfsdf", new HashMap<String,String>());
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       CharFilterFactory.forName("!(**#$U*#$*", new HashMap<String,String>());
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
   }
 
   public void testLookupCharFilterClass() {
@@ -169,19 +139,13 @@ public class TestAnalysisSPILoader extends LuceneTestCase {
   }
   
   public void testBogusLookupCharFilterClass() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       CharFilterFactory.lookupClass("sdfsdfsdfdsfsdfsdf");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       CharFilterFactory.lookupClass("!(**#$U*#$*");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //
-    }
+    });
   }
   
   public void testAvailableCharFilters() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayIterator.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayIterator.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayIterator.java
index e39fa07..0287a7c 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayIterator.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayIterator.java
@@ -140,12 +140,9 @@ public class TestCharArrayIterator extends LuceneTestCase {
     
     // setIndex()
     ci.setText("test".toCharArray(), 0, "test".length());
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       ci.setIndex(5);
-      fail();
-    } catch (Exception e) {
-      assertTrue(e instanceof IllegalArgumentException);
-    }
+    });
     
     // clone()
     char text[] = "testing".toCharArray();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayMap.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayMap.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayMap.java
index a926543..66b0dce 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayMap.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayMap.java
@@ -87,12 +87,11 @@ public class TestCharArrayMap extends LuceneTestCase {
     cs.clear();
     assertEquals(0, cs.size());
     assertEquals(0, cm.size());
-    try {
+    // keySet() should not allow adding new keys
+    expectThrows(UnsupportedOperationException.class, () -> {
       cs.add("test");
-      fail("keySet() allows adding new keys");
-    } catch (UnsupportedOperationException ue) {
-      // pass
-    }
+    });
+
     cm.putAll(hm);
     assertEquals(hm.size(), cs.size());
     assertEquals(cm.size(), cs.size());
@@ -131,6 +130,7 @@ public class TestCharArrayMap extends LuceneTestCase {
     assertTrue(cm.isEmpty());
   }
 
+  // TODO: break this up into simpler test methods vs. "telling a story"
   public void testModifyOnUnmodifiable(){
     CharArrayMap<Integer> map = new CharArrayMap<>(2, false);
     map.put("foo",1);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArraySet.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArraySet.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArraySet.java
index 04b211b..1fcee65 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArraySet.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArraySet.java
@@ -86,6 +86,7 @@ public class TestCharArraySet extends LuceneTestCase {
       assertTrue(set.contains(TEST_STOP_WORDS[i]));
   }
   
+  // TODO: break this up into simpler test methods, vs "telling a story"
   public void testModifyOnUnmodifiable(){
     CharArraySet set=new CharArraySet(10, true);
     set.addAll(Arrays.asList(TEST_STOP_WORDS));
@@ -185,12 +186,9 @@ public class TestCharArraySet extends LuceneTestCase {
     assertTrue(set.contains("1"));
     assertTrue(set.contains(new char[]{'1'}));
     
-    try{
+    expectThrows(NullPointerException.class, () -> {
       CharArraySet.unmodifiableSet(null);
-      fail("can not make null unmodifiable");
-    }catch (NullPointerException e) {
-      // expected
-    }
+    });
   }
   
   public void testSupplementaryChars() {
@@ -408,18 +406,18 @@ public class TestCharArraySet extends LuceneTestCase {
    */
   public void testContainsWithNull() {
     CharArraySet set = new CharArraySet(1, true);
-    try {
+
+    expectThrows(NullPointerException.class, () -> {
       set.contains((char[]) null, 0, 10);
-      fail("null value must raise NPE");
-    } catch (NullPointerException e) {}
-    try {
+    });
+
+    expectThrows(NullPointerException.class, () -> {
       set.contains((CharSequence) null);
-      fail("null value must raise NPE");
-    } catch (NullPointerException e) {}
-    try {
+    });
+
+    expectThrows(NullPointerException.class, () -> {
       set.contains((Object) null);
-      fail("null value must raise NPE");
-    } catch (NullPointerException e) {}
+    });
   }
   
   public void testToString() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharacterUtils.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharacterUtils.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharacterUtils.java
index 7588629..2faeec7 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharacterUtils.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharacterUtils.java
@@ -40,23 +40,18 @@ public class TestCharacterUtils extends LuceneTestCase {
     assertEquals((int) 'A', java4.codePointAt(cpAt3, 0));
     assertEquals((int) '\ud801', java4.codePointAt(cpAt3, 3));
     assertEquals((int) '\ud801', java4.codePointAt(highSurrogateAt3, 3));
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       java4.codePointAt(highSurrogateAt3, 4);
-      fail("string index out of bounds");
-    } catch (IndexOutOfBoundsException e) {
-    }
+    });
 
     CharacterUtils java5 = CharacterUtils.getInstance();
     assertEquals((int) 'A', java5.codePointAt(cpAt3, 0));
     assertEquals(Character.toCodePoint('\ud801', '\udc1c'), java5.codePointAt(
         cpAt3, 3));
     assertEquals((int) '\ud801', java5.codePointAt(highSurrogateAt3, 3));
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       java5.codePointAt(highSurrogateAt3, 4);
-      fail("string index out of bounds");
-    } catch (IndexOutOfBoundsException e) {
-    }
-
+    });
   }
 
   @Test
@@ -149,11 +144,10 @@ public class TestCharacterUtils extends LuceneTestCase {
     assertEquals(0, newCharacterBuffer.getOffset());
     assertEquals(0, newCharacterBuffer.getLength());
 
-    try {
-      newCharacterBuffer = CharacterUtils.newCharacterBuffer(1);
-      fail("length must be >= 2");
-    } catch (IllegalArgumentException e) {
-    }
+    // length must be >= 2
+    expectThrows(IllegalArgumentException.class, () -> {
+      CharacterUtils.newCharacterBuffer(1);
+    });
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElisionFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElisionFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElisionFilterFactory.java
index d48db62..8b81a89 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElisionFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElisionFilterFactory.java
@@ -65,11 +65,9 @@ public class TestElisionFilterFactory extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Elision", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java
index 3143964..be90611 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java
@@ -30,18 +30,15 @@ import org.apache.lucene.util.LuceneTestCase;
 public class TestFilesystemResourceLoader extends LuceneTestCase {
   
   private void assertNotFound(ResourceLoader rl) throws Exception {
-    try {
+    // the resource does not exist, should fail!
+    expectThrows(IOException.class, () -> {
       IOUtils.closeWhileHandlingException(rl.openResource("this-directory-really-really-really-should-not-exist/foo/bar.txt"));
-      fail("The resource does not exist, should fail!");
-    } catch (IOException ioe) {
-      // pass
-    }
-    try {
+    });
+
+    // the class does not exist, should fail!
+    expectThrows(RuntimeException.class, () -> {
       rl.newInstance("org.apache.lucene.analysis.FooBarFilterFactory", TokenFilterFactory.class);
-      fail("The class does not exist, should fail!");
-    } catch (RuntimeException iae) {
-      // pass
-    }
+    });
   }
   
   private void assertClasspathDelegation(ResourceLoader rl) throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizerFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizerFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizerFactory.java
index aa0e5ec..ec345f9 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizerFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizerFactory.java
@@ -42,11 +42,9 @@ public class TestWikipediaTokenizerFactory extends BaseTokenStreamFactoryTestCas
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenizerFactory("Wikipedia", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilterFactory.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilterFactory.java
index 719ad20..4c1d4ac 100644
--- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilterFactory.java
+++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilterFactory.java
@@ -39,13 +39,11 @@ public class TestICUFoldingFilterFactory extends BaseTokenStreamTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new ICUFoldingFilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }


[31/53] [abbrv] lucene-solr git commit: SOLR-8674: solr.tests.mergePolicy[Factory] tests now randomly choose between and

Posted by no...@apache.org.
SOLR-8674: solr.tests.mergePolicy[Factory] tests now randomly choose between <mergePolicy> and <mergePolicyFactory>

* This increases <mergePolicy> vs. <mergePolicyFactory> test coverage.
* This temporarily also adds a little test setup complexity but when SOLR-8668 removes support for <mergePolicy> then test setup will return to its original complexity.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b14fb50b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b14fb50b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b14fb50b

Branch: refs/heads/apiv2
Commit: b14fb50b7fb5c2a57f55ce42263f888576b8ca1f
Parents: fa602bf
Author: Christine Poerschke <cp...@apache.org>
Authored: Mon Feb 22 15:22:55 2016 +0000
Committer: Christine Poerschke <cp...@apache.org>
Committed: Mon Feb 22 15:22:55 2016 +0000

----------------------------------------------------------------------
 .../solrconfig.snippet.randomindexconfig.xml    |  2 +-
 .../collection1/conf/solrconfig-delpolicy1.xml  |  3 +-
 .../collection1/conf/solrconfig-delpolicy2.xml  |  3 +-
 .../conf/solrconfig-spellcheckcomponent.xml     |  3 +-
 .../solrconfig.snippet.randomindexconfig.xml    |  3 +-
 .../org/apache/solr/TestGroupingSearch.java     | 12 +++++-
 .../solr/cloud/TestMiniSolrCloudCluster.java    | 12 +++++-
 .../cloud/TestMiniSolrCloudClusterBase.java     | 12 +++++-
 .../cloud/TestSolrCloudWithKerberosAlt.java     | 12 +++++-
 .../test/org/apache/solr/core/TestNRTOpen.java  |  8 +++-
 .../apache/solr/search/TestIndexSearcher.java   | 11 ++++-
 .../solr/update/DirectUpdateHandlerTest.java    |  6 ++-
 .../solr/update/SolrCmdDistributorTest.java     | 12 +++++-
 .../java/org/apache/solr/SolrTestCaseJ4.java    | 45 ++++++++++++++++++++
 14 files changed, 129 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/contrib/analytics/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/analytics/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml b/solr/contrib/analytics/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
index 069ccb8..ecf1f14 100644
--- a/solr/contrib/analytics/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
+++ b/solr/contrib/analytics/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
@@ -26,7 +26,7 @@ A solrconfig.xml snippet containing indexConfig settings for randomized testing.
        the RandomMergePolicy in all tests - but some tests expect very specific
        Merge behavior, so those tests can set it as needed.
   -->
-  <mergePolicy class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />
+  <mergePolicyFactory class="${solr.tests.mergePolicyFactory:org.apache.solr.util.RandomMergePolicyFactory}" />
   
   <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml
index 250fc06..33faf8b 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml
@@ -30,7 +30,8 @@
          to configure an explicit deletion policy, but we still wnat to randomize as much 
          as possible. 
     -->
-    <mergePolicy class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />
+    <mergePolicy enable="${solr.tests.useMergePolicy:true}" class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />
+    <mergePolicyFactory enable="${solr.tests.useMergePolicyFactory:true}" class="${solr.tests.mergePolicyFactory:org.apache.solr.util.RandomMergePolicyFactory}" />
     <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
 
     <maxBufferedDocs>${solr.tests.maxBufferedDocs}</maxBufferedDocs>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml
index 61391fd..61adf1f 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml
@@ -27,7 +27,8 @@
          to configure an explicit deletion policy, but we still wnat to randomize as much 
          as possible. 
     -->
-    <mergePolicy class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />
+    <mergePolicy enable="${solr.tests.useMergePolicy:true}" class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />
+    <mergePolicyFactory enable="${solr.tests.useMergePolicyFactory:true}" class="${solr.tests.mergePolicyFactory:org.apache.solr.util.RandomMergePolicyFactory}" />
     <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
 
     <maxBufferedDocs>${solr.tests.maxBufferedDocs}</maxBufferedDocs>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
index faa886b..23e1cd2 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
@@ -20,7 +20,8 @@
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
   <indexConfig>
-    <mergePolicy class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />  
+    <mergePolicy enable="${solr.tests.useMergePolicy:true}" class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />
+    <mergePolicyFactory enable="${solr.tests.useMergePolicyFactory:true}" class="${solr.tests.mergePolicyFactory:org.apache.solr.util.RandomMergePolicyFactory}" />
     <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
     <maxBufferedDocs>${solr.tests.maxBufferedDocs}</maxBufferedDocs>
     <ramBufferSizeMB>${solr.tests.ramBufferSizeMB}</ramBufferSizeMB>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
index a23bf0a..ec5f54e 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
@@ -26,7 +26,8 @@ A solrconfig.xml snippet containing indexConfig settings for randomized testing.
        the RandomMergePolicy in all tests - but some tests expect very specific
        Merge behavior, so those tests can set it as needed.
   -->
-  <mergePolicyFactory class="org.apache.solr.util.RandomMergePolicyFactory" />
+  <mergePolicy enable="${solr.tests.useMergePolicy:true}" class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />
+  <mergePolicyFactory enable="${solr.tests.useMergePolicyFactory:true}" class="${solr.tests.mergePolicyFactory:org.apache.solr.util.RandomMergePolicyFactory}" />
   
   <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestGroupingSearch.java b/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
index c85782f..8bfd94a 100644
--- a/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
+++ b/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
@@ -34,12 +34,14 @@ import org.apache.lucene.index.LogDocMergePolicy;
 import org.apache.solr.client.solrj.impl.BinaryResponseParser;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.GroupParams;
+import org.apache.solr.index.LogDocMergePolicyFactory;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.request.SolrRequestInfo;
 import org.apache.solr.response.BinaryResponseWriter;
 import org.apache.solr.response.ResultContext;
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.schema.IndexSchema;
+import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -61,13 +63,19 @@ public class TestGroupingSearch extends SolrTestCaseJ4 {
   public static void beforeTests() throws Exception {
     // force LogDocMergePolicy so that we get a predictable doc order
     // when doing unsorted group collection
-    System.setProperty("solr.tests.mergePolicy", 
-                       LogDocMergePolicy.class.getName());
+    systemSetPropertySolrTestsMergePolicy(LogDocMergePolicy.class.getName());
+    systemSetPropertySolrTestsMergePolicyFactory(LogDocMergePolicyFactory.class.getName());
 
     System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
     initCore("solrconfig.xml", "schema12.xml");
   }
 
+  @AfterClass
+  public static void afterTests() {
+    systemClearPropertySolrTestsMergePolicy();
+    systemClearPropertySolrTestsMergePolicyFactory();
+  }
+
   @Before
   public void cleanIndex() {
     assertU(delQ("*:*"));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java
index a858b64..9be89190 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java
@@ -31,6 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
 
+import org.apache.lucene.index.TieredMergePolicy;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks;
 import org.apache.solr.SolrTestCaseJ4;
@@ -48,6 +49,7 @@ import org.apache.solr.common.cloud.Slice;
 import org.apache.solr.common.cloud.SolrZkClient;
 import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.solr.core.CoreDescriptor;
+import org.apache.solr.index.TieredMergePolicyFactory;
 import org.apache.solr.util.RevertDefaultThreadHandlerRule;
 import org.junit.ClassRule;
 import org.junit.Rule;
@@ -105,7 +107,15 @@ public class TestMiniSolrCloudCluster extends LuceneTestCase {
     collectionProperties.putIfAbsent("solr.tests.maxBufferedDocs", "100000");
     collectionProperties.putIfAbsent("solr.tests.ramBufferSizeMB", "100");
     // use non-test classes so RandomizedRunner isn't necessary
-    collectionProperties.putIfAbsent("solr.tests.mergePolicy", "org.apache.lucene.index.TieredMergePolicy");
+    if (random().nextBoolean()) {
+      collectionProperties.putIfAbsent(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICY, TieredMergePolicy.class.getName());
+      collectionProperties.putIfAbsent(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICY, "true");
+      collectionProperties.putIfAbsent(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICYFACTORY, "false");
+    } else {
+      collectionProperties.putIfAbsent(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICYFACTORY, TieredMergePolicyFactory.class.getName());
+      collectionProperties.putIfAbsent(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICYFACTORY, "true");
+      collectionProperties.putIfAbsent(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICY, "false");
+    }
     collectionProperties.putIfAbsent("solr.tests.mergeScheduler", "org.apache.lucene.index.ConcurrentMergeScheduler");
     collectionProperties.putIfAbsent("solr.directoryFactory", (persistIndex ? "solr.StandardDirectoryFactory" : "solr.RAMDirectoryFactory"));
     

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterBase.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterBase.java b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterBase.java
index e5d092d..54b21df 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterBase.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterBase.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
+import org.apache.lucene.index.TieredMergePolicy;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -39,6 +40,7 @@ import org.apache.solr.common.cloud.Slice;
 import org.apache.solr.common.cloud.SolrZkClient;
 import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.solr.core.CoreDescriptor;
+import org.apache.solr.index.TieredMergePolicyFactory;
 import org.apache.solr.util.RevertDefaultThreadHandlerRule;
 import org.junit.ClassRule;
 import org.junit.Rule;
@@ -93,7 +95,15 @@ public class TestMiniSolrCloudClusterBase extends LuceneTestCase {
     collectionProperties.put("solr.tests.maxBufferedDocs", "100000");
     collectionProperties.put("solr.tests.ramBufferSizeMB", "100");
     // use non-test classes so RandomizedRunner isn't necessary
-    collectionProperties.put("solr.tests.mergePolicy", "org.apache.lucene.index.TieredMergePolicy");
+    if (random().nextBoolean()) {
+      collectionProperties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICY, TieredMergePolicy.class.getName());
+      collectionProperties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICY, "true");
+      collectionProperties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICYFACTORY, "false");
+    } else {
+      collectionProperties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICYFACTORY, TieredMergePolicyFactory.class.getName());
+      collectionProperties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICYFACTORY, "true");
+      collectionProperties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICY, "false");
+    }
     collectionProperties.put("solr.tests.mergeScheduler", "org.apache.lucene.index.ConcurrentMergeScheduler");
     collectionProperties.put("solr.directoryFactory", "solr.RAMDirectoryFactory");
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java b/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java
index 76850b6..4d3ee30 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java
@@ -28,6 +28,7 @@ import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.hadoop.minikdc.MiniKdc;
+import org.apache.lucene.index.TieredMergePolicy;
 import org.apache.lucene.util.Constants;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
@@ -43,6 +44,7 @@ import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.cloud.SolrZkClient;
 import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.solr.core.CoreDescriptor;
+import org.apache.solr.index.TieredMergePolicyFactory;
 import org.apache.solr.util.BadZookeeperThreadsFilter;
 import org.apache.solr.util.RevertDefaultThreadHandlerRule;
 import org.junit.BeforeClass;
@@ -185,7 +187,15 @@ public class TestSolrCloudWithKerberosAlt extends LuceneTestCase {
       properties.put("solr.tests.maxBufferedDocs", "100000");
       properties.put("solr.tests.ramBufferSizeMB", "100");
       // use non-test classes so RandomizedRunner isn't necessary
-      properties.put("solr.tests.mergePolicy", "org.apache.lucene.index.TieredMergePolicy");
+      if (random().nextBoolean()) {
+        properties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICY, TieredMergePolicy.class.getName());
+        properties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICY, "true");
+        properties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICYFACTORY, "false");
+      } else {
+        properties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICYFACTORY, TieredMergePolicyFactory.class.getName());
+        properties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICYFACTORY, "true");
+        properties.put(SolrTestCaseJ4.SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICY, "false");
+      }
       properties.put("solr.tests.mergeScheduler", "org.apache.lucene.index.ConcurrentMergeScheduler");
       properties.put("solr.directoryFactory", "solr.RAMDirectoryFactory");
       createRequest.setProperties(properties);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test/org/apache/solr/core/TestNRTOpen.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestNRTOpen.java b/solr/core/src/test/org/apache/solr/core/TestNRTOpen.java
index 8c24d77..1ebd5b6 100644
--- a/solr/core/src/test/org/apache/solr/core/TestNRTOpen.java
+++ b/solr/core/src/test/org/apache/solr/core/TestNRTOpen.java
@@ -23,7 +23,9 @@ import java.util.Set;
 
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.LogDocMergePolicy;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.index.LogDocMergePolicyFactory;
 import org.apache.solr.search.SolrIndexSearcher;
 import org.apache.solr.util.RefCounted;
 import org.junit.AfterClass;
@@ -39,7 +41,8 @@ public class TestNRTOpen extends SolrTestCaseJ4 {
     System.setProperty("solr.test.leavedatadir", "true");
     // set these so that merges won't break the test
     System.setProperty("solr.tests.maxBufferedDocs", "100000");
-    System.setProperty("solr.tests.mergePolicy", "org.apache.lucene.index.LogDocMergePolicy");
+    systemSetPropertySolrTestsMergePolicy(LogDocMergePolicy.class.getName());
+    systemSetPropertySolrTestsMergePolicyFactory(LogDocMergePolicyFactory.class.getName());
     initCore("solrconfig-basic.xml", "schema-minimal.xml");
     // add a doc
     assertU(adoc("foo", "bar"));
@@ -59,7 +62,8 @@ public class TestNRTOpen extends SolrTestCaseJ4 {
     System.clearProperty("solr.test.leavedatadir");
     System.clearProperty("solr.directoryFactory");
     System.clearProperty("solr.tests.maxBufferedDocs");
-    System.clearProperty("solr.tests.mergePolicy");
+    systemClearPropertySolrTestsMergePolicy();
+    systemClearPropertySolrTestsMergePolicyFactory();
   }
   
   public void setUp() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test/org/apache/solr/search/TestIndexSearcher.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestIndexSearcher.java b/solr/core/src/test/org/apache/solr/search/TestIndexSearcher.java
index e41635c..f732f20 100644
--- a/solr/core/src/test/org/apache/solr/search/TestIndexSearcher.java
+++ b/solr/core/src/test/org/apache/solr/search/TestIndexSearcher.java
@@ -42,11 +42,13 @@ import org.apache.solr.core.SolrCore;
 import org.apache.solr.core.SolrEventListener;
 import org.apache.solr.handler.component.ResponseBuilder;
 import org.apache.solr.handler.component.SearchComponent;
+import org.apache.solr.index.LogDocMergePolicyFactory;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.request.SolrRequestHandler;
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.servlet.DirectSolrConnection;
 import org.apache.solr.util.plugin.SolrCoreAware;
+import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
 public class TestIndexSearcher extends SolrTestCaseJ4 {
@@ -56,11 +58,18 @@ public class TestIndexSearcher extends SolrTestCaseJ4 {
 
     // we need a consistent segmentation because reopen test validation
     // dependso n merges not happening when it doesn't expect
-    System.setProperty("solr.tests.mergePolicy", LogDocMergePolicy.class.getName());
+    systemSetPropertySolrTestsMergePolicy(LogDocMergePolicy.class.getName());
+    systemSetPropertySolrTestsMergePolicyFactory(LogDocMergePolicyFactory.class.getName());
 
     initCore("solrconfig.xml","schema.xml");
   }
   
+  @AfterClass
+  public static void afterClass() {
+    systemClearPropertySolrTestsMergePolicy();
+    systemClearPropertySolrTestsMergePolicyFactory();
+  }
+
   @Override
   public void setUp() throws Exception {
     System.getProperties().remove("tests.solr.useColdSearcher");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java b/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
index 781d547..d35614d 100644
--- a/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
@@ -32,6 +32,7 @@ import org.apache.solr.common.params.MapSolrParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.core.SolrEventListener;
+import org.apache.solr.index.TieredMergePolicyFactory;
 import org.apache.solr.request.LocalSolrQueryRequest;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.search.SolrIndexSearcher;
@@ -56,12 +57,15 @@ public class DirectUpdateHandlerTest extends SolrTestCaseJ4 {
     savedFactory = System.getProperty("solr.DirectoryFactory");
     System.setProperty("solr.directoryFactory", "org.apache.solr.core.MockFSDirectoryFactory");
     System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
-    System.setProperty("solr.tests.mergePolicy", TieredMergePolicy.class.getName());
+    systemSetPropertySolrTestsMergePolicy(TieredMergePolicy.class.getName());
+    systemSetPropertySolrTestsMergePolicyFactory(TieredMergePolicyFactory.class.getName());
     initCore("solrconfig.xml", "schema12.xml");
   }
   
   @AfterClass
   public static void afterClass() {
+    systemClearPropertySolrTestsMergePolicy();
+    systemClearPropertySolrTestsMergePolicyFactory();
     if (savedFactory == null) {
       System.clearProperty("solr.directoryFactory");
     } else {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java b/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java
index 422c3ff..cb35e88 100644
--- a/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java
+++ b/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java
@@ -44,6 +44,7 @@ import org.apache.solr.common.util.NamedList;
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.core.SolrEventListener;
+import org.apache.solr.index.LogDocMergePolicyFactory;
 import org.apache.solr.search.SolrIndexSearcher;
 import org.apache.solr.update.MockStreamingSolrClients.Exp;
 import org.apache.solr.update.SolrCmdDistributor.Error;
@@ -51,6 +52,7 @@ import org.apache.solr.update.SolrCmdDistributor.Node;
 import org.apache.solr.update.SolrCmdDistributor.RetryNode;
 import org.apache.solr.update.SolrCmdDistributor.StdNode;
 import org.apache.solr.update.processor.DistributedUpdateProcessor;
+import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.xml.sax.SAXException;
@@ -63,8 +65,16 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {
   public static void beforeClass() throws Exception {
     // we can't use the Randomized merge policy because the test depends on
     // being able to call optimize to have all deletes expunged.
-    System.setProperty("solr.tests.mergePolicy", LogDocMergePolicy.class.getName());
+    systemSetPropertySolrTestsMergePolicy(LogDocMergePolicy.class.getName());
+    systemSetPropertySolrTestsMergePolicyFactory(LogDocMergePolicyFactory.class.getName());
   }
+
+  @AfterClass
+  public static void afterClass() {
+    systemClearPropertySolrTestsMergePolicy();
+    systemClearPropertySolrTestsMergePolicyFactory();
+  }
+
   private UpdateShardHandler updateShardHandler;
   
   public SolrCmdDistributorTest() throws ParserConfigurationException, IOException, SAXException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b14fb50b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
----------------------------------------------------------------------
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index 66e6712..c80998a 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -128,6 +128,16 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
   public static final String DEFAULT_TEST_CORENAME = DEFAULT_TEST_COLLECTION_NAME;
   protected static final String CORE_PROPERTIES_FILENAME = "core.properties";
 
+  // keep solr.tests.mergePolicyFactory use i.e. do not remove with SOLR-8668
+  public static final String SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICYFACTORY = "solr.tests.mergePolicyFactory";
+  @Deprecated // remove solr.tests.mergePolicy use with SOLR-8668
+  public static final String SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICY = "solr.tests.mergePolicy";
+
+  @Deprecated // remove solr.tests.useMergePolicyFactory with SOLR-8668
+  public static final String SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICYFACTORY = "solr.tests.useMergePolicyFactory";
+  @Deprecated // remove solr.tests.useMergePolicy use with SOLR-8668
+  public static final String SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICY = "solr.tests.useMergePolicy";
+
   private static String coreName = DEFAULT_TEST_CORENAME;
 
   public static int DEFAULT_CONNECTION_TIMEOUT = 60000;  // default socket connection timeout in ms
@@ -2077,4 +2087,39 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
     registeredSearcher.decref();
     newestSearcher.decref();
   }
+
+  @BeforeClass
+  public static void chooseMPForMP() throws Exception {
+    if (random().nextBoolean()) {
+      System.setProperty(SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICYFACTORY, "true");
+      System.setProperty(SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICY, "false");
+    } else {
+      System.setProperty(SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICYFACTORY, "false");
+      System.setProperty(SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICY, "true");
+    }
+  }
+
+  @AfterClass
+  public static void unchooseMPForMP() {
+    System.clearProperty(SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICYFACTORY);
+    System.clearProperty(SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICY);
+  }
+
+  @Deprecated // remove with SOLR-8668
+  protected static void systemSetPropertySolrTestsMergePolicy(String value) {
+    System.setProperty(SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICY, value);
+  }
+
+  @Deprecated // remove with SOLR-8668
+  protected static void systemClearPropertySolrTestsMergePolicy() {
+    System.clearProperty(SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICY);
+  }
+
+  protected static void systemSetPropertySolrTestsMergePolicyFactory(String value) {
+    System.setProperty(SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICYFACTORY, value);
+  }
+
+  protected static void systemClearPropertySolrTestsMergePolicyFactory() {
+    System.clearProperty(SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICYFACTORY);
+  }
 }


[51/53] [abbrv] lucene-solr git commit: SOLR-8029: Merging changes from master

Posted by no...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/core/CoreContainer.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/core/PluginBag.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/handler/BlobHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/handler/CdcrRequestHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/handler/DumpRequestHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/handler/RequestHandlerBase.java
----------------------------------------------------------------------
diff --cc solr/core/src/java/org/apache/solr/handler/RequestHandlerBase.java
index b812661,cf3aa70..6b38edc
--- a/solr/core/src/java/org/apache/solr/handler/RequestHandlerBase.java
+++ b/solr/core/src/java/org/apache/solr/handler/RequestHandlerBase.java
@@@ -14,15 -14,8 +14,14 @@@
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
- 
  package org.apache.solr.handler;
  
 +import java.lang.invoke.MethodHandles;
 +import java.net.URL;
 +import java.util.Collection;
 +import java.util.concurrent.atomic.AtomicLong;
 +
 +import com.google.common.collect.ImmutableList;
  import org.apache.solr.common.SolrException;
  import org.apache.solr.common.params.SolrParams;
  import org.apache.solr.common.util.NamedList;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
----------------------------------------------------------------------
diff --cc solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
index 166120d,046de46..907a2a5
--- a/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
@@@ -16,8 -14,8 +14,9 @@@
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
+ package org.apache.solr.handler;
  
 +
  import java.io.IOException;
  import java.lang.invoke.MethodHandles;
  import java.util.Arrays;
@@@ -40,9 -37,7 +40,10 @@@ import org.apache.solr.schema.IndexSche
  import org.apache.solr.schema.ManagedIndexSchema;
  import org.apache.solr.schema.SchemaManager;
  import org.apache.solr.schema.ZkIndexSchemaReader;
 +import org.apache.solr.api.Api;
 +import org.apache.solr.api.ApiBag;
 +import org.apache.solr.api.ApiSupport;
+ import org.apache.solr.util.plugin.SolrCoreAware;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
@@@ -192,11 -182,7 +191,16 @@@ public class SchemaHandler extends Requ
    }
  
    @Override
+   public void inform(SolrCore core) {
+     isImmutableConfigSet = SolrConfigHandler.getImmutable(core);
+   }
++
++  @Override
 +  public Collection<Api> getApis() {
 +    return ImmutableList.of(
 +        wrapRequestHandler(this, ApiBag.getSpec("core.SchemaRead"), null) ,
 +        wrapRequestHandler(this, ApiBag.getSpec("core.SchemaEdit"), null));
 +  }
 +
 +
  }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
----------------------------------------------------------------------
diff --cc solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
index acafd22,4a6e553..7324a09
--- a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
@@@ -16,8 -14,8 +14,9 @@@
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
+ package org.apache.solr.handler;
  
 +
  import java.io.IOException;
  import java.lang.invoke.MethodHandles;
  import java.util.ArrayList;
@@@ -39,7 -37,7 +38,8 @@@ import java.util.concurrent.TimeUnit
  import java.util.concurrent.locks.Lock;
  import java.util.concurrent.locks.ReentrantLock;
  
+ import com.google.common.base.Strings;
 +import com.google.common.collect.ImmutableList;
  import com.google.common.collect.ImmutableSet;
  import org.apache.solr.client.solrj.SolrClient;
  import org.apache.solr.client.solrj.SolrRequest;
@@@ -51,6 -49,6 +51,7 @@@ import org.apache.solr.common.SolrExcep
  import org.apache.solr.common.cloud.ClusterState;
  import org.apache.solr.common.cloud.Replica;
  import org.apache.solr.common.cloud.Slice;
++import org.apache.solr.common.cloud.ZkNodeProps;
  import org.apache.solr.common.params.CommonParams;
  import org.apache.solr.common.params.MapSolrParams;
  import org.apache.solr.common.params.ModifiableSolrParams;
@@@ -74,16 -71,15 +75,18 @@@ import org.apache.solr.schema.SchemaMan
  import org.apache.solr.util.CommandOperation;
  import org.apache.solr.util.DefaultSolrThreadFactory;
  import org.apache.solr.util.RTimer;
+ import org.apache.solr.util.plugin.SolrCoreAware;
 +import org.apache.solr.api.Api;
 +import org.apache.solr.api.ApiBag;
 +import org.apache.solr.api.ApiSupport;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
 -import static com.google.common.base.Strings.isNullOrEmpty;
  import static java.util.Collections.singletonList;
+ import static org.apache.solr.common.util.Utils.makeMap;
  import static org.apache.solr.common.params.CoreAdminParams.NAME;
  import static org.apache.solr.common.util.StrUtils.formatString;
 +import static org.apache.solr.common.util.Utils.makeMap;
  import static org.apache.solr.core.ConfigOverlay.NOT_EDITABLE;
  import static org.apache.solr.core.ConfigOverlay.ZNODEVER;
  import static org.apache.solr.core.ConfigSetProperties.IMMUTABLE_CONFIGSET_ARG;
@@@ -91,9 -87,8 +94,9 @@@ import static org.apache.solr.core.Solr
  import static org.apache.solr.core.SolrConfig.PluginOpts.REQUIRE_NAME;
  import static org.apache.solr.core.SolrConfig.PluginOpts.REQUIRE_NAME_IN_OVERLAY;
  import static org.apache.solr.schema.FieldType.CLASS_NAME;
 +import static org.apache.solr.api.ApiBag.wrapRequestHandler;
  
- public class SolrConfigHandler extends RequestHandlerBase {
+ public class SolrConfigHandler extends RequestHandlerBase implements SolrCoreAware {
    private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
    public static final String CONFIGSET_EDITING_DISABLED_ARG = "disable.configEdit";
    public static final boolean configEditing_disabled = Boolean.getBoolean(CONFIGSET_EDITING_DISABLED_ARG);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/handler/UpdateRequestHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
----------------------------------------------------------------------
diff --cc solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
index c7b712a,74507d1..fc9464d
--- a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
@@@ -143,10 -118,10 +121,11 @@@ import org.slf4j.LoggerFactory
  import com.google.common.collect.ImmutableList;
  import com.google.common.collect.ImmutableSet;
  
 -public class CollectionsHandler extends RequestHandlerBase {
 +public class CollectionsHandler extends RequestHandlerBase implements ApiSupport {
    private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+ 
    protected final CoreContainer coreContainer;
 +  private final CollectionHandlerApi v2Handler ;
  
    public CollectionsHandler() {
      super();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/handler/admin/InfoHandler.java
----------------------------------------------------------------------
diff --cc solr/core/src/java/org/apache/solr/handler/admin/InfoHandler.java
index 1169e95,9c437ab..cf9e99e
--- a/solr/core/src/java/org/apache/solr/handler/admin/InfoHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/InfoHandler.java
@@@ -16,14 -14,10 +14,15 @@@
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
+ package org.apache.solr.handler.admin;
  
 +import java.util.Collection;
 +import java.util.Collections;
 +import java.util.Locale;
 +import java.util.Map;
 +import java.util.concurrent.ConcurrentHashMap;
 +
  import org.apache.solr.common.SolrException;
 -import org.apache.solr.common.SolrException.ErrorCode;
  import org.apache.solr.common.util.NamedList;
  import org.apache.solr.core.CoreContainer;
  import org.apache.solr.handler.RequestHandlerBase;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
----------------------------------------------------------------------
diff --cc solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
index 7778654,ebee2fc..e94b51d
--- a/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
+++ b/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
@@@ -14,17 -14,10 +14,16 @@@
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
- 
  package org.apache.solr.request;
  
 +import org.apache.solr.api.ApiBag;
 +import org.apache.solr.api.V2HttpCall;
 +import org.apache.solr.common.SolrException;
 +import org.apache.solr.common.util.Map2;
  import org.apache.solr.common.util.SuppressForbidden;
  import org.apache.solr.search.SolrIndexSearcher;
 +import org.apache.solr.servlet.HttpSolrCall;
 +import org.apache.solr.util.CommandOperation;
  import org.apache.solr.util.RTimerTree;
  import org.apache.solr.util.RefCounted;
  import org.apache.solr.schema.IndexSchema;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/schema/SchemaManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/security/BasicAuthPlugin.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/security/RuleBasedAuthorizationPlugin.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/security/Sha256AuthenticationProvider.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/java/org/apache/solr/util/CommandOperation.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/test/org/apache/solr/core/BlobStoreTestRequestHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/test/org/apache/solr/rest/schema/TestBulkSchemaAPI.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
----------------------------------------------------------------------
diff --cc solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
index 083c601,c5d27a9..f1b6fe9
--- a/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
@@@ -16,8 -14,8 +14,10 @@@
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
+ package org.apache.solr.security;
  
 +
++import java.io.IOException;
  import java.lang.invoke.MethodHandles;
  import java.util.ArrayList;
  import java.util.Collections;
@@@ -36,6 -34,6 +36,7 @@@ import org.apache.http.message.Abstract
  import org.apache.http.message.BasicHeader;
  import org.apache.http.util.EntityUtils;
  import org.apache.solr.client.solrj.SolrRequest;
++import org.apache.solr.client.solrj.SolrServerException;
  import org.apache.solr.client.solrj.embedded.JettySolrRunner;
  import org.apache.solr.client.solrj.impl.CloudSolrClient;
  import org.apache.solr.client.solrj.impl.HttpSolrClient;
@@@ -54,6 -54,6 +57,7 @@@ import org.apache.solr.common.util.Cont
  import org.apache.solr.common.util.NamedList;
  import org.apache.solr.common.util.StrUtils;
  import org.apache.solr.common.util.Utils;
++import org.apache.solr.util.CommandOperation;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
@@@ -73,10 -73,7 +77,11 @@@ public class BasicAuthIntegrationTest e
  
      String authcPrefix = "/admin/authentication";
      String authzPrefix = "/admin/authorization";
 +    if(random().nextBoolean()){
 +      authcPrefix = "/v2/cluster/security/authentication";
 +      authzPrefix = "/v2/cluster/security/authorization";
 +    }
+ 
      String old = cloudSolrClient.getDefaultCollection();
      cloudSolrClient.setDefaultCollection(null);
  

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/solrj/src/java/org/apache/solr/common/util/Utils.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ddeb53dd/solr/test-framework/src/java/org/apache/solr/util/RestTestHarness.java
----------------------------------------------------------------------


[19/53] [abbrv] lucene-solr git commit: SOLR-8575: Add missing assert.

Posted by no...@apache.org.
SOLR-8575: Add missing assert.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/2fd90cd4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/2fd90cd4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/2fd90cd4

Branch: refs/heads/apiv2
Commit: 2fd90cd4893952f5150e34ed70e86d3e85f61458
Parents: 206a2b8
Author: markrmiller <ma...@apache.org>
Authored: Sat Feb 20 20:35:21 2016 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Sat Feb 20 20:35:21 2016 -0500

----------------------------------------------------------------------
 solr/core/src/java/org/apache/solr/update/UpdateLog.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2fd90cd4/solr/core/src/java/org/apache/solr/update/UpdateLog.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/UpdateLog.java b/solr/core/src/java/org/apache/solr/update/UpdateLog.java
index 4b6f7c2..2f55e40 100644
--- a/solr/core/src/java/org/apache/solr/update/UpdateLog.java
+++ b/solr/core/src/java/org/apache/solr/update/UpdateLog.java
@@ -1440,7 +1440,7 @@ public class UpdateLog implements PluginInfoInitialized {
             loglog.warn("REPLAY_ERR: Exception replaying log", ex);
             // something wrong with the request?
           }
-          TestInjection.injectUpdateLogReplayRandomPause();
+          assert TestInjection.injectUpdateLogReplayRandomPause();
         }
 
         CommitUpdateCommand cmd = new CommitUpdateCommand(req, false);


[53/53] [abbrv] lucene-solr git commit: SOLR-8029: Merging changes from master

Posted by no...@apache.org.
SOLR-8029: Merging changes from master


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c0b91afb
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c0b91afb
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c0b91afb

Branch: refs/heads/apiv2
Commit: c0b91afb94387b59eaca699831fedf015879c96b
Parents: ddeb53d
Author: Noble Paul <no...@apache.org>
Authored: Wed Feb 24 11:39:18 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Wed Feb 24 11:39:18 2016 +0530

----------------------------------------------------------------------
 solr/core/src/java/org/apache/solr/handler/SchemaHandler.java      | 2 +-
 solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java  | 2 +-
 solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java       | 1 -
 solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java | 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c0b91afb/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java b/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
index 907a2a5..ea9381a 100644
--- a/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
@@ -51,7 +51,7 @@ import static org.apache.solr.common.params.CommonParams.JSON;
 import static org.apache.solr.core.ConfigSetProperties.IMMUTABLE_CONFIGSET_ARG;
 import static org.apache.solr.api.ApiBag.wrapRequestHandler;
 
-public class SchemaHandler extends RequestHandlerBase implements ApiSupport {
+public class SchemaHandler extends RequestHandlerBase implements ApiSupport , SolrCoreAware {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   private boolean isImmutableConfigSet = false;
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c0b91afb/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
index 7324a09..8f4a71a 100644
--- a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
@@ -38,7 +38,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
-import com.google.common.base.Strings;
+import static com.google.common.base.Strings.isNullOrEmpty;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import org.apache.solr.client.solrj.SolrClient;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c0b91afb/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
index 6c7578b..fe368be 100644
--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
@@ -155,7 +155,6 @@ public class HttpSolrCall {
   protected String coreUrl;
   protected SolrConfig config;
   protected Map<String, Integer> invalidStates;
-  protected RequestType requestType;
   protected boolean usingAliases = false;
 
   //The states of client that is invalid in this request

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c0b91afb/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java b/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
index 0ae0865..f65ee7a 100644
--- a/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
+++ b/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
@@ -78,7 +78,7 @@ public class TestSolrConfigHandler extends RestTestBase {
 
     createJettyAndHarness(tmpSolrHome.getAbsolutePath(), "solrconfig-managed-schema.xml", "schema-rest.xml",
         "/solr", true, extraServlets);
-    if (true) {
+    if (random().nextBoolean()) {
       log.info("These tests are run with V2 API");
       restTestHarness.setServerProvider(new RESTfulServerProvider() {
         @Override


[10/53] [abbrv] lucene-solr git commit: SOLR-8695: Ensure ZK watchers are not triggering our watch logic on connection events and make this handling more consistent.

Posted by no...@apache.org.
SOLR-8695: Ensure ZK watchers are not triggering our watch logic on connection events and make this handling more consistent.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e30d638c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e30d638c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e30d638c

Branch: refs/heads/apiv2
Commit: e30d638c51f9c6cf9d462741d05e91302ff4b56d
Parents: 32fbca6
Author: markrmiller <ma...@apache.org>
Authored: Fri Feb 19 14:36:53 2016 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Fri Feb 19 14:36:53 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  3 +++
 .../org/apache/solr/cloud/LeaderElector.java    |  3 +--
 .../apache/solr/cloud/OverseerTaskQueue.java    | 10 +++++---
 .../org/apache/solr/cloud/ZkController.java     |  3 ++-
 .../solr/handler/CdcrBufferStateManager.java    |  1 +
 .../solr/handler/CdcrLeaderStateManager.java    |  1 +
 .../solr/handler/CdcrProcessStateManager.java   |  1 +
 .../handler/admin/ZookeeperInfoHandler.java     |  4 +++
 .../apache/solr/common/cloud/ZkStateReader.java | 26 ++++++++------------
 9 files changed, 29 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e30d638c/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index c0c8856..f64f552 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -184,6 +184,9 @@ Bug Fixes
 
 * SOLR-8694: DistributedMap/Queue can create too many Watchers and some code simplification. 
   (Scott Blum via Mark Miller)
+  
+* SOLR-8695: Ensure ZK watchers are not triggering our watch logic on connection events and
+  make this handling more consistent. (Scott Blum via Mark Miller)
 
 Optimizations
 ----------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e30d638c/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java b/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
index 056b4b9..af27f00 100644
--- a/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
+++ b/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
@@ -367,8 +367,7 @@ public  class LeaderElector {
 
     @Override
     public void process(WatchedEvent event) {
-      // session events are not change events,
-      // and do not remove the watcher
+      // session events are not change events, and do not remove the watcher
       if (EventType.None.equals(event.getType())) {
         return;
       }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e30d638c/solr/core/src/java/org/apache/solr/cloud/OverseerTaskQueue.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/OverseerTaskQueue.java b/solr/core/src/java/org/apache/solr/cloud/OverseerTaskQueue.java
index ea219d3..cf9d583 100644
--- a/solr/core/src/java/org/apache/solr/cloud/OverseerTaskQueue.java
+++ b/solr/core/src/java/org/apache/solr/cloud/OverseerTaskQueue.java
@@ -129,11 +129,13 @@ public class OverseerTaskQueue extends DistributedQueue {
 
     @Override
     public void process(WatchedEvent event) {
-      Event.EventType eventType = event.getType();
-      // None events are ignored
+      // session events are not change events, and do not remove the watcher
+      if (Event.EventType.None.equals(event.getType())) {
+        return;
+      }
       // If latchEventType is not null, only fire if the type matches
-      LOG.info("{} fired on path {} state {} latchEventType {}", eventType, event.getPath(), event.getState(), latchEventType);
-      if (eventType != Event.EventType.None && (latchEventType == null || eventType == latchEventType)) {
+      LOG.info("{} fired on path {} state {} latchEventType {}", event.getType(), event.getPath(), event.getState(), latchEventType);
+      if (latchEventType == null || event.getType() == latchEventType) {
         synchronized (lock) {
           this.event = event;
           lock.notifyAll();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e30d638c/solr/core/src/java/org/apache/solr/cloud/ZkController.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
index e436716..7874e2b 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
@@ -2365,7 +2365,8 @@ public final class ZkController {
 
     @Override
     public void process(WatchedEvent event) {
-      if (event.getState() == Event.KeeperState.Disconnected || event.getState() == Event.KeeperState.Expired)  {
+      // session events are not change events, and do not remove the watcher
+      if (Event.EventType.None.equals(event.getType())) {
         return;
       }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e30d638c/solr/core/src/java/org/apache/solr/handler/CdcrBufferStateManager.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/CdcrBufferStateManager.java b/solr/core/src/java/org/apache/solr/handler/CdcrBufferStateManager.java
index 18c7d05..713d6fc 100644
--- a/solr/core/src/java/org/apache/solr/handler/CdcrBufferStateManager.java
+++ b/solr/core/src/java/org/apache/solr/handler/CdcrBufferStateManager.java
@@ -154,6 +154,7 @@ class CdcrBufferStateManager extends CdcrStateManager {
       String shard = core.getCoreDescriptor().getCloudDescriptor().getShardId();
 
       log.info("The CDCR buffer state has changed: {} @ {}:{}", event, collectionName, shard);
+      // session events are not change events, and do not remove the watcher
       if (Event.EventType.None.equals(event.getType())) {
         return;
       }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e30d638c/solr/core/src/java/org/apache/solr/handler/CdcrLeaderStateManager.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/CdcrLeaderStateManager.java b/solr/core/src/java/org/apache/solr/handler/CdcrLeaderStateManager.java
index 59313d3..7d8ddc4 100644
--- a/solr/core/src/java/org/apache/solr/handler/CdcrLeaderStateManager.java
+++ b/solr/core/src/java/org/apache/solr/handler/CdcrLeaderStateManager.java
@@ -137,6 +137,7 @@ class CdcrLeaderStateManager extends CdcrStateManager {
       String shard = core.getCoreDescriptor().getCloudDescriptor().getShardId();
 
       log.debug("The leader state has changed: {} @ {}:{}", event, collectionName, shard);
+      // session events are not change events, and do not remove the watcher
       if (Event.EventType.None.equals(event.getType())) {
         return;
       }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e30d638c/solr/core/src/java/org/apache/solr/handler/CdcrProcessStateManager.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/CdcrProcessStateManager.java b/solr/core/src/java/org/apache/solr/handler/CdcrProcessStateManager.java
index 7630702..b1c8dda 100644
--- a/solr/core/src/java/org/apache/solr/handler/CdcrProcessStateManager.java
+++ b/solr/core/src/java/org/apache/solr/handler/CdcrProcessStateManager.java
@@ -154,6 +154,7 @@ class CdcrProcessStateManager extends CdcrStateManager {
       String shard = core.getCoreDescriptor().getCloudDescriptor().getShardId();
 
       log.info("The CDCR process state has changed: {} @ {}:{}", event, collectionName, shard);
+      // session events are not change events, and do not remove the watcher
       if (Event.EventType.None.equals(event.getType())) {
         return;
       }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e30d638c/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java
index 8bc2130..e2ce63d 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java
@@ -248,6 +248,10 @@ public final class ZookeeperInfoHandler extends RequestHandlerBase {
      */
     @Override
     public void process(WatchedEvent event) {
+      // session events are not change events, and do not remove the watcher
+      if (Event.EventType.None.equals(event.getType())) {
+        return;
+      }
       synchronized (this) {
         cachedCollections = null;
       }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e30d638c/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
index bfe89e3..910b47e 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
@@ -306,8 +306,7 @@ public class ZkStateReader implements Closeable {
             
             @Override
             public void process(WatchedEvent event) {
-              // session events are not change events,
-              // and do not remove the watcher
+              // session events are not change events, and do not remove the watcher
               if (EventType.None.equals(event.getType())) {
                 return;
               }
@@ -359,8 +358,7 @@ public class ZkStateReader implements Closeable {
 
           @Override
           public void process(WatchedEvent event) {
-            // session events are not change events,
-            // and do not remove the watcher
+            // session events are not change events, and do not remove the watcher
             if (EventType.None.equals(event.getType())) {
               return;
             }
@@ -797,15 +795,14 @@ public class ZkStateReader implements Closeable {
 
     @Override
     public void process(WatchedEvent event) {
-      if (!interestingCollections.contains(coll)) {
-        // This collection is no longer interesting, stop watching.
-        LOG.info("Uninteresting collection [{}]", coll);
+      // session events are not change events, and do not remove the watcher
+      if (EventType.None.equals(event.getType())) {
         return;
       }
 
-      // session events are not change events,
-      // and do not remove the watcher
-      if (EventType.None.equals(event.getType())) {
+      if (!interestingCollections.contains(coll)) {
+        // This collection is no longer interesting, stop watching.
+        LOG.info("Uninteresting collection {}", coll);
         return;
       }
 
@@ -852,8 +849,7 @@ public class ZkStateReader implements Closeable {
 
     @Override
     public void process(WatchedEvent event) {
-      // session events are not change events,
-      // and do not remove the watcher
+      // session events are not change events, and do not remove the watcher
       if (EventType.None.equals(event.getType())) {
         return;
       }
@@ -890,8 +886,7 @@ public class ZkStateReader implements Closeable {
 
     @Override
     public void process(WatchedEvent event) {
-      // session events are not change events,
-      // and do not remove the watcher
+      // session events are not change events, and do not remove the watcher
       if (EventType.None.equals(event.getType())) {
         return;
       }
@@ -924,8 +919,7 @@ public class ZkStateReader implements Closeable {
 
     @Override
     public void process(WatchedEvent event) {
-      // session events are not change events,
-      // and do not remove the watcher
+      // session events are not change events, and do not remove the watcher
       if (EventType.None.equals(event.getType())) {
         return;
       }


[49/53] [abbrv] lucene-solr git commit: Merge remote-tracking branch 'origin/master'

Posted by no...@apache.org.
Merge remote-tracking branch 'origin/master'


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a33236aa
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a33236aa
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a33236aa

Branch: refs/heads/apiv2
Commit: a33236aa02b3cc71d45974f2f0fefafbe1cf7a6b
Parents: 4d9d0c0 a77d67a
Author: Noble Paul <no...@apache.org>
Authored: Tue Feb 23 16:15:28 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Tue Feb 23 16:15:28 2016 +0530

----------------------------------------------------------------------
 lucene/ivy-versions.properties                  |   4 +-
 solr/contrib/clustering/ivy.xml                 |   3 -
 solr/licenses/attributes-binder-1.2.3.jar.sha1  |   1 -
 solr/licenses/attributes-binder-1.3.1.jar.sha1  |   1 +
 solr/licenses/mahout-collections-1.0.jar.sha1   |   1 -
 .../licenses/mahout-collections-LICENSE-ASL.txt | 202 -------------------
 solr/licenses/mahout-collections-NOTICE.txt     |  56 -----
 solr/licenses/mahout-math-0.6.jar.sha1          |   1 -
 solr/licenses/mahout-math-LICENSE-ASL.txt       | 202 -------------------
 solr/licenses/mahout-math-NOTICE.txt            |  56 -----
 10 files changed, 2 insertions(+), 525 deletions(-)
----------------------------------------------------------------------



[40/53] [abbrv] lucene-solr git commit: LUCENE-7042: more cleanup for Point encodings

Posted by no...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java b/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java
index 763d9e5..3ff5375 100644
--- a/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java
+++ b/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java
@@ -55,15 +55,6 @@ public final class RamUsageEstimator {
   /** No instantiation. */
   private RamUsageEstimator() {}
 
-  public final static int NUM_BYTES_BOOLEAN = 1;
-  public final static int NUM_BYTES_BYTE = 1;
-  public final static int NUM_BYTES_CHAR = 2;
-  public final static int NUM_BYTES_SHORT = 2;
-  public final static int NUM_BYTES_INT = 4;
-  public final static int NUM_BYTES_FLOAT = 4;
-  public final static int NUM_BYTES_LONG = 8;
-  public final static int NUM_BYTES_DOUBLE = 8;
-
   /** 
    * True, iff compressed references (oops) are enabled by this JVM 
    */
@@ -95,14 +86,14 @@ public final class RamUsageEstimator {
    */
   private static final Map<Class<?>,Integer> primitiveSizes = new IdentityHashMap<>();
   static {
-    primitiveSizes.put(boolean.class, Integer.valueOf(NUM_BYTES_BOOLEAN));
-    primitiveSizes.put(byte.class, Integer.valueOf(NUM_BYTES_BYTE));
-    primitiveSizes.put(char.class, Integer.valueOf(NUM_BYTES_CHAR));
-    primitiveSizes.put(short.class, Integer.valueOf(NUM_BYTES_SHORT));
-    primitiveSizes.put(int.class, Integer.valueOf(NUM_BYTES_INT));
-    primitiveSizes.put(float.class, Integer.valueOf(NUM_BYTES_FLOAT));
-    primitiveSizes.put(double.class, Integer.valueOf(NUM_BYTES_DOUBLE));
-    primitiveSizes.put(long.class, Integer.valueOf(NUM_BYTES_LONG));
+    primitiveSizes.put(boolean.class, 1);
+    primitiveSizes.put(byte.class, 1);
+    primitiveSizes.put(char.class, Integer.valueOf(Character.BYTES));
+    primitiveSizes.put(short.class, Integer.valueOf(Short.BYTES));
+    primitiveSizes.put(int.class, Integer.valueOf(Integer.BYTES));
+    primitiveSizes.put(float.class, Integer.valueOf(Float.BYTES));
+    primitiveSizes.put(double.class, Integer.valueOf(Double.BYTES));
+    primitiveSizes.put(long.class, Integer.valueOf(Long.BYTES));
   }
 
   /**
@@ -165,7 +156,7 @@ public final class RamUsageEstimator {
       // "best guess" based on reference size:
       NUM_BYTES_OBJECT_HEADER = 8 + NUM_BYTES_OBJECT_REF;
       // array header is NUM_BYTES_OBJECT_HEADER + NUM_BYTES_INT, but aligned (object alignment):
-      NUM_BYTES_ARRAY_HEADER = (int) alignObjectSize(NUM_BYTES_OBJECT_HEADER + NUM_BYTES_INT);
+      NUM_BYTES_ARRAY_HEADER = (int) alignObjectSize(NUM_BYTES_OBJECT_HEADER + Integer.BYTES);
     } else {
       JVM_IS_HOTSPOT_64BIT = false;
       COMPRESSED_REFS_ENABLED = false;
@@ -173,7 +164,7 @@ public final class RamUsageEstimator {
       NUM_BYTES_OBJECT_REF = 4;
       NUM_BYTES_OBJECT_HEADER = 8;
       // For 32 bit JVMs, no extra alignment of array header:
-      NUM_BYTES_ARRAY_HEADER = NUM_BYTES_OBJECT_HEADER + NUM_BYTES_INT;
+      NUM_BYTES_ARRAY_HEADER = NUM_BYTES_OBJECT_HEADER + Integer.BYTES;
     }
 
     // get min/max value of cached Long class instances:
@@ -223,32 +214,32 @@ public final class RamUsageEstimator {
   
   /** Returns the size in bytes of the char[] object. */
   public static long sizeOf(char[] arr) {
-    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) NUM_BYTES_CHAR * arr.length);
+    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) Character.BYTES * arr.length);
   }
 
   /** Returns the size in bytes of the short[] object. */
   public static long sizeOf(short[] arr) {
-    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) NUM_BYTES_SHORT * arr.length);
+    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) Short.BYTES * arr.length);
   }
   
   /** Returns the size in bytes of the int[] object. */
   public static long sizeOf(int[] arr) {
-    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) NUM_BYTES_INT * arr.length);
+    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) Integer.BYTES * arr.length);
   }
   
   /** Returns the size in bytes of the float[] object. */
   public static long sizeOf(float[] arr) {
-    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) NUM_BYTES_FLOAT * arr.length);
+    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) Float.BYTES * arr.length);
   }
   
   /** Returns the size in bytes of the long[] object. */
   public static long sizeOf(long[] arr) {
-    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) NUM_BYTES_LONG * arr.length);
+    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) Long.BYTES * arr.length);
   }
   
   /** Returns the size in bytes of the double[] object. */
   public static long sizeOf(double[] arr) {
-    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) NUM_BYTES_DOUBLE * arr.length);
+    return alignObjectSize((long) NUM_BYTES_ARRAY_HEADER + (long) Double.BYTES * arr.length);
   }
 
   /** Returns the shallow size in bytes of the Object[] object. */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/RecyclingIntBlockAllocator.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/RecyclingIntBlockAllocator.java b/lucene/core/src/java/org/apache/lucene/util/RecyclingIntBlockAllocator.java
index 437426c..57ba1bd 100644
--- a/lucene/core/src/java/org/apache/lucene/util/RecyclingIntBlockAllocator.java
+++ b/lucene/core/src/java/org/apache/lucene/util/RecyclingIntBlockAllocator.java
@@ -78,7 +78,7 @@ public final class RecyclingIntBlockAllocator extends Allocator {
   @Override
   public int[] getIntBlock() {
     if (freeBlocks == 0) {
-      bytesUsed.addAndGet(blockSize*RamUsageEstimator.NUM_BYTES_INT);
+      bytesUsed.addAndGet(blockSize*Integer.BYTES);
       return new int[blockSize];
     }
     final int[] b = freeByteBlocks[--freeBlocks];
@@ -104,7 +104,7 @@ public final class RecyclingIntBlockAllocator extends Allocator {
     for (int i = stop; i < end; i++) {
       blocks[i] = null;
     }
-    bytesUsed.addAndGet(-(end - stop) * (blockSize * RamUsageEstimator.NUM_BYTES_INT));
+    bytesUsed.addAndGet(-(end - stop) * (blockSize * Integer.BYTES));
     assert bytesUsed.get() >= 0;
   }
 
@@ -150,7 +150,7 @@ public final class RecyclingIntBlockAllocator extends Allocator {
     while (freeBlocks > stop) {
       freeByteBlocks[--freeBlocks] = null;
     }
-    bytesUsed.addAndGet(-count*blockSize* RamUsageEstimator.NUM_BYTES_INT);
+    bytesUsed.addAndGet(-count*blockSize*Integer.BYTES);
     assert bytesUsed.get() >= 0;
     return count;
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/SentinelIntSet.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/SentinelIntSet.java b/lucene/core/src/java/org/apache/lucene/util/SentinelIntSet.java
index 46162d9..3fc1b57 100644
--- a/lucene/core/src/java/org/apache/lucene/util/SentinelIntSet.java
+++ b/lucene/core/src/java/org/apache/lucene/util/SentinelIntSet.java
@@ -149,7 +149,7 @@ public class SentinelIntSet {
   /** Return the memory footprint of this class in bytes. */
   public long ramBytesUsed() {
     return RamUsageEstimator.alignObjectSize(
-          RamUsageEstimator.NUM_BYTES_INT * 3
+          Integer.BYTES * 3
         + RamUsageEstimator.NUM_BYTES_OBJECT_REF)
         + RamUsageEstimator.sizeOf(keys);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java b/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java
index 6c26a87..42f28ed 100644
--- a/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java
+++ b/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java
@@ -893,7 +893,7 @@ public class Automaton implements Accountable {
     return RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + RamUsageEstimator.sizeOf(states) + RamUsageEstimator.sizeOf(transitions) +
       RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + (isAccept.size() / 8) + RamUsageEstimator.NUM_BYTES_OBJECT_REF +
       2 * RamUsageEstimator.NUM_BYTES_OBJECT_REF +
-      3 * RamUsageEstimator.NUM_BYTES_INT +
-      RamUsageEstimator.NUM_BYTES_BOOLEAN;
+      3 * Integer.BYTES +
+      1;
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/automaton/SortedIntSet.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/SortedIntSet.java b/lucene/core/src/java/org/apache/lucene/util/automaton/SortedIntSet.java
index 38218a5..3251aad 100644
--- a/lucene/core/src/java/org/apache/lucene/util/automaton/SortedIntSet.java
+++ b/lucene/core/src/java/org/apache/lucene/util/automaton/SortedIntSet.java
@@ -16,11 +16,9 @@
  */
 package org.apache.lucene.util.automaton;
 
-
 import java.util.TreeMap;
 import java.util.Map;
 import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.RamUsageEstimator;
 
 // Just holds a set of int[] states, plus a corresponding
 // int[] count per state.  Used by
@@ -135,7 +133,7 @@ final class SortedIntSet {
   public void computeHash() {
     if (useTreeMap) {
       if (map.size() > values.length) {
-        final int size = ArrayUtil.oversize(map.size(), RamUsageEstimator.NUM_BYTES_INT);
+        final int size = ArrayUtil.oversize(map.size(), Integer.BYTES);
         values = new int[size];
         counts = new int[size];
       }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDReader.java b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDReader.java
index 8a3986e..1067f4b 100644
--- a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDReader.java
+++ b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDReader.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.util.bkd;
 
-
 import java.io.IOException;
 import java.util.Arrays;
 
@@ -27,7 +26,6 @@ import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.util.Accountable;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.NumericUtils;
-import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.lucene.util.StringHelper;
 
 /** Handles intersection of an multi-dimensional shape in byte[] space with a block KD-tree previously written with {@link BKDWriter}.
@@ -415,7 +413,7 @@ public class BKDReader implements Accountable {
   @Override
   public long ramBytesUsed() {
     return splitPackedValues.length +
-      leafBlockFPs.length * RamUsageEstimator.NUM_BYTES_LONG;
+      leafBlockFPs.length * Long.BYTES;
   }
 
   public byte[] getMinPackedValue() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
index 0d3f8fc..62c5264 100644
--- a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.util.bkd;
 
-
 import java.io.Closeable;
 import java.io.EOFException;
 import java.io.IOException;
@@ -40,9 +39,7 @@ import org.apache.lucene.util.IntroSorter;
 import org.apache.lucene.util.LongBitSet;
 import org.apache.lucene.util.NumericUtils;
 import org.apache.lucene.util.OfflineSorter;
-import org.apache.lucene.util.OfflineSorter.ByteSequencesWriter;
 import org.apache.lucene.util.PriorityQueue;
-import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.lucene.util.StringHelper;
 
 // TODO
@@ -152,7 +149,7 @@ public class BKDWriter implements Closeable {
     maxPackedValue = new byte[packedBytesLength];
 
     // dimensional values (numDims * bytesPerDim) + ord (long) + docID (int)
-    bytesPerDoc = packedBytesLength + RamUsageEstimator.NUM_BYTES_LONG + RamUsageEstimator.NUM_BYTES_INT;
+    bytesPerDoc = packedBytesLength + Long.BYTES + Integer.BYTES;
 
     // As we recurse, we compute temporary partitions of the data, halving the
     // number of points at each recursion.  Once there are few enough points,

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/bkd/HeapPointWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/HeapPointWriter.java b/lucene/core/src/java/org/apache/lucene/util/bkd/HeapPointWriter.java
index ae247c9..0236187 100644
--- a/lucene/core/src/java/org/apache/lucene/util/bkd/HeapPointWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/bkd/HeapPointWriter.java
@@ -16,12 +16,10 @@
  */
 package org.apache.lucene.util.bkd;
 
-
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.RamUsageEstimator;
 
 final class HeapPointWriter implements PointWriter {
   int[] docIDs;
@@ -94,7 +92,7 @@ final class HeapPointWriter implements PointWriter {
     assert closed == false;
     assert packedValue.length == packedBytesLength;
     if (ords.length == nextWrite) {
-      int nextSize = Math.min(maxSize, ArrayUtil.oversize(nextWrite+1, RamUsageEstimator.NUM_BYTES_INT));
+      int nextSize = Math.min(maxSize, ArrayUtil.oversize(nextWrite+1, Integer.BYTES));
       assert nextSize > nextWrite: "nextSize=" + nextSize + " vs nextWrite=" + nextWrite;
       ords = growExact(ords, nextSize);
       docIDs = growExact(docIDs, nextSize);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointReader.java b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointReader.java
index ad85238..14d714c 100644
--- a/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointReader.java
+++ b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointReader.java
@@ -16,15 +16,12 @@
  */
 package org.apache.lucene.util.bkd;
 
-
 import java.io.EOFException;
 import java.io.IOException;
 
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
-import org.apache.lucene.util.BytesRefBuilder;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /** Reads points from disk in a fixed-with format, previously written with {@link OfflinePointWriter}. */
 final class OfflinePointReader implements PointReader {
@@ -41,7 +38,7 @@ final class OfflinePointReader implements PointReader {
 
   private OfflinePointReader(IndexInput in, int packedBytesLength, long start, long length) throws IOException {
     this.in = in;
-    bytesPerDoc = packedBytesLength + RamUsageEstimator.NUM_BYTES_LONG + RamUsageEstimator.NUM_BYTES_INT;
+    bytesPerDoc = packedBytesLength + Long.BYTES + Integer.BYTES;
     long seekFP = start * bytesPerDoc;
     in.seek(seekFP);
     this.countLeft = length;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
index ba1b71c..f47f567 100644
--- a/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
@@ -16,13 +16,11 @@
  */
 package org.apache.lucene.util.bkd;
 
-
 import java.io.IOException;
 
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexOutput;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /** Writes points to disk in a fixed-with format. */
 final class OfflinePointWriter implements PointWriter {
@@ -38,7 +36,7 @@ final class OfflinePointWriter implements PointWriter {
     this.out = tempDir.createTempOutput(tempFileNamePrefix, "bkd", IOContext.DEFAULT);
     this.tempDir = tempDir;
     this.packedBytesLength = packedBytesLength;
-    bytesPerDoc = packedBytesLength + RamUsageEstimator.NUM_BYTES_LONG + RamUsageEstimator.NUM_BYTES_INT;
+    bytesPerDoc = packedBytesLength + Long.BYTES + Integer.BYTES;
   }
 
   /** Initializes on an already written/closed file, just so consumers can use {@link #getReader} to read the file. */
@@ -46,7 +44,7 @@ final class OfflinePointWriter implements PointWriter {
     this.out = out;
     this.tempDir = tempDir;
     this.packedBytesLength = packedBytesLength;
-    bytesPerDoc = packedBytesLength + RamUsageEstimator.NUM_BYTES_LONG + RamUsageEstimator.NUM_BYTES_INT;
+    bytesPerDoc = packedBytesLength + Long.BYTES + Integer.BYTES;
     this.count = count;
     closed = true;
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java b/lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java
index 13ab6f9..c5fac1e 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java
@@ -101,8 +101,8 @@ abstract class AbstractPagedMutable<T extends AbstractPagedMutable<T>> extends L
   protected long baseRamBytesUsed() {
     return RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
         + RamUsageEstimator.NUM_BYTES_OBJECT_REF
-        + RamUsageEstimator.NUM_BYTES_LONG
-        + 3 * RamUsageEstimator.NUM_BYTES_INT;
+        + Long.BYTES
+        + 3 * Integer.BYTES;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/Direct16.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/Direct16.java b/lucene/core/src/java/org/apache/lucene/util/packed/Direct16.java
index 82281a9e..3fda7c3 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/Direct16.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/Direct16.java
@@ -62,7 +62,7 @@ final class Direct16 extends PackedInts.MutableImpl {
   public long ramBytesUsed() {
     return RamUsageEstimator.alignObjectSize(
         RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
-        + 2 * RamUsageEstimator.NUM_BYTES_INT     // valueCount,bitsPerValue
+        + 2 * Integer.BYTES     // valueCount,bitsPerValue
         + RamUsageEstimator.NUM_BYTES_OBJECT_REF) // values ref
         + RamUsageEstimator.sizeOf(values);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/Direct32.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/Direct32.java b/lucene/core/src/java/org/apache/lucene/util/packed/Direct32.java
index 502aa3f..aec9eaf 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/Direct32.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/Direct32.java
@@ -62,7 +62,7 @@ final class Direct32 extends PackedInts.MutableImpl {
   public long ramBytesUsed() {
     return RamUsageEstimator.alignObjectSize(
         RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
-        + 2 * RamUsageEstimator.NUM_BYTES_INT     // valueCount,bitsPerValue
+        + 2 * Integer.BYTES     // valueCount,bitsPerValue
         + RamUsageEstimator.NUM_BYTES_OBJECT_REF) // values ref
         + RamUsageEstimator.sizeOf(values);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/Direct64.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/Direct64.java b/lucene/core/src/java/org/apache/lucene/util/packed/Direct64.java
index 106f641..b8e06b6 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/Direct64.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/Direct64.java
@@ -57,7 +57,7 @@ final class Direct64 extends PackedInts.MutableImpl {
   public long ramBytesUsed() {
     return RamUsageEstimator.alignObjectSize(
         RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
-        + 2 * RamUsageEstimator.NUM_BYTES_INT     // valueCount,bitsPerValue
+        + 2 * Integer.BYTES     // valueCount,bitsPerValue
         + RamUsageEstimator.NUM_BYTES_OBJECT_REF) // values ref
         + RamUsageEstimator.sizeOf(values);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/Direct8.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/Direct8.java b/lucene/core/src/java/org/apache/lucene/util/packed/Direct8.java
index 27986c0..81fc5a9 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/Direct8.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/Direct8.java
@@ -60,7 +60,7 @@ final class Direct8 extends PackedInts.MutableImpl {
   public long ramBytesUsed() {
     return RamUsageEstimator.alignObjectSize(
         RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
-        + 2 * RamUsageEstimator.NUM_BYTES_INT     // valueCount,bitsPerValue
+        + 2 * Integer.BYTES     // valueCount,bitsPerValue
         + RamUsageEstimator.NUM_BYTES_OBJECT_REF) // values ref
         + RamUsageEstimator.sizeOf(values);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/GrowableWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/GrowableWriter.java b/lucene/core/src/java/org/apache/lucene/util/packed/GrowableWriter.java
index 76d3ecc..a4d97f4 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/GrowableWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/GrowableWriter.java
@@ -131,8 +131,8 @@ public class GrowableWriter extends PackedInts.Mutable {
     return RamUsageEstimator.alignObjectSize(
         RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
         + RamUsageEstimator.NUM_BYTES_OBJECT_REF
-        + RamUsageEstimator.NUM_BYTES_LONG
-        + RamUsageEstimator.NUM_BYTES_FLOAT)
+        + Long.BYTES
+        + Float.BYTES)
         + current.ramBytesUsed();
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/Packed16ThreeBlocks.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/Packed16ThreeBlocks.java b/lucene/core/src/java/org/apache/lucene/util/packed/Packed16ThreeBlocks.java
index 8e8e94d..02f4e41 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/Packed16ThreeBlocks.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/Packed16ThreeBlocks.java
@@ -112,7 +112,7 @@ final class Packed16ThreeBlocks extends PackedInts.MutableImpl {
   public long ramBytesUsed() {
     return RamUsageEstimator.alignObjectSize(
         RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
-        + 2 * RamUsageEstimator.NUM_BYTES_INT     // valueCount,bitsPerValue
+        + 2 * Integer.BYTES     // valueCount,bitsPerValue
         + RamUsageEstimator.NUM_BYTES_OBJECT_REF) // blocks ref
         + RamUsageEstimator.sizeOf(blocks);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/Packed64.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/Packed64.java b/lucene/core/src/java/org/apache/lucene/util/packed/Packed64.java
index ae43032..c78feaf 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/Packed64.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/Packed64.java
@@ -246,8 +246,8 @@ class Packed64 extends PackedInts.MutableImpl {
   public long ramBytesUsed() {
     return RamUsageEstimator.alignObjectSize(
         RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
-        + 3 * RamUsageEstimator.NUM_BYTES_INT     // bpvMinusBlockSize,valueCount,bitsPerValue
-        + RamUsageEstimator.NUM_BYTES_LONG        // maskRight
+        + 3 * Integer.BYTES   // bpvMinusBlockSize,valueCount,bitsPerValue
+        + Long.BYTES          // maskRight
         + RamUsageEstimator.NUM_BYTES_OBJECT_REF) // blocks ref
         + RamUsageEstimator.sizeOf(blocks);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlock.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlock.java b/lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlock.java
index a7262b3..85e7ea8 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlock.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlock.java
@@ -61,7 +61,7 @@ abstract class Packed64SingleBlock extends PackedInts.MutableImpl {
   public long ramBytesUsed() {
     return RamUsageEstimator.alignObjectSize(
         RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
-        + 2 * RamUsageEstimator.NUM_BYTES_INT     // valueCount,bitsPerValue
+        + 2 * Integer.BYTES     // valueCount,bitsPerValue
         + RamUsageEstimator.NUM_BYTES_OBJECT_REF) // blocks ref
         + RamUsageEstimator.sizeOf(blocks);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/Packed8ThreeBlocks.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/Packed8ThreeBlocks.java b/lucene/core/src/java/org/apache/lucene/util/packed/Packed8ThreeBlocks.java
index 5a85735..3ec6df0 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/Packed8ThreeBlocks.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/Packed8ThreeBlocks.java
@@ -110,7 +110,7 @@ final class Packed8ThreeBlocks extends PackedInts.MutableImpl {
   public long ramBytesUsed() {
     return RamUsageEstimator.alignObjectSize(
         RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
-        + 2 * RamUsageEstimator.NUM_BYTES_INT     // valueCount,bitsPerValue
+        + 2 * Integer.BYTES     // valueCount,bitsPerValue
         + RamUsageEstimator.NUM_BYTES_OBJECT_REF) // blocks ref
         + RamUsageEstimator.sizeOf(blocks);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java b/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java
index 4df8580..e028c2c 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java
@@ -681,7 +681,7 @@ public class PackedInts {
 
     @Override
     public long ramBytesUsed() {
-      return RamUsageEstimator.alignObjectSize(RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + RamUsageEstimator.NUM_BYTES_INT);
+      return RamUsageEstimator.alignObjectSize(RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + Integer.BYTES);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/packed/PagedGrowableWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/PagedGrowableWriter.java b/lucene/core/src/java/org/apache/lucene/util/packed/PagedGrowableWriter.java
index ab6c65a..2c22c9e 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/PagedGrowableWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/PagedGrowableWriter.java
@@ -16,8 +16,6 @@
  */
 package org.apache.lucene.util.packed;
 
-
-import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.lucene.util.packed.PackedInts.Mutable;
 
 /**
@@ -65,7 +63,7 @@ public final class PagedGrowableWriter extends AbstractPagedMutable<PagedGrowabl
 
   @Override
   protected long baseRamBytesUsed() {
-    return super.baseRamBytesUsed() + RamUsageEstimator.NUM_BYTES_FLOAT;
+    return super.baseRamBytesUsed() + Float.BYTES;
   }
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/test/org/apache/lucene/index/TestIntBlockPool.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIntBlockPool.java b/lucene/core/src/test/org/apache/lucene/index/TestIntBlockPool.java
index 1ad7c1d..012c079 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIntBlockPool.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIntBlockPool.java
@@ -22,7 +22,6 @@ import java.util.List;
 import org.apache.lucene.util.Counter;
 import org.apache.lucene.util.IntBlockPool;
 import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /**
  * tests basic {@link IntBlockPool} functionality
@@ -53,8 +52,7 @@ public class TestIntBlockPool extends LuceneTestCase {
         assertEquals(0, bytesUsed.get());
       } else {
         pool.reset(true, true);
-        assertEquals(IntBlockPool.INT_BLOCK_SIZE
-            * RamUsageEstimator.NUM_BYTES_INT, bytesUsed.get());
+        assertEquals(IntBlockPool.INT_BLOCK_SIZE * Integer.BYTES, bytesUsed.get());
       }
     }
   }
@@ -98,8 +96,7 @@ public class TestIntBlockPool extends LuceneTestCase {
         assertEquals(0, bytesUsed.get());
       } else {
         pool.reset(true, true);
-        assertEquals(IntBlockPool.INT_BLOCK_SIZE
-            * RamUsageEstimator.NUM_BYTES_INT, bytesUsed.get());
+        assertEquals(IntBlockPool.INT_BLOCK_SIZE * Integer.BYTES, bytesUsed.get());
       }
     }
   }
@@ -118,14 +115,14 @@ public class TestIntBlockPool extends LuceneTestCase {
     
     @Override
     public int[] getIntBlock() {
-      bytesUsed.addAndGet(blockSize * RamUsageEstimator.NUM_BYTES_INT);
+      bytesUsed.addAndGet(blockSize * Integer.BYTES);
       return new int[blockSize];
     }
     
     @Override
     public void recycleIntBlocks(int[][] blocks, int start, int end) {
       bytesUsed
-          .addAndGet(-((end - start) * blockSize * RamUsageEstimator.NUM_BYTES_INT));
+          .addAndGet(-((end - start) * blockSize * Integer.BYTES));
     }
     
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
index 8cee5c6..e5ee46f 100644
--- a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
+++ b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
@@ -140,7 +140,7 @@ public class TestBKD extends LuceneTestCase {
           if (values[dim] > maxValue[dim]) {
             maxValue[dim] = values[dim];
           }
-          NumericUtils.intToBytes(values[dim], scratch, dim);
+          NumericUtils.intToBytes(values[dim], scratch, dim * Integer.BYTES);
           if (VERBOSE) {
             System.out.println("    " + dim + " -> " + values[dim]);
           }
@@ -161,8 +161,8 @@ public class TestBKD extends LuceneTestCase {
         byte[] minPackedValue = r.getMinPackedValue();
         byte[] maxPackedValue = r.getMaxPackedValue();
         for(int dim=0;dim<numDims;dim++) {
-          assertEquals(minValue[dim], NumericUtils.bytesToInt(minPackedValue, dim));
-          assertEquals(maxValue[dim], NumericUtils.bytesToInt(maxPackedValue, dim));
+          assertEquals(minValue[dim], NumericUtils.bytesToInt(minPackedValue, dim * Integer.BYTES));
+          assertEquals(maxValue[dim], NumericUtils.bytesToInt(maxPackedValue, dim * Integer.BYTES));
         }
 
         int iters = atLeast(100);
@@ -196,7 +196,7 @@ public class TestBKD extends LuceneTestCase {
             public void visit(int docID, byte[] packedValue) {
               //System.out.println("visit check docID=" + docID);
               for(int dim=0;dim<numDims;dim++) {
-                int x = NumericUtils.bytesToInt(packedValue, dim);
+                int x = NumericUtils.bytesToInt(packedValue, dim * Integer.BYTES);
                 if (x < queryMin[dim] || x > queryMax[dim]) {
                   //System.out.println("  no");
                   return;
@@ -211,8 +211,8 @@ public class TestBKD extends LuceneTestCase {
             public Relation compare(byte[] minPacked, byte[] maxPacked) {
               boolean crosses = false;
               for(int dim=0;dim<numDims;dim++) {
-                int min = NumericUtils.bytesToInt(minPacked, dim);
-                int max = NumericUtils.bytesToInt(maxPacked, dim);
+                int min = NumericUtils.bytesToInt(minPacked, dim * Integer.BYTES);
+                int max = NumericUtils.bytesToInt(maxPacked, dim * Integer.BYTES);
                 assert max >= min;
 
                 if (max < queryMin[dim] || min > queryMax[dim]) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
----------------------------------------------------------------------
diff --git a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
index 5003ec5..29e60ba 100644
--- a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
+++ b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
@@ -225,8 +225,8 @@ public class MemoryIndex {
     this.storePayloads = storePayloads;
     this.bytesUsed = Counter.newCounter();
     final int maxBufferedByteBlocks = (int)((maxReusedBytes/2) / ByteBlockPool.BYTE_BLOCK_SIZE );
-    final int maxBufferedIntBlocks = (int) ((maxReusedBytes - (maxBufferedByteBlocks*ByteBlockPool.BYTE_BLOCK_SIZE))/(IntBlockPool.INT_BLOCK_SIZE * RamUsageEstimator.NUM_BYTES_INT));
-    assert (maxBufferedByteBlocks * ByteBlockPool.BYTE_BLOCK_SIZE) + (maxBufferedIntBlocks * IntBlockPool.INT_BLOCK_SIZE * RamUsageEstimator.NUM_BYTES_INT) <= maxReusedBytes;
+    final int maxBufferedIntBlocks = (int) ((maxReusedBytes - (maxBufferedByteBlocks*ByteBlockPool.BYTE_BLOCK_SIZE))/(IntBlockPool.INT_BLOCK_SIZE * Integer.BYTES));
+    assert (maxBufferedByteBlocks * ByteBlockPool.BYTE_BLOCK_SIZE) + (maxBufferedIntBlocks * IntBlockPool.INT_BLOCK_SIZE * Integer.BYTES) <= maxReusedBytes;
     byteBlockPool = new ByteBlockPool(new RecyclingByteBlockAllocator(ByteBlockPool.BYTE_BLOCK_SIZE, maxBufferedByteBlocks, bytesUsed));
     intBlockPool = new IntBlockPool(new RecyclingIntBlockAllocator(IntBlockPool.INT_BLOCK_SIZE, maxBufferedIntBlocks, bytesUsed));
     postingsWriter = new SliceWriter(intBlockPool);
@@ -1216,9 +1216,9 @@ public class MemoryIndex {
     @Override
     public int[] init() {
       final int[] ord = super.init();
-      start = new int[ArrayUtil.oversize(ord.length, RamUsageEstimator.NUM_BYTES_INT)];
-      end = new int[ArrayUtil.oversize(ord.length, RamUsageEstimator.NUM_BYTES_INT)];
-      freq = new int[ArrayUtil.oversize(ord.length, RamUsageEstimator.NUM_BYTES_INT)];
+      start = new int[ArrayUtil.oversize(ord.length, Integer.BYTES)];
+      end = new int[ArrayUtil.oversize(ord.length, Integer.BYTES)];
+      freq = new int[ArrayUtil.oversize(ord.length, Integer.BYTES)];
       assert start.length >= ord.length;
       assert end.length >= ord.length;
       assert freq.length >= ord.length;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/misc/src/java/org/apache/lucene/uninverting/FieldCacheImpl.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/java/org/apache/lucene/uninverting/FieldCacheImpl.java b/lucene/misc/src/java/org/apache/lucene/uninverting/FieldCacheImpl.java
index 94e53bd..c6bd943 100644
--- a/lucene/misc/src/java/org/apache/lucene/uninverting/FieldCacheImpl.java
+++ b/lucene/misc/src/java/org/apache/lucene/uninverting/FieldCacheImpl.java
@@ -481,7 +481,7 @@ class FieldCacheImpl implements FieldCache {
 
     @Override
     public long ramBytesUsed() {
-      return values.ramBytesUsed() + RamUsageEstimator.NUM_BYTES_OBJECT_REF + RamUsageEstimator.NUM_BYTES_LONG;
+      return values.ramBytesUsed() + RamUsageEstimator.NUM_BYTES_OBJECT_REF + Long.BYTES;
     }
   }
 
@@ -599,7 +599,7 @@ class FieldCacheImpl implements FieldCache {
              termOrdToBytesOffset.ramBytesUsed() + 
              docToTermOrd.ramBytesUsed() + 
              3*RamUsageEstimator.NUM_BYTES_OBJECT_REF +
-             RamUsageEstimator.NUM_BYTES_INT;
+             Integer.BYTES;
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java b/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java
index 77f7d32..539987c 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java
+++ b/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java
@@ -24,7 +24,7 @@ import org.apache.lucene.spatial.util.GeoUtils;
 public class LatLonPoint extends Field {
   public static final FieldType TYPE = new FieldType();
   static {
-    TYPE.setDimensions(2, 4);
+    TYPE.setDimensions(2, Integer.BYTES);
     TYPE.freeze();
   }
 
@@ -45,7 +45,7 @@ public class LatLonPoint extends Field {
     }
     byte[] bytes = new byte[8];
     NumericUtils.intToBytes(encodeLat(lat), bytes, 0);
-    NumericUtils.intToBytes(encodeLon(lon), bytes, 1);
+    NumericUtils.intToBytes(encodeLon(lon), bytes, Integer.BYTES);
     fieldsData = new BytesRef(bytes);
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/sandbox/src/java/org/apache/lucene/search/PointInPolygonQuery.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/PointInPolygonQuery.java b/lucene/sandbox/src/java/org/apache/lucene/search/PointInPolygonQuery.java
index 8e099c4..6a5ae1e 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/search/PointInPolygonQuery.java
+++ b/lucene/sandbox/src/java/org/apache/lucene/search/PointInPolygonQuery.java
@@ -124,7 +124,7 @@ public class PointInPolygonQuery extends Query {
                            public void visit(int docID, byte[] packedValue) {
                              assert packedValue.length == 8;
                              double lat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(packedValue, 0));
-                             double lon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(packedValue, 1));
+                             double lon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(packedValue, Integer.BYTES));
                              if (GeoRelationUtils.pointInPolygon(polyLons, polyLats, lat, lon)) {
                                hitCount[0]++;
                                result.add(docID);
@@ -134,9 +134,9 @@ public class PointInPolygonQuery extends Query {
                            @Override
                            public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) {
                              double cellMinLat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(minPackedValue, 0));
-                             double cellMinLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(minPackedValue, 1));
+                             double cellMinLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(minPackedValue, Integer.BYTES));
                              double cellMaxLat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(maxPackedValue, 0));
-                             double cellMaxLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(maxPackedValue, 1));
+                             double cellMaxLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(maxPackedValue, Integer.BYTES));
 
                              if (cellMinLat <= minLat && cellMaxLat >= maxLat && cellMinLon <= minLon && cellMaxLon >= maxLon) {
                                // Cell fully encloses the query

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/sandbox/src/java/org/apache/lucene/search/PointInRectQuery.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/PointInRectQuery.java b/lucene/sandbox/src/java/org/apache/lucene/search/PointInRectQuery.java
index 1d95399..5292f22 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/search/PointInRectQuery.java
+++ b/lucene/sandbox/src/java/org/apache/lucene/search/PointInRectQuery.java
@@ -98,7 +98,7 @@ public class PointInRectQuery extends Query {
                            public void visit(int docID, byte[] packedValue) {
                              assert packedValue.length == 8;
                              double lat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(packedValue, 0));
-                             double lon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(packedValue, 1));
+                             double lon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(packedValue, Integer.BYTES));
                              if (lat >= minLat && lat <= maxLat && lon >= minLon && lon <= maxLon) {
                                hitCount[0]++;
                                result.add(docID);
@@ -108,9 +108,9 @@ public class PointInRectQuery extends Query {
                            @Override
                            public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) {
                              double cellMinLat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(minPackedValue, 0));
-                             double cellMinLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(minPackedValue, 1));
+                             double cellMinLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(minPackedValue, Integer.BYTES));
                              double cellMaxLat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(maxPackedValue, 0));
-                             double cellMaxLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(maxPackedValue, 1));
+                             double cellMaxLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(maxPackedValue, Integer.BYTES));
 
                              if (minLat <= cellMinLat && maxLat >= cellMaxLat && minLon <= cellMinLon && maxLon >= cellMaxLon) {
                                return Relation.CELL_INSIDE_QUERY;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java b/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java
index 7e23aad..f57c1e1 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java
@@ -83,7 +83,7 @@ public class TestDocValuesRangeQuery extends LuceneTestCase {
     if (l == null) {
       return null;
     } else {
-      byte[] bytes = new byte[RamUsageEstimator.NUM_BYTES_LONG];
+      byte[] bytes = new byte[Long.BYTES];
       NumericUtils.longToBytes(l, bytes, 0);
       return new BytesRef(bytes);
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/ContainsPrefixTreeQuery.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/ContainsPrefixTreeQuery.java b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/ContainsPrefixTreeQuery.java
index 7eadb64..0046378 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/ContainsPrefixTreeQuery.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/ContainsPrefixTreeQuery.java
@@ -353,7 +353,7 @@ public class ContainsPrefixTreeQuery extends AbstractPrefixTreeQuery {
     public long ramBytesUsed() {
       return RamUsageEstimator.alignObjectSize(
             RamUsageEstimator.NUM_BYTES_OBJECT_REF
-          + RamUsageEstimator.NUM_BYTES_INT)
+          + Integer.BYTES)
           + intSet.ramBytesUsed();
     }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/spatial3d/src/java/org/apache/lucene/geo3d/Geo3DPoint.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/geo3d/Geo3DPoint.java b/lucene/spatial3d/src/java/org/apache/lucene/geo3d/Geo3DPoint.java
index ce36c20..e3837aa 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/geo3d/Geo3DPoint.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/geo3d/Geo3DPoint.java
@@ -32,7 +32,7 @@ public final class Geo3DPoint extends Field {
   /** Indexing {@link FieldType}. */
   public static final FieldType TYPE = new FieldType();
   static {
-    TYPE.setDimensions(3, RamUsageEstimator.NUM_BYTES_INT);
+    TYPE.setDimensions(3, Integer.BYTES);
     TYPE.freeze();
   }
 
@@ -61,8 +61,8 @@ public final class Geo3DPoint extends Field {
   private void fillFieldsData(double planetMax, double x, double y, double z) {
     byte[] bytes = new byte[12];
     NumericUtils.intToBytes(Geo3DUtil.encodeValue(planetMax, x), bytes, 0);
-    NumericUtils.intToBytes(Geo3DUtil.encodeValue(planetMax, y), bytes, 1);
-    NumericUtils.intToBytes(Geo3DUtil.encodeValue(planetMax, z), bytes, 2);
+    NumericUtils.intToBytes(Geo3DUtil.encodeValue(planetMax, y), bytes, Integer.BYTES);
+    NumericUtils.intToBytes(Geo3DUtil.encodeValue(planetMax, z), bytes, 2 * Integer.BYTES);
     fieldsData = new BytesRef(bytes);
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/spatial3d/src/java/org/apache/lucene/geo3d/PointInGeo3DShapeQuery.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/geo3d/PointInGeo3DShapeQuery.java b/lucene/spatial3d/src/java/org/apache/lucene/geo3d/PointInGeo3DShapeQuery.java
index 84ff01b..b7ef622 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/geo3d/PointInGeo3DShapeQuery.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/geo3d/PointInGeo3DShapeQuery.java
@@ -106,8 +106,8 @@ public class PointInGeo3DShapeQuery extends Query {
                            public void visit(int docID, byte[] packedValue) {
                              assert packedValue.length == 12;
                              double x = Geo3DUtil.decodeValueCenter(planetMax, NumericUtils.bytesToInt(packedValue, 0));
-                             double y = Geo3DUtil.decodeValueCenter(planetMax, NumericUtils.bytesToInt(packedValue, 1));
-                             double z = Geo3DUtil.decodeValueCenter(planetMax, NumericUtils.bytesToInt(packedValue, 2));
+                             double y = Geo3DUtil.decodeValueCenter(planetMax, NumericUtils.bytesToInt(packedValue, 1 * Integer.BYTES));
+                             double z = Geo3DUtil.decodeValueCenter(planetMax, NumericUtils.bytesToInt(packedValue, 2 * Integer.BYTES));
                              if (shape.isWithin(x, y, z)) {
                                result.add(docID);
                                hitCount[0]++;
@@ -122,10 +122,10 @@ public class PointInGeo3DShapeQuery extends Query {
                              // a Math.round from double to long, so e.g. 1.4 -> 1, and -1.4 -> -1:
                              double xMin = Geo3DUtil.decodeValueMin(planetMax, NumericUtils.bytesToInt(minPackedValue, 0));
                              double xMax = Geo3DUtil.decodeValueMax(planetMax, NumericUtils.bytesToInt(maxPackedValue, 0));
-                             double yMin = Geo3DUtil.decodeValueMin(planetMax, NumericUtils.bytesToInt(minPackedValue, 1));
-                             double yMax = Geo3DUtil.decodeValueMax(planetMax, NumericUtils.bytesToInt(maxPackedValue, 1));
-                             double zMin = Geo3DUtil.decodeValueMin(planetMax, NumericUtils.bytesToInt(minPackedValue, 2));
-                             double zMax = Geo3DUtil.decodeValueMax(planetMax, NumericUtils.bytesToInt(maxPackedValue, 2));
+                             double yMin = Geo3DUtil.decodeValueMin(planetMax, NumericUtils.bytesToInt(minPackedValue, 1 * Integer.BYTES));
+                             double yMax = Geo3DUtil.decodeValueMax(planetMax, NumericUtils.bytesToInt(maxPackedValue, 1 * Integer.BYTES));
+                             double zMin = Geo3DUtil.decodeValueMin(planetMax, NumericUtils.bytesToInt(minPackedValue, 2 * Integer.BYTES));
+                             double zMax = Geo3DUtil.decodeValueMax(planetMax, NumericUtils.bytesToInt(maxPackedValue, 2 * Integer.BYTES));
 
                              //System.out.println("  compare: x=" + cellXMin + "-" + cellXMax + " y=" + cellYMin + "-" + cellYMax + " z=" + cellZMin + "-" + cellZMax);
                              assert xMin <= xMax;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TernaryTreeNode.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TernaryTreeNode.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TernaryTreeNode.java
index 26416b1..34292fe 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TernaryTreeNode.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TernaryTreeNode.java
@@ -56,7 +56,7 @@ public class TernaryTreeNode {
       mem += hiKid.sizeInBytes();
     }
     if (token != null) {
-      mem += RamUsageEstimator.shallowSizeOf(token) + RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + RamUsageEstimator.NUM_BYTES_CHAR * token.length();
+      mem += RamUsageEstimator.shallowSizeOf(token) + RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + Character.BYTES * token.length();
     }
     mem += RamUsageEstimator.shallowSizeOf(val);
     return mem;


[33/53] [abbrv] lucene-solr git commit: fix javadocs typos

Posted by no...@apache.org.
fix javadocs typos


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/dfd95df2
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/dfd95df2
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/dfd95df2

Branch: refs/heads/apiv2
Commit: dfd95df2f18935c6a3db98c416ee7de4e7b0c6bd
Parents: ed90697
Author: Robert Muir <rm...@apache.org>
Authored: Mon Feb 22 12:28:29 2016 -0500
Committer: Robert Muir <rm...@apache.org>
Committed: Mon Feb 22 12:28:58 2016 -0500

----------------------------------------------------------------------
 lucene/core/src/java/org/apache/lucene/codecs/PointWriter.java   | 2 +-
 .../org/apache/lucene/codecs/lucene60/Lucene60PointFormat.java   | 4 +---
 lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java | 2 +-
 lucene/core/src/java/org/apache/lucene/document/DoublePoint.java | 2 +-
 lucene/core/src/java/org/apache/lucene/document/FloatPoint.java  | 2 +-
 lucene/core/src/java/org/apache/lucene/document/IntPoint.java    | 2 +-
 lucene/core/src/java/org/apache/lucene/document/LongPoint.java   | 2 +-
 7 files changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dfd95df2/lucene/core/src/java/org/apache/lucene/codecs/PointWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/PointWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/PointWriter.java
index fb809d7..21d9044 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/PointWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/PointWriter.java
@@ -37,7 +37,7 @@ public abstract class PointWriter implements Closeable {
   /** Write all values contained in the provided reader */
   public abstract void writeField(FieldInfo fieldInfo, PointReader values) throws IOException;
 
-  /** Default naive merge implemenation for one field: it just re-indexes all the values
+  /** Default naive merge implementation for one field: it just re-indexes all the values
    *  from the incoming segment.  The default codec overrides this for 1D fields and uses
    *  a faster but more complex implementation. */
   protected void mergeOneField(MergeState mergeState, FieldInfo fieldInfo) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dfd95df2/lucene/core/src/java/org/apache/lucene/codecs/lucene60/Lucene60PointFormat.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene60/Lucene60PointFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene60/Lucene60PointFormat.java
index 8ea932b..8f43187 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene60/Lucene60PointFormat.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene60/Lucene60PointFormat.java
@@ -64,10 +64,8 @@ import org.apache.lucene.index.SegmentWriteState;
  *   <li> (fieldNumber (vInt), fieldFilePointer (vLong))<sup>fieldCount</sup>
  * </ul>
  *
- * <p> After that, {@link CodecUtil#writeFooter} writes the checksum.
- *
  * <p>After all fields blocks + index data are written, {@link CodecUtil#writeFooter} writes the checksum.
-
+ *
  * @lucene.experimental
  */
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dfd95df2/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java b/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java
index 920ac42..f80e1c0 100644
--- a/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java
@@ -21,7 +21,7 @@ import org.apache.lucene.util.BytesRef;
 
 /** A binary field that is indexed dimensionally such that finding
  *  all documents within an N-dimensional shape or range at search time is
- *  efficient.  Muliple values for the same field in one documents
+ *  efficient.  Multiple values for the same field in one documents
  *  is allowed. */
 
 public final class BinaryPoint extends Field {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dfd95df2/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java b/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
index b50260b..b3534fc 100644
--- a/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
@@ -23,7 +23,7 @@ import org.apache.lucene.util.RamUsageEstimator;
 
 /** A double field that is indexed dimensionally such that finding
  *  all documents within an N-dimensional shape or range at search time is
- *  efficient.  Muliple values for the same field in one documents
+ *  efficient.  Multiple values for the same field in one documents
  *  is allowed. */
 
 public final class DoublePoint extends Field {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dfd95df2/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java b/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
index 8e0a257..92ea9d6 100644
--- a/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
@@ -23,7 +23,7 @@ import org.apache.lucene.util.RamUsageEstimator;
 
 /** A field that is indexed dimensionally such that finding
  *  all documents within an N-dimensional at search time is
- *  efficient.  Muliple values for the same field in one documents
+ *  efficient.  Multiple values for the same field in one documents
  *  is allowed. */
 
 public final class FloatPoint extends Field {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dfd95df2/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/IntPoint.java b/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
index f582bf6..e4a88e4 100644
--- a/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
@@ -23,7 +23,7 @@ import org.apache.lucene.util.RamUsageEstimator;
 
 /** An int field that is indexed dimensionally such that finding
  *  all documents within an N-dimensional shape or range at search time is
- *  efficient.  Muliple values for the same field in one documents
+ *  efficient.  Multiple values for the same field in one documents
  *  is allowed. */
 
 public final class IntPoint extends Field {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dfd95df2/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/LongPoint.java b/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
index e645260..950101f 100644
--- a/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
@@ -23,7 +23,7 @@ import org.apache.lucene.util.RamUsageEstimator;
 
 /** A long field that is indexed dimensionally such that finding
  *  all documents within an N-dimensional shape or range at search time is
- *  efficient.  Muliple values for the same field in one documents
+ *  efficient.  Multiple values for the same field in one documents
  *  is allowed. */
 
 public final class LongPoint extends Field {


[37/53] [abbrv] lucene-solr git commit: SOLR-8692: Deal with the new solr/core/src/resources/ dir: 1) add Maven config; and 2) improve IntelliJ config by using a new content root in solr-core module pointing to the resources dir, rather than using module

Posted by no...@apache.org.
SOLR-8692: Deal with the new solr/core/src/resources/ dir: 1) add Maven config; and 2) improve IntelliJ config by using a new content root in solr-core module pointing to the resources dir, rather than using module-library declarations in the solr-core, solr-core-tests and solrj modules.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/eeee1c3f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/eeee1c3f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/eeee1c3f

Branch: refs/heads/apiv2
Commit: eeee1c3f407f8a77132fcd43fd56ac8e3b9ce4db
Parents: 54a544b
Author: Steve Rowe <sa...@apache.org>
Authored: Mon Feb 22 18:18:31 2016 -0500
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Feb 22 18:19:00 2016 -0500

----------------------------------------------------------------------
 dev-tools/idea/solr/core/src/java/solr-core.iml     | 12 +++---------
 dev-tools/idea/solr/core/src/solr-core-tests.iml    |  9 ---------
 dev-tools/idea/solr/solrj/src/solrj-tests.iml       |  9 ---------
 dev-tools/maven/solr/core/src/java/pom.xml.template |  5 +++++
 4 files changed, 8 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/eeee1c3f/dev-tools/idea/solr/core/src/java/solr-core.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/solr/core/src/java/solr-core.iml b/dev-tools/idea/solr/core/src/java/solr-core.iml
index eb54942..3ffd185 100644
--- a/dev-tools/idea/solr/core/src/java/solr-core.iml
+++ b/dev-tools/idea/solr/core/src/java/solr-core.iml
@@ -6,6 +6,9 @@
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
     </content>
+    <content url="file://$MODULE_DIR$/../resources">
+      <sourceFolder url="file://$MODULE_DIR$/../resources" type="java-resource" />
+    </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="library" name="Solr core library" level="project" />
@@ -27,14 +30,5 @@
     <orderEntry type="module" module-name="queryparser" />
     <orderEntry type="module" module-name="join" />
     <orderEntry type="module" module-name="sandbox" />
-      <orderEntry type="module-library">
-          <library>
-            <CLASSES>
-              <root url="file://$MODULE_DIR$/resources" />
-            </CLASSES>
-            <JAVADOC />
-            <SOURCES />
-          </library>
-        </orderEntry>
   </component>
 </module>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/eeee1c3f/dev-tools/idea/solr/core/src/solr-core-tests.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/solr/core/src/solr-core-tests.iml b/dev-tools/idea/solr/core/src/solr-core-tests.iml
index 6e2bb6f..eb27c57 100644
--- a/dev-tools/idea/solr/core/src/solr-core-tests.iml
+++ b/dev-tools/idea/solr/core/src/solr-core-tests.iml
@@ -31,14 +31,5 @@
     <orderEntry type="module" scope="TEST" module-name="expressions" />
     <orderEntry type="module" scope="TEST" module-name="icu" />
     <orderEntry type="module" scope="TEST" module-name="analysis-extras" />
-      <orderEntry type="module-library">
-          <library>
-            <CLASSES>
-              <root url="file://$MODULE_DIR$/resources" />
-            </CLASSES>
-            <JAVADOC />
-            <SOURCES />
-          </library>
-        </orderEntry>
   </component>
 </module>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/eeee1c3f/dev-tools/idea/solr/solrj/src/solrj-tests.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/solr/solrj/src/solrj-tests.iml b/dev-tools/idea/solr/solrj/src/solrj-tests.iml
index 0b3c252..13cdb58 100644
--- a/dev-tools/idea/solr/solrj/src/solrj-tests.iml
+++ b/dev-tools/idea/solr/solrj/src/solrj-tests.iml
@@ -29,14 +29,5 @@
     <orderEntry type="module" scope="TEST" module-name="solr-core" />
     <orderEntry type="module" scope="TEST" module-name="analysis-common" />
     <orderEntry type="module" scope="TEST" module-name="lucene-core" />
-     <orderEntry type="module-library">
-          <library>
-            <CLASSES>
-              <root url="file://$MODULE_DIR$/../../core/src/resources" />
-            </CLASSES>
-            <JAVADOC />
-            <SOURCES />
-          </library>
-        </orderEntry>
   </component>
 </module>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/eeee1c3f/dev-tools/maven/solr/core/src/java/pom.xml.template
----------------------------------------------------------------------
diff --git a/dev-tools/maven/solr/core/src/java/pom.xml.template b/dev-tools/maven/solr/core/src/java/pom.xml.template
index b8408b0..949a0a7 100644
--- a/dev-tools/maven/solr/core/src/java/pom.xml.template
+++ b/dev-tools/maven/solr/core/src/java/pom.xml.template
@@ -47,6 +47,11 @@
   </dependencies>
   <build>
     <sourceDirectory>${module-path}</sourceDirectory>
+    <resources>
+      <resource>
+        <directory>${module-path}/../resources</directory>
+      </resource>
+    </resources>
     <testSourceDirectory/>
     <testResources/>
     <plugins>


[06/53] [abbrv] lucene-solr git commit: LUCENE-7037: Switch all exceptions tests to expectThrows()

Posted by no...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilterFactory.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilterFactory.java
index da81777..90055f1 100644
--- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilterFactory.java
+++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilterFactory.java
@@ -38,14 +38,12 @@ public class TestICUNormalizer2CharFilterFactory extends BaseTokenStreamTestCase
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new ICUNormalizer2CharFilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
   
   // TODO: add tests for different forms

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2FilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2FilterFactory.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2FilterFactory.java
index 90a14f3..5533215 100644
--- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2FilterFactory.java
+++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2FilterFactory.java
@@ -39,14 +39,12 @@ public class TestICUNormalizer2FilterFactory extends BaseTokenStreamTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new ICUNormalizer2FilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
   
   // TODO: add tests for different forms

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilterFactory.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilterFactory.java
index b74984c..a478217 100644
--- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilterFactory.java
+++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilterFactory.java
@@ -66,14 +66,12 @@ public class TestICUTransformFilterFactory extends BaseTokenStreamTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new ICUTransformFilterFactory(new HashMap<String,String>() {{
         put("id", "Null");
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestCharArrayIterator.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestCharArrayIterator.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestCharArrayIterator.java
index 14d7f0f..28856fb 100644
--- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestCharArrayIterator.java
+++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestCharArrayIterator.java
@@ -86,12 +86,9 @@ public class TestCharArrayIterator extends LuceneTestCase {
   public void testSetIndex() {
     CharArrayIterator ci = new CharArrayIterator();
     ci.setText("test".toCharArray(), 0, "test".length());
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       ci.setIndex(5);
-      fail();
-    } catch (Exception e) {
-      assertTrue(e instanceof IllegalArgumentException);
-    }
+    });
   }
   
   public void testClone() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerFactory.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerFactory.java
index e288c4d..f44e745 100644
--- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerFactory.java
+++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerFactory.java
@@ -92,13 +92,11 @@ public class TestICUTokenizerFactory extends BaseTokenStreamTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new ICUTokenizerFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilterFactory.java
index b140516..e52d98c 100644
--- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilterFactory.java
+++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilterFactory.java
@@ -43,13 +43,11 @@ public class TestJapaneseBaseFormFilterFactory extends BaseTokenStreamTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new JapaneseBaseFormFilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilterFactory.java
index fe5ae66..e14c822 100644
--- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilterFactory.java
+++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilterFactory.java
@@ -91,13 +91,11 @@ public class TestJapaneseIterationMarkCharFilterFactory extends BaseTokenStreamT
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new JapaneseIterationMarkCharFilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilterFactory.java
index 6a112e7..39c7a17 100644
--- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilterFactory.java
+++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilterFactory.java
@@ -43,13 +43,11 @@ public class TestJapaneseKatakanaStemFilterFactory extends BaseTokenStreamTestCa
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new JapaneseKatakanaStemFilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilterFactory.java
index 44e3234..a92d3f0 100644
--- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilterFactory.java
+++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilterFactory.java
@@ -50,13 +50,11 @@ public class TestJapaneseNumberFilterFactory extends BaseTokenStreamTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new JapaneseNumberFilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapanesePartOfSpeechStopFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapanesePartOfSpeechStopFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapanesePartOfSpeechStopFilterFactory.java
index 979fd7f..501d2fc 100644
--- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapanesePartOfSpeechStopFilterFactory.java
+++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapanesePartOfSpeechStopFilterFactory.java
@@ -53,14 +53,12 @@ public class TestJapanesePartOfSpeechStopFilterFactory extends BaseTokenStreamTe
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new JapanesePartOfSpeechStopFilterFactory(new HashMap<String,String>() {{
         put("luceneMatchVersion", Version.LATEST.toString());
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilterFactory.java
index 1b12ec1..266fd01 100644
--- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilterFactory.java
+++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilterFactory.java
@@ -42,13 +42,11 @@ public class TestJapaneseReadingFormFilterFactory extends BaseTokenStreamTestCas
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new JapaneseReadingFormFilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizerFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizerFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizerFactory.java
index 45bf603..bdf22cf 100644
--- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizerFactory.java
+++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizerFactory.java
@@ -111,14 +111,12 @@ public class TestJapaneseTokenizerFactory extends BaseTokenStreamTestCase {
 
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new JapaneseTokenizerFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 
   private TokenStream makeTokenStream(HashMap<String, String> args, String in) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikFilterFactory.java b/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikFilterFactory.java
index 9a597fc..d971dbd 100644
--- a/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikFilterFactory.java
+++ b/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikFilterFactory.java
@@ -75,26 +75,22 @@ public class TestMorfologikFilterFactory extends BaseTokenStreamTestCase {
   public void testMissingDictionary() throws Exception {
     final ResourceLoader loader = new ClasspathResourceLoader(TestMorfologikFilterFactory.class);
 
-    try {
+    IOException expected = expectThrows(IOException.class, () -> {
       Map<String,String> params = new HashMap<>();
       params.put(MorfologikFilterFactory.DICTIONARY_ATTRIBUTE, "missing-dictionary-resource.dict");
       MorfologikFilterFactory factory = new MorfologikFilterFactory(params);
       factory.inform(loader);
-      fail();
-    } catch (IOException e) {
-      assertTrue(e.getMessage().contains("Resource not found"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Resource not found"));
   }
 
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       HashMap<String,String> params = new HashMap<String,String>();
       params.put("bogusArg", "bogusValue");
       new MorfologikFilterFactory(params);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilterFactory.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilterFactory.java
index c29a9b4..5c9887e 100644
--- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilterFactory.java
+++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilterFactory.java
@@ -62,13 +62,11 @@ public class TestBeiderMorseFilterFactory extends BaseTokenStreamTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new BeiderMorseFilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilterFactory.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilterFactory.java
index b73deb3..bdac2ad 100644
--- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilterFactory.java
+++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilterFactory.java
@@ -53,13 +53,11 @@ public class TestDaitchMokotoffSoundexFilterFactory extends BaseTokenStreamTestC
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new DaitchMokotoffSoundexFilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilterFactory.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilterFactory.java
index 24c8e14..6f70742 100644
--- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilterFactory.java
+++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilterFactory.java
@@ -53,13 +53,11 @@ public class TestDoubleMetaphoneFilterFactory extends BaseTokenStreamTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new DoubleMetaphoneFilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilterFactory.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilterFactory.java
index ff20b65..f205076 100644
--- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilterFactory.java
+++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilterFactory.java
@@ -64,36 +64,30 @@ public class TestPhoneticFilterFactory extends BaseTokenStreamTestCase {
    * Case: Failures and Exceptions
    */
   public void testMissingEncoder() throws IOException {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new PhoneticFilterFactory(new HashMap<String,String>());
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Configuration Error: missing parameter 'encoder'"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Configuration Error: missing parameter 'encoder'"));
   }
   
   public void testUnknownEncoder() throws IOException {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       Map<String,String> args = new HashMap<>();
       args.put("encoder", "XXX");
       PhoneticFilterFactory factory = new PhoneticFilterFactory(args);
       factory.inform(new ClasspathResourceLoader(factory.getClass()));
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Error loading encoder"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Error loading encoder"));
   }
   
   public void testUnknownEncoderReflection() throws IOException {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       Map<String,String> args = new HashMap<>();
       args.put("encoder", "org.apache.commons.codec.language.NonExistence");
       PhoneticFilterFactory factory = new PhoneticFilterFactory(args);
       factory.inform(new ClasspathResourceLoader(factory.getClass()));
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Error loading encoder"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Error loading encoder"));
   }
   
   /**
@@ -172,15 +166,13 @@ public class TestPhoneticFilterFactory extends BaseTokenStreamTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new PhoneticFilterFactory(new HashMap<String,String>() {{
         put("encoder", "Metaphone");
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
   
   static void assertAlgorithm(String algName, String inject, String input,

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestHMMChineseTokenizerFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestHMMChineseTokenizerFactory.java b/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestHMMChineseTokenizerFactory.java
index e16a4fe..c329486 100644
--- a/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestHMMChineseTokenizerFactory.java
+++ b/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestHMMChineseTokenizerFactory.java
@@ -44,13 +44,11 @@ public class TestHMMChineseTokenizerFactory extends BaseTokenStreamTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new HMMChineseTokenizerFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/stempel/TestStempelPolishStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/stempel/TestStempelPolishStemFilterFactory.java b/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/stempel/TestStempelPolishStemFilterFactory.java
index cfb022b..7199755 100644
--- a/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/stempel/TestStempelPolishStemFilterFactory.java
+++ b/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/stempel/TestStempelPolishStemFilterFactory.java
@@ -40,13 +40,11 @@ public class TestStempelPolishStemFilterFactory extends BaseTokenStreamTestCase
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new StempelPolishStemFilterFactory(new HashMap<String,String>() {{
         put("bogusArg", "bogusValue");
       }});
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/ae/OverridingParamsAEProviderTest.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/ae/OverridingParamsAEProviderTest.java b/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/ae/OverridingParamsAEProviderTest.java
index 8f7e111..923210b 100644
--- a/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/ae/OverridingParamsAEProviderTest.java
+++ b/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/ae/OverridingParamsAEProviderTest.java
@@ -17,6 +17,7 @@
 package org.apache.lucene.analysis.uima.ae;
 
 
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.uima.analysis_engine.AnalysisEngine;
 import org.apache.uima.resource.ResourceInitializationException;
 import org.junit.Test;
@@ -24,24 +25,17 @@ import org.junit.Test;
 import java.util.HashMap;
 import java.util.Map;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
 /**
  * TestCase for {@link OverridingParamsAEProvider}
  */
-public class OverridingParamsAEProviderTest {
+public class OverridingParamsAEProviderTest extends LuceneTestCase {
 
   @Test
   public void testNullMapInitialization() throws Exception {
-    try {
+    expectThrows(ResourceInitializationException.class, () -> {
       AEProvider aeProvider = new OverridingParamsAEProvider("/uima/TestEntityAnnotatorAE.xml", null);
       aeProvider.getAE();
-      fail("should fail due to null Map passed");
-    } catch (ResourceInitializationException e) {
-      // everything ok
-    }
+    });
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestMaxPositionInOldIndex.java
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestMaxPositionInOldIndex.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestMaxPositionInOldIndex.java
index 37f8c21..87625d2 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestMaxPositionInOldIndex.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestMaxPositionInOldIndex.java
@@ -81,13 +81,10 @@ public class BuildMaxPositionIndex {
     TestUtil.unzip(resource, path);
     BaseDirectoryWrapper dir = newFSDirectory(path);
     dir.setCheckIndexOnClose(false);
-    try {
+    RuntimeException expected = expectThrows(RuntimeException.class, () -> {
       TestUtil.checkIndex(dir, false, true);
-      fail("corruption was not detected");
-    } catch (RuntimeException re) {
-      // expected
-      assertTrue(re.getMessage().contains("pos 2147483647 > IndexWriter.MAX_POSITION=2147483519"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("pos 2147483647 > IndexWriter.MAX_POSITION=2147483519"));
 
     // Also confirm merging detects this:
     IndexWriterConfig iwc = newIndexWriterConfig();
@@ -95,14 +92,13 @@ public class BuildMaxPositionIndex {
     iwc.setMergePolicy(newLogMergePolicy());
     IndexWriter w = new IndexWriter(dir, iwc);
     w.addDocument(new Document());
-    try {
+    CorruptIndexException expectedCorruption = expectThrows(CorruptIndexException.class, () -> {
       w.forceMerge(1);
-    } catch (CorruptIndexException cie) {
-      assertEquals(cie.getMessage(), new CorruptIndexException(cie.getOriginalMessage(), cie.getResourceDescription()).getMessage());
-      // SerialMergeScheduler
-      assertTrue("got message " + cie.getMessage(),
-                 cie.getMessage().contains("position=2147483647 is too large (> IndexWriter.MAX_POSITION=2147483519), field=\"foo\" doc=0 (resource=PerFieldPostings(segment=_0 formats=1)"));
-    }
+    });
+    assertEquals(expectedCorruption.getMessage(), new CorruptIndexException(expectedCorruption.getOriginalMessage(), expectedCorruption.getResourceDescription()).getMessage());
+    // SerialMergeScheduler
+    assertTrue("got message " + expectedCorruption.getMessage(),
+        expectedCorruption.getMessage().contains("position=2147483647 is too large (> IndexWriter.MAX_POSITION=2147483519), field=\"foo\" doc=0 (resource=PerFieldPostings(segment=_0 formats=1)"));
 
     w.close();
     dir.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
----------------------------------------------------------------------
diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
index b9b1957..5dbf660 100644
--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
@@ -258,13 +258,9 @@ public class TestPerfTasksLogic extends BenchmarkTestCase {
     CountingHighlighterTestTask.numHighlightedResults = 0;
     CountingHighlighterTestTask.numDocsRetrieved = 0;
     // 3. execute the algorithm  (required in every "logic" test)
-    try {
-      Benchmark benchmark = execBenchmark(algLines);
-      assertTrue("CountingHighlighterTest should have thrown an exception", false);
-      assertNotNull(benchmark); // (avoid compile warning on unused variable)
-    } catch (Exception e) {
-      assertTrue(true);
-    }
+    expectThrows(Exception.class, () -> {
+      execBenchmark(algLines);
+    });
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSourceTest.java
----------------------------------------------------------------------
diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSourceTest.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSourceTest.java
index c6fa60f..9e76700 100644
--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSourceTest.java
+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSourceTest.java
@@ -56,12 +56,9 @@ public class EnwikiContentSourceTest extends LuceneTestCase {
   }
   
   private void assertNoMoreDataException(EnwikiContentSource stdm) throws Exception {
-    try {
+    expectThrows(NoMoreDataException.class, () -> {
       stdm.getNextDocData(null);
-      fail("Expecting NoMoreDataException");
-    } catch (NoMoreDataException e) {
-      // expected
-    }
+    });
   }
   
   private final String PAGE1 = 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java
----------------------------------------------------------------------
diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java
index 99236cd..197ce4a 100644
--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java
+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java
@@ -214,12 +214,9 @@ public class LineDocSourceTest extends BenchmarkTestCase {
       writer.write(testCases[i]);
       writer.newLine();
       writer.close();
-      try {
+      expectThrows(Exception.class, () -> {
         doIndexAndSearchTest(file, null, null);
-        fail("Some exception should have been thrown for: [" + testCases[i] + "]");
-      } catch (Exception e) {
-        // expected.
-      }
+      });
     }
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TrecContentSourceTest.java
----------------------------------------------------------------------
diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TrecContentSourceTest.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TrecContentSourceTest.java
index bb87fdd..1257422 100644
--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TrecContentSourceTest.java
+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TrecContentSourceTest.java
@@ -75,13 +75,9 @@ public class TrecContentSourceTest extends LuceneTestCase {
   }
   
   private void assertNoMoreDataException(StringableTrecSource stdm) throws Exception {
-    boolean thrown = false;
-    try {
+    expectThrows(NoMoreDataException.class, () -> {
       stdm.getNextDocData(null);
-    } catch (NoMoreDataException e) {
-      thrown = true;
-    }
-    assertTrue("Expecting NoMoreDataException", thrown);
+    });
   }
   
   public void testOneDocument() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/alt/AltPackageTaskTest.java
----------------------------------------------------------------------
diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/alt/AltPackageTaskTest.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/alt/AltPackageTaskTest.java
index 059650d..4e9972d 100644
--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/alt/AltPackageTaskTest.java
+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/alt/AltPackageTaskTest.java
@@ -25,12 +25,9 @@ public class AltPackageTaskTest extends BenchmarkTestCase {
 
   /** Benchmark should fail loading the algorithm when alt is not specified */
   public void testWithoutAlt() throws Exception {
-    try {
+    expectThrows(Exception.class, () -> {
       execBenchmark(altAlg(false));
-      assertFalse("Should have failed to run the algorithm",true);
-    } catch(Exception e) {
-      // expected exception, do nothing
-    }
+    });
   }
 
   /** Benchmark should be able to load the algorithm when alt is specified */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/codecs/src/test/org/apache/lucene/codecs/autoprefix/TestAutoPrefixTerms.java
----------------------------------------------------------------------
diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/autoprefix/TestAutoPrefixTerms.java b/lucene/codecs/src/test/org/apache/lucene/codecs/autoprefix/TestAutoPrefixTerms.java
index 726c3f0..316fc9a 100644
--- a/lucene/codecs/src/test/org/apache/lucene/codecs/autoprefix/TestAutoPrefixTerms.java
+++ b/lucene/codecs/src/test/org/apache/lucene/codecs/autoprefix/TestAutoPrefixTerms.java
@@ -648,11 +648,10 @@ public class TestAutoPrefixTerms extends LuceneTestCase {
     Document doc = new Document();
     doc.add(new Field("foo", "bar bar", ft));
     w.addDocument(doc);
-    try {
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
       w.commit();
-    } catch (IllegalStateException ise) {
-      assertEquals("ranges can only be indexed with IndexOptions.DOCS (field: foo)", ise.getMessage());
-    }
+    });
+    assertEquals("ranges can only be indexed with IndexOptions.DOCS (field: foo)", expected.getMessage());
     w.close();
     dir.close();
   }
@@ -668,11 +667,11 @@ public class TestAutoPrefixTerms extends LuceneTestCase {
     Document doc = new Document();
     doc.add(new Field("foo", "bar bar", ft));
     w.addDocument(doc);
-    try {
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
       w.commit();
-    } catch (IllegalStateException ise) {
-      assertEquals("ranges can only be indexed with IndexOptions.DOCS (field: foo)", ise.getMessage());
-    }
+    });
+    assertEquals("ranges can only be indexed with IndexOptions.DOCS (field: foo)", expected.getMessage());
+
     w.close();
     dir.close();
   }
@@ -688,11 +687,11 @@ public class TestAutoPrefixTerms extends LuceneTestCase {
     Document doc = new Document();
     doc.add(new Field("foo", "bar bar", ft));
     w.addDocument(doc);
-    try {
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
       w.commit();
-    } catch (IllegalStateException ise) {
-      assertEquals("ranges can only be indexed with IndexOptions.DOCS (field: foo)", ise.getMessage());
-    }
+    });
+    assertEquals("ranges can only be indexed with IndexOptions.DOCS (field: foo)", expected.getMessage());
+
     w.close();
     dir.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java b/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java
index db3f8e0..39248ee 100644
--- a/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java
+++ b/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java
@@ -121,12 +121,10 @@ public class TestCachingTokenFilter extends BaseTokenStreamTestCase {
     final TokenStream input = analyzer.tokenStream("field", "abc");
     CachingTokenFilter buffer = new CachingTokenFilter(input);
     buffer.reset();//ok
-    try {
+    IllegalStateException e = expectThrows(IllegalStateException.class, () -> {
       buffer.reset();//bad (this used to work which we don't want)
-      fail("didn't get expected exception");
-    } catch (IllegalStateException e) {
-      assertEquals("double reset()", e.getMessage());
-    }
+    });
+    assertEquals("double reset()", e.getMessage());
   }
   
   private void checkTokens(TokenStream stream) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/analysis/TestNumericTokenStream.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestNumericTokenStream.java b/lucene/core/src/test/org/apache/lucene/analysis/TestNumericTokenStream.java
index 837b38a..dfaa20e 100644
--- a/lucene/core/src/test/org/apache/lucene/analysis/TestNumericTokenStream.java
+++ b/lucene/core/src/test/org/apache/lucene/analysis/TestNumericTokenStream.java
@@ -81,19 +81,13 @@ public class TestNumericTokenStream extends BaseTokenStreamTestCase {
   public void testNotInitialized() throws Exception {
     final LegacyNumericTokenStream stream=new LegacyNumericTokenStream();
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       stream.reset();
-      fail("reset() should not succeed.");
-    } catch (IllegalStateException e) {
-      // pass
-    }
+    });
 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       stream.incrementToken();
-      fail("incrementToken() should not succeed.");
-    } catch (IllegalStateException e) {
-      // pass
-    }
+    });
     
     stream.close();
   }
@@ -103,18 +97,15 @@ public class TestNumericTokenStream extends BaseTokenStreamTestCase {
   
   public void testCTA() throws Exception {
     final LegacyNumericTokenStream stream=new LegacyNumericTokenStream();
-    try {
+    IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> {
       stream.addAttribute(CharTermAttribute.class);
-      fail("Succeeded to add CharTermAttribute.");
-    } catch (IllegalArgumentException iae) {
-      assertTrue(iae.getMessage().startsWith("LegacyNumericTokenStream does not support"));
-    }
-    try {
+    });
+    assertTrue(e.getMessage().startsWith("LegacyNumericTokenStream does not support"));
+
+    e = expectThrows(IllegalArgumentException.class, () -> {
       stream.addAttribute(TestAttribute.class);
-      fail("Succeeded to add TestAttribute.");
-    } catch (IllegalArgumentException iae) {
-      assertTrue(iae.getMessage().startsWith("LegacyNumericTokenStream does not support"));
-    }
+    });
+    assertTrue(e.getMessage().startsWith("LegacyNumericTokenStream does not support"));
     stream.close();
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java
index e02dd02..81dd576 100644
--- a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java
+++ b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java
@@ -191,17 +191,13 @@ public class TestCharTermAttributeImpl extends LuceneTestCase {
     t.append((CharSequence) t2, 1, 2);
     assertEquals("4teste", t.toString());
     
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       t.append((CharSequence) t2, 1, 5);
-      fail("Should throw IndexOutOfBoundsException");
-    } catch(IndexOutOfBoundsException iobe) {
-    }
-    
-    try {
+    });
+
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       t.append((CharSequence) t2, 1, 0);
-      fail("Should throw IndexOutOfBoundsException");
-    } catch(IndexOutOfBoundsException iobe) {
-    }
+    });
     
     t.append((CharSequence) null);
     assertEquals("4testenull", t.toString());
@@ -259,29 +255,21 @@ public class TestCharTermAttributeImpl extends LuceneTestCase {
     t.append("test");
     assertEquals("test", t.toString());
 
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       t.charAt(-1);
-      fail("Should throw IndexOutOfBoundsException");
-    } catch(IndexOutOfBoundsException iobe) {
-    }
+    });
 
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       t.charAt(4);
-      fail("Should throw IndexOutOfBoundsException");
-    } catch(IndexOutOfBoundsException iobe) {
-    }
+    });
 
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       t.subSequence(0, 5);
-      fail("Should throw IndexOutOfBoundsException");
-    } catch(IndexOutOfBoundsException iobe) {
-    }
+    });
 
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       t.subSequence(5, 0);
-      fail("Should throw IndexOutOfBoundsException");
-    } catch(IndexOutOfBoundsException iobe) {
-    }
+    });
   }
 
   public static <T extends AttributeImpl> T assertCloneIsEqual(T att) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java
index 6acd053..1a2ab62 100644
--- a/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java
+++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java
@@ -66,12 +66,9 @@ public class TestBlockPostingsFormat extends BasePostingsFormatTestCase {
   }
 
   private void shouldFail(int minItemsInBlock, int maxItemsInBlock) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new Lucene50PostingsFormat(minItemsInBlock, maxItemsInBlock);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
   }
 
   public void testInvalidBlockSizes() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestLucene50StoredFieldsFormatHighCompression.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestLucene50StoredFieldsFormatHighCompression.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestLucene50StoredFieldsFormatHighCompression.java
index 1fe84aa..59e4814 100644
--- a/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestLucene50StoredFieldsFormatHighCompression.java
+++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestLucene50StoredFieldsFormatHighCompression.java
@@ -70,18 +70,12 @@ public class TestLucene50StoredFieldsFormatHighCompression extends BaseStoredFie
   }
   
   public void testInvalidOptions() throws Exception {
-    try {
+    expectThrows(NullPointerException.class, () -> {
       new Lucene60Codec(null);
-      fail("didn't hit exception");
-    } catch (NullPointerException expected) {
-      // expected
-    }
+    });
     
-    try {
+    expectThrows(NullPointerException.class, () -> {
       new Lucene50StoredFieldsFormat(null);
-      fail("didn't hit exception");
-    } catch (NullPointerException expected) {
-      // expected
-    }
+    });
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java b/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java
index ed99ff0..fc1aaaf 100644
--- a/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java
+++ b/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java
@@ -35,19 +35,17 @@ public class TestDateTools extends LuceneTestCase {
     d = DateTools.stringToDate("20040705091055990");
     assertEquals("2004-07-05 09:10:55:990", isoFormat(d));
 
-    try {
-      d = DateTools.stringToDate("97");    // no date
-      fail();
-    } catch(ParseException e) { /* expected exception */ }
-    try {
-      d = DateTools.stringToDate("200401011235009999");    // no date
-      fail();
-    } catch(ParseException e) { /* expected exception */ }
-    try {
-      d = DateTools.stringToDate("aaaa");    // no date
-      fail();
-    } catch(ParseException e) { /* expected exception */ }
+    expectThrows(ParseException.class, () -> {
+      DateTools.stringToDate("97");    // no date
+    });
+
+    expectThrows(ParseException.class, () -> {
+      DateTools.stringToDate("200401011235009999");    // no date
+    });
 
+    expectThrows(ParseException.class, () -> {
+      DateTools.stringToDate("aaaa");    // no date
+    });
   }
   
   public void testStringtoTime() throws ParseException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/document/TestDocument.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/document/TestDocument.java b/lucene/core/src/test/org/apache/lucene/document/TestDocument.java
index 41e1f62..bd873ec 100644
--- a/lucene/core/src/test/org/apache/lucene/document/TestDocument.java
+++ b/lucene/core/src/test/org/apache/lucene/document/TestDocument.java
@@ -135,12 +135,9 @@ public class TestDocument extends LuceneTestCase {
     ft.setStored(true);
     new Field("name", "value", ft); // okay
     new StringField("name", "value", Field.Store.NO); // okay
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new Field("name", "value", new FieldType());
-      fail();
-    } catch (IllegalArgumentException e) {
-      // expected exception
-    }
+    });
 
     Directory dir = newDirectory();
     RandomIndexWriter w = new RandomIndexWriter(random(), dir);
@@ -150,12 +147,9 @@ public class TestDocument extends LuceneTestCase {
     ft2.setStored(true);
     ft2.setStoreTermVectors(true);
     doc.add(new Field("name", "value", ft2));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail();
-    } catch (IllegalArgumentException e) {
-      // expected exception
-    }
+    });
     w.close();
     dir.close();
   }
@@ -167,25 +161,18 @@ public class TestDocument extends LuceneTestCase {
     assertEquals(0, doc.getFields().size());
   }
 
+  /** test that Document.getFields() actually returns an immutable list */
   public void testGetFieldsImmutable() {
     Document doc = makeDocumentWithFields();
     assertEquals(10, doc.getFields().size());
     List<IndexableField> fields = doc.getFields();
-    try {
-      fields.add( new StringField("name", "value", Field.Store.NO) );
-      fail("Document.getFields() should return immutable List");
-    }
-    catch (UnsupportedOperationException e) {
-      // OK
-    }
+    expectThrows(UnsupportedOperationException.class, () -> {
+      fields.add(new StringField("name", "value", Field.Store.NO));
+    });
 
-    try {
+    expectThrows(UnsupportedOperationException.class, () -> {
       fields.clear();
-      fail("Document.getFields() should return immutable List");
-    }
-    catch (UnsupportedOperationException e) {
-      // OK
-    }
+    });
   }
   
   /**
@@ -344,14 +331,11 @@ public class TestDocument extends LuceneTestCase {
   
   // LUCENE-3616
   public void testInvalidFields() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       Tokenizer tok = new MockTokenizer();
       tok.setReader(new StringReader(""));
       new Field("foo", tok, StringField.TYPE_STORED);
-      fail("did not hit expected exc");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
   }
   
   public void testNumericFieldAsString() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/document/TestField.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/document/TestField.java b/lucene/core/src/test/org/apache/lucene/document/TestField.java
index 85336bc..3ac7990 100644
--- a/lucene/core/src/test/org/apache/lucene/document/TestField.java
+++ b/lucene/core/src/test/org/apache/lucene/document/TestField.java
@@ -439,111 +439,75 @@ public class TestField extends LuceneTestCase {
   }
   
   private void trySetByteValue(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setByteValue((byte) 10);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
 
   private void trySetBytesValue(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setBytesValue(new byte[] { 5, 5 });
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   private void trySetBytesRefValue(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setBytesValue(new BytesRef("bogus"));
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   private void trySetDoubleValue(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setDoubleValue(Double.MAX_VALUE);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   private void trySetIntValue(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setIntValue(Integer.MAX_VALUE);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   private void trySetLongValue(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setLongValue(Long.MAX_VALUE);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   private void trySetFloatValue(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setFloatValue(Float.MAX_VALUE);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   private void trySetReaderValue(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setReaderValue(new StringReader("BOO!"));
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   private void trySetShortValue(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setShortValue(Short.MAX_VALUE);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   private void trySetStringValue(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setStringValue("BOO!");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   private void trySetTokenStreamValue(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setTokenStream(new CannedTokenStream(new Token("foo", 0, 3)));
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   private void trySetBoost(Field f) {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       f.setBoost(5.0f);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java b/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
index 2a2bfd2..d1148ef 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
@@ -305,16 +305,13 @@ public class TestAddIndexes extends LuceneTestCase {
     addDocs(writer, 100);
     writer.close();
 
-    writer = newWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())).setOpenMode(OpenMode.APPEND));
-    try {
-      // cannot add self
-      writer.addIndexes(aux, dir);
-      assertTrue(false);
-    }
-    catch (IllegalArgumentException e) {
-      assertEquals(100, writer.maxDoc());
-    }
-    writer.close();
+    // cannot add self
+    IndexWriter writer2 = newWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())).setOpenMode(OpenMode.APPEND));
+    expectThrows(IllegalArgumentException.class, () -> {
+      writer2.addIndexes(aux, dir);
+    });
+    assertEquals(100, writer2.maxDoc());
+    writer2.close();
 
     // make sure the index is correct
     verifyNumDocs(dir, 100);
@@ -1167,12 +1164,9 @@ public class TestAddIndexes extends LuceneTestCase {
       IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
       conf.setCodec(TestUtil.alwaysPostingsFormat(new MemoryPostingsFormat()));
       IndexWriter w = new IndexWriter(dir, conf);
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addIndexes(toAdd);
-        fail("no such codec");
-      } catch (IllegalArgumentException ex) {
-        // expected
-      }
+      });
       w.close();
       IndexReader open = DirectoryReader.open(dir);
       assertEquals(0, open.numDocs());
@@ -1180,12 +1174,9 @@ public class TestAddIndexes extends LuceneTestCase {
       dir.close();
     }
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       DirectoryReader.open(toAdd);
-      fail("no such codec");
-    } catch (IllegalArgumentException ex) {
-      // expected
-    }
+    });
     toAdd.close();
   }
 
@@ -1282,12 +1273,9 @@ public class TestAddIndexes extends LuceneTestCase {
     IndexWriterConfig iwc = newIndexWriterConfig(new MockAnalyzer(random()));
     RandomIndexWriter w2 = new RandomIndexWriter(random(), dest, iwc);
 
-    try {
+    expectThrows(LockObtainFailedException.class, () -> {
       w2.addIndexes(src);
-      fail("did not hit expected exception");
-    } catch (LockObtainFailedException lofe) {
-      // expected
-    }
+    });
 
     w1.close();
     w2.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java
index a8d3870..4025f58 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java
@@ -431,19 +431,13 @@ public class TestBinaryDocValuesUpdates extends LuceneTestCase {
     writer.commit();
     writer.addDocument(doc); // in-memory document
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       writer.updateBinaryDocValue(new Term("key", "doc"), "bdv", toBytes(17L));
-      fail("should not have allowed creating new fields through update");
-    } catch (IllegalArgumentException e) {
-      // ok
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       writer.updateBinaryDocValue(new Term("key", "doc"), "foo", toBytes(17L));
-      fail("should not have allowed updating an existing field to binary-dv");
-    } catch (IllegalArgumentException e) {
-      // ok
-    }
+    });
     
     writer.close();
     dir.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestCodecUtil.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCodecUtil.java b/lucene/core/src/test/org/apache/lucene/index/TestCodecUtil.java
index 79fbdeb..9752ce3 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestCodecUtil.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestCodecUtil.java
@@ -54,23 +54,17 @@ public class TestCodecUtil extends LuceneTestCase {
     }
     RAMFile file = new RAMFile();
     IndexOutput output = new RAMOutputStream(file, true);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       CodecUtil.writeHeader(output, tooLong.toString(), 5);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   public void testWriteNonAsciiHeader() throws Exception {
     RAMFile file = new RAMFile();
     IndexOutput output = new RAMOutputStream(file, true);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       CodecUtil.writeHeader(output, "\u1234", 5);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   public void testReadHeaderWrongMagic() throws Exception {
@@ -80,12 +74,9 @@ public class TestCodecUtil extends LuceneTestCase {
     output.close();
     
     IndexInput input = new RAMInputStream("file", file);
-    try {
+    expectThrows(CorruptIndexException.class, () -> {
       CodecUtil.checkHeader(input, "bogus", 1, 1);
-      fail("didn't get expected exception");
-    } catch (CorruptIndexException expected) {
-      // expected
-    }
+    });
   }
   
   public void testChecksumEntireFile() throws Exception {
@@ -111,15 +102,13 @@ public class TestCodecUtil extends LuceneTestCase {
     
     ChecksumIndexInput input = new BufferedChecksumIndexInput(new RAMInputStream("file", file));
     Exception mine = new RuntimeException("fake exception");
-    try {
+    RuntimeException expected = expectThrows(RuntimeException.class, () -> {
       CodecUtil.checkFooter(input, mine);
-      fail("didn't get expected exception");
-    } catch (RuntimeException expected) {
-      assertEquals("fake exception", expected.getMessage());
-      Throwable suppressed[] = expected.getSuppressed();
-      assertEquals(1, suppressed.length);
-      assertTrue(suppressed[0].getMessage().contains("checksum passed"));
-    }
+    });
+    assertEquals("fake exception", expected.getMessage());
+    Throwable suppressed[] = expected.getSuppressed();
+    assertEquals(1, suppressed.length);
+    assertTrue(suppressed[0].getMessage().contains("checksum passed"));
     input.close();
   }
   
@@ -135,15 +124,13 @@ public class TestCodecUtil extends LuceneTestCase {
     CodecUtil.checkHeader(input, "FooBar", 5, 5);
     assertEquals("this is the data", input.readString());
     Exception mine = new RuntimeException("fake exception");
-    try {
+    RuntimeException expected = expectThrows(RuntimeException.class, () -> {
       CodecUtil.checkFooter(input, mine);
-      fail("didn't get expected exception");
-    } catch (RuntimeException expected) {
-      assertEquals("fake exception", expected.getMessage());
-      Throwable suppressed[] = expected.getSuppressed();
-      assertEquals(1, suppressed.length);
-      assertTrue(suppressed[0].getMessage().contains("checksum passed"));
-    }
+    });
+    assertEquals("fake exception", expected.getMessage());
+    Throwable suppressed[] = expected.getSuppressed();
+    assertEquals(1, suppressed.length);
+    assertTrue(suppressed[0].getMessage().contains("checksum passed"));
     input.close();
   }
   
@@ -161,15 +148,13 @@ public class TestCodecUtil extends LuceneTestCase {
     // bogusly read a byte too far (can happen)
     input.readByte();
     Exception mine = new RuntimeException("fake exception");
-    try {
+    RuntimeException expected = expectThrows(RuntimeException.class, () -> {
       CodecUtil.checkFooter(input, mine);
-      fail("didn't get expected exception");
-    } catch (RuntimeException expected) {
-      assertEquals("fake exception", expected.getMessage());
-      Throwable suppressed[] = expected.getSuppressed();
-      assertEquals(1, suppressed.length);
-      assertTrue(suppressed[0].getMessage().contains("checksum status indeterminate"));
-    }
+    });
+    assertEquals("fake exception", expected.getMessage());
+    Throwable suppressed[] = expected.getSuppressed();
+    assertEquals(1, suppressed.length);
+    assertTrue(suppressed[0].getMessage().contains("checksum status indeterminate"));
     input.close();
   }
   
@@ -187,15 +172,13 @@ public class TestCodecUtil extends LuceneTestCase {
     CodecUtil.checkHeader(input, "FooBar", 5, 5);
     assertEquals("this is the data", input.readString());
     Exception mine = new RuntimeException("fake exception");
-    try {
+    RuntimeException expected = expectThrows(RuntimeException.class, () -> {
       CodecUtil.checkFooter(input, mine);
-      fail("didn't get expected exception");
-    } catch (RuntimeException expected) {
-      assertEquals("fake exception", expected.getMessage());
-      Throwable suppressed[] = expected.getSuppressed();
-      assertEquals(1, suppressed.length);
-      assertTrue(suppressed[0].getMessage().contains("checksum failed"));
-    }
+    });
+    assertEquals("fake exception", expected.getMessage());
+    Throwable suppressed[] = expected.getSuppressed();
+    assertEquals(1, suppressed.length);
+    assertTrue(suppressed[0].getMessage().contains("checksum failed"));
     input.close();
   }
   
@@ -219,12 +202,9 @@ public class TestCodecUtil extends LuceneTestCase {
     }
     RAMFile file = new RAMFile();
     IndexOutput output = new RAMOutputStream(file, true);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       CodecUtil.writeIndexHeader(output, "foobar", 5, StringHelper.randomId(), tooLong.toString());
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   public void testWriteVeryLongSuffix() throws Exception {
@@ -248,12 +228,9 @@ public class TestCodecUtil extends LuceneTestCase {
   public void testWriteNonAsciiSuffix() throws Exception {
     RAMFile file = new RAMFile();
     IndexOutput output = new RAMOutputStream(file, true);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       CodecUtil.writeIndexHeader(output, "foobar", 5, StringHelper.randomId(), "\u1234");
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   public void testReadBogusCRC() throws Exception {
@@ -267,12 +244,9 @@ public class TestCodecUtil extends LuceneTestCase {
     IndexInput input = new RAMInputStream("file", file);
     // read 3 bogus values
     for (int i = 0; i < 3; i++) {
-      try {
+      expectThrows(CorruptIndexException.class, () -> {
         CodecUtil.readCRC(input);
-        fail("didn't get expected exception");
-      } catch (CorruptIndexException expected) {
-        // expected
-      }
+      });
     }
     // good value
     CodecUtil.readCRC(input);
@@ -311,28 +285,19 @@ public class TestCodecUtil extends LuceneTestCase {
     };
     
     fakeChecksum.set(-1L); // bad
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       CodecUtil.writeCRC(fakeOutput);
-      fail("didn't get expected exception");
-    } catch (IllegalStateException expected) {
-      // expected exception
-    }
+    });
     
     fakeChecksum.set(1L << 32); // bad
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       CodecUtil.writeCRC(fakeOutput);
-      fail("didn't get expected exception");
-    } catch (IllegalStateException expected) {
-      // expected exception
-    }
+    });
     
     fakeChecksum.set(-(1L << 32)); // bad
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       CodecUtil.writeCRC(fakeOutput);
-      fail("didn't get expected exception");
-    } catch (IllegalStateException expected) {
-      // expected exception
-    }
+    });
     
     fakeChecksum.set((1L << 32) - 1); // ok
     CodecUtil.writeCRC(fakeOutput);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java b/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
index 4c1bada..5e885e3 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
@@ -395,18 +395,12 @@ public class TestConcurrentMergeScheduler extends LuceneTestCase {
 
   public void testInvalidMaxMergeCountAndThreads() throws Exception {
     ConcurrentMergeScheduler cms = new ConcurrentMergeScheduler();
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       cms.setMaxMergesAndThreads(ConcurrentMergeScheduler.AUTO_DETECT_MERGES_AND_THREADS, 3);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // good
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       cms.setMaxMergesAndThreads(3, ConcurrentMergeScheduler.AUTO_DETECT_MERGES_AND_THREADS);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // good
-    }
+    });
   }
 
   public void testLiveMaxMergeCount() throws Exception {
@@ -605,19 +599,13 @@ public class TestConcurrentMergeScheduler extends LuceneTestCase {
     assertEquals(4, cms.getMaxMergeCount());
     assertEquals(3, cms.getMaxThreadCount());
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       cms.setMaxMergesAndThreads(ConcurrentMergeScheduler.AUTO_DETECT_MERGES_AND_THREADS, 4);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       cms.setMaxMergesAndThreads(4, ConcurrentMergeScheduler.AUTO_DETECT_MERGES_AND_THREADS);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
     cms.setMaxMergesAndThreads(ConcurrentMergeScheduler.AUTO_DETECT_MERGES_AND_THREADS, ConcurrentMergeScheduler.AUTO_DETECT_MERGES_AND_THREADS);
     assertEquals(ConcurrentMergeScheduler.AUTO_DETECT_MERGES_AND_THREADS, cms.getMaxMergeCount());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java b/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java
index aebfb50..9fd20ab 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java
@@ -72,13 +72,11 @@ public class TestCrashCausesCorruptIndex extends LuceneTestCase  {
             
     crashAfterCreateOutput.setCrashAfterCreateOutput("pending_segments_2");
     indexWriter.addDocument(getDocument());
-    try {
-      // tries to write segments_2 but hits fake exc:
+    // tries to write segments_2 but hits fake exc:
+    expectThrows(CrashingException.class, () -> {
       indexWriter.commit();
-      fail("should have hit CrashingException");
-    } catch (CrashingException e) {
-      // expected
-    }
+    });
+
     // writes segments_3
     indexWriter.close();
     assertFalse(slowFileExists(realDirectory, "segments_2"));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
index f65b079..24b2c50 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
@@ -718,12 +718,9 @@ public class TestDirectoryReader extends LuceneTestCase {
   public void testNoDir() throws Throwable {
     Path tempDir = createTempDir("doesnotexist");
     Directory dir = newFSDirectory(tempDir);
-    try {
+    expectThrows(IndexNotFoundException.class, () -> {
       DirectoryReader.open(dir);
-      fail("did not hit expected exception");
-    } catch (IndexNotFoundException nsde) {
-      // expected
-    }
+    });
     dir.close();
   }
   
@@ -955,12 +952,9 @@ public class TestDirectoryReader extends LuceneTestCase {
     DirectoryReader r = writer.getReader();
     writer.close();
     r.document(0);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       r.document(1);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
     r.close();
     dir.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
index 189ef20..6afa091 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
@@ -672,13 +672,9 @@ public class TestDirectoryReaderReopen extends LuceneTestCase {
 
     // Now reopen:
     //System.out.println("TEST: now reopen");
-    try {
-      IndexReader r2 = DirectoryReader.openIfChanged(r);
-      //System.out.println("got " + r2);
-      fail("didn't hit exception");
-    } catch (FakeIOException fio) {
-      // expected
-    }
+    expectThrows(FakeIOException.class, () -> {
+      DirectoryReader.openIfChanged(r);
+    });
     
     IndexSearcher s = newSearcher(r);
     assertEquals(1, s.search(new TermQuery(new Term("id", "id")), 1).totalHits);
@@ -726,12 +722,9 @@ public class TestDirectoryReaderReopen extends LuceneTestCase {
     w.commit();
     w.close();
 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       DirectoryReader.openIfChanged(r);
-      fail("didn't hit expected exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
 
     r.close();
     w.close();
@@ -772,12 +765,9 @@ public class TestDirectoryReaderReopen extends LuceneTestCase {
     w.commit();
     w.close();
 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       DirectoryReader.openIfChanged(r);
-      fail("didn't hit expected exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
 
     r.close();
     dir.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestDocInverterPerFieldErrorInfo.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocInverterPerFieldErrorInfo.java b/lucene/core/src/test/org/apache/lucene/index/TestDocInverterPerFieldErrorInfo.java
index 1e93478..17e0f2e 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDocInverterPerFieldErrorInfo.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDocInverterPerFieldErrorInfo.java
@@ -76,14 +76,12 @@ public class TestDocInverterPerFieldErrorInfo extends LuceneTestCase {
     writer = new IndexWriter(dir, c);
     Document doc = new Document();
     doc.add(newField("distinctiveFieldName", "aaa ", storedTextType));
-    try {
+    expectThrows(BadNews.class, () -> {
       writer.addDocument(doc);
-      fail("Failed to fail.");
-    } catch(BadNews badNews) {
-      infoPrintStream.flush();
-      String infoStream = new String(infoBytes.toByteArray(), IOUtils.UTF_8);
-      assertTrue(infoStream.contains("distinctiveFieldName"));
-    }
+    });
+    infoPrintStream.flush();
+    String infoStream = new String(infoBytes.toByteArray(), IOUtils.UTF_8);
+    assertTrue(infoStream.contains("distinctiveFieldName"));
 
     writer.close();
     dir.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestDocValues.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocValues.java b/lucene/core/src/test/org/apache/lucene/index/TestDocValues.java
index b8573cb..ad4d60c 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDocValues.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDocValues.java
@@ -69,30 +69,24 @@ public class TestDocValues extends LuceneTestCase {
     LeafReader r = getOnlySegmentReader(dr);
    
     // errors
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getBinary(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getNumeric(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSorted(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSortedSet(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSortedNumeric(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getDocsWithField(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
     dr.close();
     iw.close();
@@ -117,18 +111,15 @@ public class TestDocValues extends LuceneTestCase {
     assertNotNull(DocValues.getDocsWithField(r, "foo"));
     
     // errors
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getBinary(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSorted(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSortedSet(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
     dr.close();
     iw.close();
@@ -152,22 +143,18 @@ public class TestDocValues extends LuceneTestCase {
     assertNotNull(DocValues.getDocsWithField(r, "foo"));
     
     // errors
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getNumeric(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSorted(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSortedSet(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSortedNumeric(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
     dr.close();
     iw.close();
@@ -193,14 +180,12 @@ public class TestDocValues extends LuceneTestCase {
     assertNotNull(DocValues.getDocsWithField(r, "foo"));
     
     // errors
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getNumeric(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSortedNumeric(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
     dr.close();
     iw.close();
@@ -224,22 +209,18 @@ public class TestDocValues extends LuceneTestCase {
     assertNotNull(DocValues.getDocsWithField(r, "foo"));
     
     // errors
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getBinary(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getNumeric(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSorted(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSortedNumeric(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
     dr.close();
     iw.close();
@@ -263,22 +244,18 @@ public class TestDocValues extends LuceneTestCase {
     assertNotNull(DocValues.getDocsWithField(r, "foo"));
     
     // errors
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getBinary(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getNumeric(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSorted(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       DocValues.getSortedSet(r, "foo");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
     dr.close();
     iw.close();


[23/53] [abbrv] lucene-solr git commit: Merge remote-tracking branch 'origin/master'

Posted by no...@apache.org.
Merge remote-tracking branch 'origin/master'


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5c024e6a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5c024e6a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5c024e6a

Branch: refs/heads/apiv2
Commit: 5c024e6afc8aabae4cbfa15e45df29b7e92484ad
Parents: 5a15fed aef2ff5
Author: Noble Paul <no...@apache.org>
Authored: Sun Feb 21 20:52:05 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Sun Feb 21 20:52:05 2016 +0530

----------------------------------------------------------------------
 .../lucene/index/TestBackwardsCompatibility.java   |   4 +++-
 .../org/apache/lucene/index/index.5.5.0-cfs.zip    | Bin 0 -> 24776 bytes
 .../org/apache/lucene/index/index.5.5.0-nocfs.zip  | Bin 0 -> 13756 bytes
 3 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[29/53] [abbrv] lucene-solr git commit: Merge branch 'patch-1' of https://github.com/arafalov/lucene-solr-1 This closes apache/lucene-solr#9

Posted by no...@apache.org.
Merge branch 'patch-1' of https://github.com/arafalov/lucene-solr-1
This closes apache/lucene-solr#9


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/16cce9f8
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/16cce9f8
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/16cce9f8

Branch: refs/heads/apiv2
Commit: 16cce9f80fd1dbcd9d07afbf6abdf0fb8fd76c18
Parents: 261681c 5870dce
Author: Uwe Schindler <us...@apache.org>
Authored: Mon Feb 22 08:46:41 2016 +0100
Committer: Uwe Schindler <us...@apache.org>
Committed: Mon Feb 22 08:55:28 2016 +0100

----------------------------------------------------------------------

----------------------------------------------------------------------



[38/53] [abbrv] lucene-solr git commit: SOLR-8599: After a failed connection during construction of SolrZkClient attempt to retry until a connection can be made

Posted by no...@apache.org.
SOLR-8599: After a failed connection during construction of SolrZkClient attempt to retry until a connection can be made


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/2c0a5e30
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/2c0a5e30
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/2c0a5e30

Branch: refs/heads/apiv2
Commit: 2c0a5e30364d83dc82383075a5f7c65200022494
Parents: eeee1c3
Author: Dennis Gove <dp...@gmail.com>
Authored: Wed Feb 10 15:02:18 2016 -0500
Committer: Dennis Gove <dp...@gmail.com>
Committed: Mon Feb 22 19:25:16 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  3 +
 .../solr/cloud/ConnectionManagerTest.java       | 46 ++++++++++
 .../solr/common/cloud/ConnectionManager.java    | 96 +++++++++++++-------
 3 files changed, 110 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2c0a5e30/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 866fdde..d834c37 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -198,6 +198,9 @@ Bug Fixes
 * SOLR-8697: Scope ZK election nodes by session to prevent elections from interfering with each other
   and other small LeaderElector improvements. (Scott Blum via Mark Miller)
 
+* SOLR-8599: After a failed connection during construction of SolrZkClient attempt to retry until a connection
+  can be made. (Keith Laban, Dennis Gove)
+
 Optimizations
 ----------------------
 * SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2c0a5e30/solr/core/src/test/org/apache/solr/cloud/ConnectionManagerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/ConnectionManagerTest.java b/solr/core/src/test/org/apache/solr/cloud/ConnectionManagerTest.java
index 15baaca..c16d758 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ConnectionManagerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ConnectionManagerTest.java
@@ -16,14 +16,20 @@
  */
 package org.apache.solr.cloud;
 
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.common.cloud.ConnectionManager;
 import org.apache.solr.common.cloud.SolrZkClient;
+import org.apache.solr.util.DefaultSolrThreadFactory;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher.Event.EventType;
 import org.apache.zookeeper.Watcher.Event.KeeperState;
 import org.junit.Ignore;
+import org.junit.Test;
 
 @Slow
 public class ConnectionManagerTest extends SolrTestCaseJ4 {
@@ -108,4 +114,44 @@ public class ConnectionManagerTest extends SolrTestCaseJ4 {
       server.shutdown();
     }
   }
+  
+  @Test
+  public void testReconnectWhenZkDisappeared() throws Exception {
+    ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(new DefaultSolrThreadFactory("connectionManagerTest"));
+    
+    // setup a SolrZkClient to do some getBaseUrlForNodeName testing
+    String zkDir = createTempDir("zkData").toFile().getAbsolutePath();
+
+    ZkTestServer server = new ZkTestServer(zkDir);
+    try {
+      server.run();
+
+      AbstractZkTestCase.tryCleanSolrZkNode(server.getZkHost());
+      AbstractZkTestCase.makeSolrZkNode(server.getZkHost());
+      
+      SolrZkClient zkClient = new SolrZkClient(server.getZkAddress(), TIMEOUT);
+      ConnectionManager cm = zkClient.getConnectionManager();
+      try {
+        assertFalse(cm.isLikelyExpired());
+        assertTrue(cm.isConnected());
+        
+        
+        cm.setZkServerAddress("http://BADADDRESS");
+        executor.schedule(() -> {
+          cm.setZkServerAddress(server.getZkAddress()); 
+        }, 5, TimeUnit.SECONDS);
+        
+        // reconnect -- should no longer be likely expired
+        cm.process(new WatchedEvent(EventType.None, KeeperState.Expired, ""));
+        assertFalse(cm.isLikelyExpired());
+        assertTrue(cm.isConnected());
+      } finally {
+        cm.close();
+        zkClient.close();
+        executor.shutdown();
+      }
+    } finally {
+      server.shutdown();
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2c0a5e30/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
index c3cf768..cc9327a 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
@@ -37,7 +37,10 @@ public class ConnectionManager implements Watcher {
 
   private final ZkClientConnectionStrategy connectionStrategy;
 
-  private final String zkServerAddress;
+  //expert: mutable for testing
+  private String zkServerAddress;
+
+  
 
   private final SolrZkClient client;
 
@@ -128,40 +131,50 @@ public class ConnectionManager implements Watcher {
         }
       }
       
-      try {
-        connectionStrategy.reconnect(zkServerAddress,
-            client.getZkClientTimeout(), this,
-            new ZkClientConnectionStrategy.ZkUpdate() {
-              @Override
-              public void update(SolrZooKeeper keeper) {
-                try {
-                  waitForConnected(Long.MAX_VALUE);
-                } catch (Exception e1) {
-                  closeKeeper(keeper);
-                  throw new RuntimeException(e1);
-                }
-
-                log.info("Connection with ZooKeeper reestablished.");
-                try {
-                  client.updateKeeper(keeper);
-                } catch (InterruptedException e) {
-                  closeKeeper(keeper);
-                  Thread.currentThread().interrupt();
-                  // we must have been asked to stop
-                  throw new RuntimeException(e);
-                } catch (Exception t) {
-                  closeKeeper(keeper);
-                  throw new RuntimeException(t);
-                }
-
-                if (onReconnect != null) {
-                  onReconnect.command();
+      do {
+        // This loop will break iff a valid connection is made. If a connection is not made then it will repeat and
+        // try again to create a new connection.
+        try {
+          connectionStrategy.reconnect(zkServerAddress,
+              client.getZkClientTimeout(), this,
+              new ZkClientConnectionStrategy.ZkUpdate() {
+                @Override
+                public void update(SolrZooKeeper keeper) {
+                  try {
+                    waitForConnected(Long.MAX_VALUE);
+                  } catch (Exception e1) {
+                    closeKeeper(keeper);
+                    throw new RuntimeException(e1);
+                  }
+  
+                  log.info("Connection with ZooKeeper reestablished.");
+                  try {
+                    client.updateKeeper(keeper);
+                  } catch (InterruptedException e) {
+                    closeKeeper(keeper);
+                    Thread.currentThread().interrupt();
+                    // we must have been asked to stop
+                    throw new RuntimeException(e);
+                  } catch (Exception t) {
+                    closeKeeper(keeper);
+                    throw new RuntimeException(t);
+                  }
+  
+                  if (onReconnect != null) {
+                    onReconnect.command();
+                  }
                 }
-              }
-            });
-      } catch (Exception e) {
-        SolrException.log(log, "", e);
-      }
+              });
+          
+          break;
+          
+        } catch (Exception e) {
+          SolrException.log(log, "", e);
+          log.info("Could not connect due to error, sleeping for 5s and trying agian");
+          waitSleep(1000);
+        }
+        
+      } while (!isClosed);
       log.info("Connected:" + connected);
     } else if (state == KeeperState.Disconnected) {
       log.info("zkClient has disconnected");
@@ -186,6 +199,14 @@ public class ConnectionManager implements Watcher {
   public boolean isLikelyExpired() {
     return isClosed || likelyExpiredState.isLikelyExpired((long) (client.getZkClientTimeout() * 0.90));
   }
+  
+  public synchronized void waitSleep(long waitFor) {
+    try {
+      wait(waitFor);
+    } catch (InterruptedException e) {
+      Thread.currentThread().interrupt();
+    } 
+  }
 
   public synchronized void waitForConnected(long waitForConnection)
       throws TimeoutException {
@@ -234,4 +255,9 @@ public class ConnectionManager implements Watcher {
           "", e);
     }
   }
-}
\ No newline at end of file
+  
+  //expert: mutable for testing
+  public void setZkServerAddress(String zkServerAddress) {
+    this.zkServerAddress = zkServerAddress;
+  }
+}


[14/53] [abbrv] lucene-solr git commit: LUCENE-6989: Make casting to Runnable interface in cleaner hack easier to understand

Posted by no...@apache.org.
LUCENE-6989: Make casting to Runnable interface in cleaner hack easier to understand


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/0f29b3ec
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0f29b3ec
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0f29b3ec

Branch: refs/heads/apiv2
Commit: 0f29b3ec7fd638341915f83384656e72dff868ec
Parents: 9418369
Author: Uwe Schindler <us...@apache.org>
Authored: Sat Feb 20 01:05:45 2016 +0100
Committer: Uwe Schindler <us...@apache.org>
Committed: Sat Feb 20 01:05:45 2016 +0100

----------------------------------------------------------------------
 .../org/apache/lucene/store/MMapDirectory.java  | 21 +++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0f29b3ec/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java b/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
index 348b36b..ff16324 100644
--- a/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
@@ -343,8 +343,8 @@ public class MMapDirectory extends FSDirectory {
       
       final Method m = directBufferClass.getMethod("cleaner");
       m.setAccessible(true);
-      final MethodHandle directBufferCleanerMethod = lookup.unreflect(m);
-      final Class<?> cleanerClass = directBufferCleanerMethod.type().returnType();
+      MethodHandle directBufferCleanerMethod = lookup.unreflect(m);
+      Class<?> cleanerClass = directBufferCleanerMethod.type().returnType();
       
       final MethodHandle cleanMethod;
       if (Runnable.class.isAssignableFrom(cleanerClass)) {
@@ -353,19 +353,22 @@ public class MMapDirectory extends FSDirectory {
         if (sm != null) {
           sm.checkPackageAccess("jdk.internal.ref");
         }
-        cleanMethod = explicitCastArguments(lookup.findVirtual(Runnable.class, "run", methodType(void.class)),
-            methodType(void.class, cleanerClass));
+        // cast return value of cleaner() to Runnable:
+        directBufferCleanerMethod = directBufferCleanerMethod.asType(directBufferCleanerMethod.type().changeReturnType(Runnable.class));
+        cleanerClass = Runnable.class;
+        // lookup run() method on the interface instead of Cleaner:
+        cleanMethod = lookup.findVirtual(cleanerClass, "run", methodType(void.class));
       } else {
         // can be either the old internal "sun.misc.Cleaner" or
         // the new Java 9 "java.lang.ref.Cleaner$Cleanable":
         cleanMethod = lookup.findVirtual(cleanerClass, "clean", methodType(void.class));
       }
       
-      final MethodHandle nonNullTest = explicitCastArguments(lookup.findStatic(Objects.class, "nonNull", methodType(boolean.class, Object.class)),
-          methodType(boolean.class, cleanerClass));
-      final MethodHandle noop = dropArguments(explicitCastArguments(constant(Void.class, null), methodType(void.class)), 0, cleanerClass);
-      final MethodHandle unmapper = explicitCastArguments(filterReturnValue(directBufferCleanerMethod, guardWithTest(nonNullTest, cleanMethod, noop)),
-          methodType(void.class, ByteBuffer.class));
+      final MethodHandle nonNullTest = lookup.findStatic(Objects.class, "nonNull", methodType(boolean.class, Object.class))
+          .asType(methodType(boolean.class, cleanerClass));
+      final MethodHandle noop = dropArguments(constant(Void.class, null).asType(methodType(void.class)), 0, cleanerClass);
+      final MethodHandle unmapper = filterReturnValue(directBufferCleanerMethod, guardWithTest(nonNullTest, cleanMethod, noop))
+          .asType(methodType(void.class, ByteBuffer.class));
       
       return (BufferCleaner) (ByteBufferIndexInput parent, ByteBuffer buffer) -> {
         if (directBufferClass.isInstance(buffer)) {


[39/53] [abbrv] lucene-solr git commit: SOLR-8666: Adds header 'zkConnected' to response of SearchHandler and PingRequestHandler

Posted by no...@apache.org.
SOLR-8666: Adds header 'zkConnected' to response of SearchHandler and PingRequestHandler

Header is used to notify the client when a connection to zookeeper has been lost and there is a possibility of stale data on the node the request is coming from.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/d6105334
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d6105334
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d6105334

Branch: refs/heads/apiv2
Commit: d6105334a0fb46dbb2b5d4a4f8a9d9355a6d7a17
Parents: 2c0a5e3
Author: Dennis Gove <dp...@gmail.com>
Authored: Fri Feb 12 08:14:58 2016 -0500
Committer: Dennis Gove <dp...@gmail.com>
Committed: Mon Feb 22 19:25:17 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  4 ++
 .../apache/solr/handler/PingRequestHandler.java |  7 ++-
 .../solr/handler/component/SearchHandler.java   | 19 +++++++-
 .../solr/handler/PingRequestHandlerTest.java    |  3 ++
 .../handler/component/SearchHandlerTest.java    | 47 ++++++++++++++++++++
 5 files changed, 77 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d6105334/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index d834c37..a85e6fa 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -201,6 +201,10 @@ Bug Fixes
 * SOLR-8599: After a failed connection during construction of SolrZkClient attempt to retry until a connection
   can be made. (Keith Laban, Dennis Gove)
 
+* SOLR-8666: Adds header 'zkConnected' to response of SearchHandler and PingRequestHandler to notify the client when
+  a connection to zookeeper has been lost and there is a possibility of stale data on the node the request is coming
+  from. (Keith Laban, Dennis Gove)
+
 Optimizations
 ----------------------
 * SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d6105334/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java b/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java
index 426bb1a..5df46f5 100644
--- a/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java
@@ -278,7 +278,12 @@ public class PingRequestHandler extends RequestHandlerBase implements SolrCoreAw
       try {
         SolrQueryResponse pingrsp = new SolrQueryResponse();
         core.execute(handler, req, pingrsp );
-        ex = pingrsp.getException();       
+        ex = pingrsp.getException(); 
+        NamedList<Object> headers = rsp.getResponseHeader();
+        if(headers != null) {
+          headers.add("zkConnected", pingrsp.getResponseHeader().get("zkConnected"));
+        }
+        
       }
       catch( Exception e ) {
         ex = e;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d6105334/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
index 9cb4183..3518ecb 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
@@ -28,6 +28,7 @@ import java.util.Set;
 import org.apache.lucene.index.ExitableDirectoryReader;
 import org.apache.lucene.util.Version;
 import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.cloud.ZkController;
 import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.CommonParams;
@@ -36,6 +37,7 @@ import org.apache.solr.common.params.ShardParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SimpleOrderedMap;
 import org.apache.solr.core.CloseHook;
+import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.PluginInfo;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.handler.RequestHandlerBase;
@@ -201,8 +203,9 @@ public class SearchHandler extends RequestHandlerBase implements SolrCoreAware ,
   private ShardHandler getAndPrepShardHandler(SolrQueryRequest req, ResponseBuilder rb) {
     ShardHandler shardHandler = null;
 
-    rb.isDistrib = req.getParams().getBool("distrib", req.getCore().getCoreDescriptor()
-        .getCoreContainer().isZooKeeperAware());
+    CoreContainer cc = req.getCore().getCoreDescriptor().getCoreContainer();
+    boolean isZkAware = cc.isZooKeeperAware();
+    rb.isDistrib = req.getParams().getBool("distrib", isZkAware);
     if (!rb.isDistrib) {
       // for back compat, a shards param with URLs like localhost:8983/solr will mean that this
       // search is distributed.
@@ -218,6 +221,18 @@ public class SearchHandler extends RequestHandlerBase implements SolrCoreAware ,
       }
     }
 
+    if(isZkAware) {
+      ZkController zkController = cc.getZkController();
+      NamedList<Object> headers = rb.rsp.getResponseHeader();
+      if(headers != null) {
+        headers.add("zkConnected", 
+            zkController != null 
+          ? !zkController.getZkClient().getConnectionManager().isLikelyExpired() 
+          : false);
+      }
+      
+    }
+
     return shardHandler;
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d6105334/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java
index 7a3a640..b95a5f6 100644
--- a/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java
@@ -198,10 +198,13 @@ public class PingRequestHandlerTest extends SolrTestCaseJ4 {
       reqDistrib.setDistrib(true);
       SolrPingResponse rsp = reqDistrib.process(cloudSolrClient, collectionName);
       assertEquals(0, rsp.getStatus()); 
+      assertTrue(rsp.getResponseHeader().getBooleanArg(("zkConnected")));
+
       
       SolrPing reqNonDistrib = new SolrPing();
       rsp = reqNonDistrib.process(cloudSolrClient, collectionName);
       assertEquals(0, rsp.getStatus());   
+      assertTrue(rsp.getResponseHeader().getBooleanArg(("zkConnected")));
 
       // delete the collection we created earlier
       miniCluster.deleteCollection(collectionName);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d6105334/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
index f35754b..7e8ab47 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
@@ -16,12 +16,22 @@
  */
 package org.apache.solr.handler.component;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.client.solrj.SolrResponse;
+import org.apache.solr.client.solrj.embedded.JettySolrRunner;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.request.QueryRequest;
+import org.apache.solr.client.solrj.request.SolrPing;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.client.solrj.response.SolrPingResponse;
+import org.apache.solr.cloud.MiniSolrCloudCluster;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.core.SolrCore;
+import org.apache.solr.response.SolrQueryResponse;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -99,4 +109,41 @@ public class SearchHandlerTest extends SolrTestCaseJ4
     //Debug component is always last in this case
     assertEquals( core.getSearchComponent( DebugComponent.COMPONENT_NAME ), comps.get( comps.size()-1 ) );
   }
+  
+  @Test
+  public void testZkConnected() throws Exception{
+    MiniSolrCloudCluster miniCluster = new MiniSolrCloudCluster(5, createTempDir(), buildJettyConfig("/solr"));
+
+    final CloudSolrClient cloudSolrClient = miniCluster.getSolrClient();
+
+    try {
+      assertNotNull(miniCluster.getZkServer());
+      List<JettySolrRunner> jettys = miniCluster.getJettySolrRunners();
+      assertEquals(5, jettys.size());
+      for (JettySolrRunner jetty : jettys) {
+        assertTrue(jetty.isRunning());
+      }
+
+      // create collection
+      String collectionName = "testSolrCloudCollection";
+      String configName = "solrCloudCollectionConfig";
+      File configDir = new File(SolrTestCaseJ4.TEST_HOME() + File.separator + "collection1" + File.separator + "conf");
+      miniCluster.uploadConfigDir(configDir, configName);
+      miniCluster.createCollection(collectionName, 2, 2, configName, null); 
+   
+      
+    
+      QueryRequest req = new QueryRequest();
+      QueryResponse rsp = req.process(cloudSolrClient, collectionName);
+      assertTrue(rsp.getResponseHeader().getBooleanArg("zkConnected"));
+    
+      
+      // delete the collection we created earlier
+      miniCluster.deleteCollection(collectionName);
+
+    }
+    finally {
+      miniCluster.shutdown();
+    }
+  }
 }


[03/53] [abbrv] lucene-solr git commit: LUCENE-7037: Switch all exceptions tests to expectThrows()

Posted by no...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/store/TestSingleInstanceLockFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestSingleInstanceLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestSingleInstanceLockFactory.java
index be0bef2..14863ff 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestSingleInstanceLockFactory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestSingleInstanceLockFactory.java
@@ -44,16 +44,10 @@ public class TestSingleInstanceLockFactory extends BaseLockFactoryTestCase {
     IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random())));
     
     // Create a 2nd IndexWriter.  This should fail:
-    IndexWriter writer2 = null;
-    try {
-      writer2 = new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random())).setOpenMode(OpenMode.APPEND));
-      fail("Should have hit an IOException with two IndexWriters on default SingleInstanceLockFactory");
-    } catch (IOException e) {
-    }
+    expectThrows(IOException.class, () -> {
+      new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random())).setOpenMode(OpenMode.APPEND));
+    });
     
     writer.close();
-    if (writer2 != null) {
-      writer2.close();
-    }
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestArrayUtil.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestArrayUtil.java b/lucene/core/src/test/org/apache/lucene/util/TestArrayUtil.java
index c289120..77471f9 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestArrayUtil.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestArrayUtil.java
@@ -50,12 +50,9 @@ public class TestArrayUtil extends LuceneTestCase {
   }
 
   public void testTooBig() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       ArrayUtil.oversize(ArrayUtil.MAX_ARRAY_LENGTH+1, 1);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
   }
 
   public void testExactLimit() {
@@ -74,48 +71,32 @@ public class TestArrayUtil extends LuceneTestCase {
   }
 
   public void testParseInt() throws Exception {
-    int test;
-    try {
-      test = ArrayUtil.parseInt("".toCharArray());
-      assertTrue(false);
-    } catch (NumberFormatException e) {
-      //expected
-    }
-    try {
-      test = ArrayUtil.parseInt("foo".toCharArray());
-      assertTrue(false);
-    } catch (NumberFormatException e) {
-      //expected
-    }
-    try {
-      test = ArrayUtil.parseInt(String.valueOf(Long.MAX_VALUE).toCharArray());
-      assertTrue(false);
-    } catch (NumberFormatException e) {
-      //expected
-    }
-    try {
-      test = ArrayUtil.parseInt("0.34".toCharArray());
-      assertTrue(false);
-    } catch (NumberFormatException e) {
-      //expected
-    }
+    expectThrows(NumberFormatException.class, () -> {
+      ArrayUtil.parseInt("".toCharArray());
+    });
 
-    try {
-      test = ArrayUtil.parseInt("1".toCharArray());
-      assertTrue(test + " does not equal: " + 1, test == 1);
-      test = ArrayUtil.parseInt("-10000".toCharArray());
-      assertTrue(test + " does not equal: " + -10000, test == -10000);
-      test = ArrayUtil.parseInt("1923".toCharArray());
-      assertTrue(test + " does not equal: " + 1923, test == 1923);
-      test = ArrayUtil.parseInt("-1".toCharArray());
-      assertTrue(test + " does not equal: " + -1, test == -1);
-      test = ArrayUtil.parseInt("foo 1923 bar".toCharArray(), 4, 4);
-      assertTrue(test + " does not equal: " + 1923, test == 1923);
-    } catch (NumberFormatException e) {
-      e.printStackTrace();
-      assertTrue(false);
-    }
+    expectThrows(NumberFormatException.class, () -> {
+      ArrayUtil.parseInt("foo".toCharArray());
+    });
+
+    expectThrows(NumberFormatException.class, () -> {
+      ArrayUtil.parseInt(String.valueOf(Long.MAX_VALUE).toCharArray());
+    });
+
+    expectThrows(NumberFormatException.class, () -> {
+      ArrayUtil.parseInt("0.34".toCharArray());
+    });
 
+    int test = ArrayUtil.parseInt("1".toCharArray());
+    assertTrue(test + " does not equal: " + 1, test == 1);
+    test = ArrayUtil.parseInt("-10000".toCharArray());
+    assertTrue(test + " does not equal: " + -10000, test == -10000);
+    test = ArrayUtil.parseInt("1923".toCharArray());
+    assertTrue(test + " does not equal: " + 1923, test == 1923);
+    test = ArrayUtil.parseInt("-1".toCharArray());
+    assertTrue(test + " does not equal: " + -1, test == -1);
+    test = ArrayUtil.parseInt("foo 1923 bar".toCharArray(), 4, 4);
+    assertTrue(test + " does not equal: " + 1923, test == 1923);
   }
 
   public void testSliceEquals() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java b/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java
index 83becc7..df6c513 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java
@@ -71,12 +71,10 @@ public class TestAttributeSource extends LuceneTestCase {
     // init a third instance missing one Attribute
     AttributeSource src3 = new AttributeSource();
     termAtt = src3.addAttribute(CharTermAttribute.class);
-    try {
+    // The third instance is missing the TypeAttribute, so restoreState() should throw IllegalArgumentException
+    expectThrows(IllegalArgumentException.class, () -> {
       src3.restoreState(state);
-      fail("The third instance is missing the TypeAttribute, so restoreState() should throw IllegalArgumentException");
-    } catch (IllegalArgumentException iae) {
-      // pass
-    }
+    });
   }
   
   public void testCloneAttributes() {
@@ -133,24 +131,22 @@ public class TestAttributeSource extends LuceneTestCase {
   
   @SuppressWarnings({"rawtypes","unchecked"})
   public void testInvalidArguments() throws Exception {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       AttributeSource src = new AttributeSource();
       src.addAttribute(Token.class);
       fail("Should throw IllegalArgumentException");
-    } catch (IllegalArgumentException iae) {}
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       AttributeSource src = new AttributeSource(Token.TOKEN_ATTRIBUTE_FACTORY);
       src.addAttribute(Token.class);
-      fail("Should throw IllegalArgumentException");
-    } catch (IllegalArgumentException iae) {}
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       AttributeSource src = new AttributeSource();
       // break this by unsafe cast
       src.addAttribute((Class) Iterator.class);
-      fail("Should throw IllegalArgumentException");
-    } catch (IllegalArgumentException iae) {}
+    });
   }
   
   public void testLUCENE_3042() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestCharsRef.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestCharsRef.java b/lucene/core/src/test/org/apache/lucene/util/TestCharsRef.java
index c9e5a38..0a4c884 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestCharsRef.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestCharsRef.java
@@ -74,19 +74,13 @@ public class TestCharsRef extends LuceneTestCase {
     
     assertEquals('b', c.charAt(1));
     
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       c.charAt(-1);
-      fail();
-    } catch (IndexOutOfBoundsException expected) {
-      // expected exception
-    }
+    });
     
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       c.charAt(3);
-      fail();
-    } catch (IndexOutOfBoundsException expected) {
-      // expected exception
-    }
+    });
   }
   
   // LUCENE-3590: fix off-by-one in subsequence, and fully obey interface
@@ -115,32 +109,20 @@ public class TestCharsRef extends LuceneTestCase {
     // empty subsequence
     assertEquals("", c.subSequence(0, 0).toString());
     
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       c.subSequence(-1, 1);
-      fail();
-    } catch (IndexOutOfBoundsException expected) {
-      // expected exception
-    }
+    });
     
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       c.subSequence(0, -1);
-      fail();
-    } catch (IndexOutOfBoundsException expected) {
-      // expected exception
-    }
+    });
     
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       c.subSequence(0, 4);
-      fail();
-    } catch (IndexOutOfBoundsException expected) {
-      // expected exception
-    }
+    });
     
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       c.subSequence(2, 1);
-      fail();
-    } catch (IndexOutOfBoundsException expected) {
-      // expected exception
-    }
+    });
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java b/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java
index d2340cb..847553a 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java
@@ -28,12 +28,9 @@ public class TestFilterIterator extends LuceneTestCase {
 
   private static void assertNoMore(Iterator<?> it) {
     assertFalse(it.hasNext());
-    try {
+    expectThrows(NoSuchElementException.class, () -> {
       it.next();
-      fail("Should throw NoSuchElementException");
-    } catch (NoSuchElementException nsee) {
-      // pass
-    }
+    });
     assertFalse(it.hasNext());
   }
 
@@ -132,12 +129,9 @@ public class TestFilterIterator extends LuceneTestCase {
       }
     };
     assertEquals("a", it.next());
-    try {
+    expectThrows(UnsupportedOperationException.class, () -> {
       it.remove();
-      fail("Should throw UnsupportedOperationException");
-    } catch (UnsupportedOperationException oue) {
-      // pass
-    }
+    });
   }
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java b/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
index dc9e3e7..f068b11 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
@@ -110,12 +110,9 @@ public class TestIOUtils extends LuceneTestCase {
     
     // exception: file doesn't exist
     Path fake = dir.resolve("nonexistent");
-    try {
+    expectThrows(IOException.class, () -> {
       IOUtils.spins(fake);
-      fail();
-    } catch (IOException expected) {
-      // ok
-    }
+    });
   }
   
   // fake up a filestore to test some underlying methods

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestLegacyNumericUtils.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestLegacyNumericUtils.java b/lucene/core/src/test/org/apache/lucene/util/TestLegacyNumericUtils.java
index 1d9c41e..621ab96 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestLegacyNumericUtils.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestLegacyNumericUtils.java
@@ -75,12 +75,10 @@ public class TestLegacyNumericUtils extends LuceneTestCase {
       assertEquals( "forward and back conversion should generate same long", vals[i], LegacyNumericUtils.prefixCodedToLong(prefixVals[i].get()) );
 
       // test if decoding values as int fails correctly
-      try {
-        LegacyNumericUtils.prefixCodedToInt(prefixVals[i].get());
-        fail("decoding a prefix coded long value as int should fail");
-      } catch (NumberFormatException e) {
-        // worked
-      }
+      final int index = i;
+      expectThrows(NumberFormatException.class, () -> {
+        LegacyNumericUtils.prefixCodedToInt(prefixVals[index].get());
+      });
     }
     
     // check sort order (prefixVals should be ascending)
@@ -115,12 +113,10 @@ public class TestLegacyNumericUtils extends LuceneTestCase {
       assertEquals( "forward and back conversion should generate same int", vals[i], LegacyNumericUtils.prefixCodedToInt(prefixVals[i].get()) );
       
       // test if decoding values as long fails correctly
-      try {
-        LegacyNumericUtils.prefixCodedToLong(prefixVals[i].get());
-        fail("decoding a prefix coded int value as long should fail");
-      } catch (NumberFormatException e) {
-        // worked
-      }
+      final int index = i;
+      expectThrows(NumberFormatException.class, () -> {
+        LegacyNumericUtils.prefixCodedToLong(prefixVals[index].get());
+      });
     }
     
     // check sort order (prefixVals should be ascending)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestNamedSPILoader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestNamedSPILoader.java b/lucene/core/src/test/org/apache/lucene/util/TestNamedSPILoader.java
index 3194e7b..a093090 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestNamedSPILoader.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestNamedSPILoader.java
@@ -33,10 +33,9 @@ public class TestNamedSPILoader extends LuceneTestCase {
   
   // we want an exception if it's not found.
   public void testBogusLookup() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       Codec.forName("dskfdskfsdfksdfdsf");
-      fail();
-    } catch (IllegalArgumentException expected) {}
+    });
   }
   
   public void testAvailableServices() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java b/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
index 5a46c14..5322531 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
@@ -184,23 +184,17 @@ public class TestOfflineSorter extends LuceneTestCase {
     BufferSize.megabytes(2047);
     BufferSize.megabytes(1);
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       BufferSize.megabytes(2048);
-      fail("max mb is 2047");
-    } catch (IllegalArgumentException e) {
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       BufferSize.megabytes(0);
-      fail("min mb is 0.5");
-    } catch (IllegalArgumentException e) {
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       BufferSize.megabytes(-1);
-      fail("min mb is 0.5");
-    } catch (IllegalArgumentException e) {
-    }
+    });
   }
 
   public void testThreadSafety() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java b/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java
index cd202fe..ba28490 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java
@@ -191,43 +191,43 @@ public class TestPriorityQueue extends LuceneTestCase {
     }
   }
 
-  public void testIterator() {
+  public void testIteratorEmpty() {
     IntegerQueue queue = new IntegerQueue(3);
     
     Iterator<Integer> it = queue.iterator();
     assertFalse(it.hasNext());
-    try {
+    expectThrows(NoSuchElementException.class, () -> {
       it.next();
-      fail();
-    } catch (NoSuchElementException e) {
-      // ok
-    }
+    });
+  }
+  
+  public void testIteratorOne() {
+    IntegerQueue queue = new IntegerQueue(3);
 
     queue.add(1);
-    it = queue.iterator();
+    Iterator<Integer> it = queue.iterator();
     assertTrue(it.hasNext());
     assertEquals(Integer.valueOf(1), it.next());
     assertFalse(it.hasNext());
-    try {
+    expectThrows(NoSuchElementException.class, () -> {
       it.next();
-      fail();
-    } catch (NoSuchElementException e) {
-      // ok
-    }
+    });
+  }
+  
+  public void testIteratorTwo() {
+    IntegerQueue queue = new IntegerQueue(3);
 
+    queue.add(1);
     queue.add(2);
-    it = queue.iterator();
+    Iterator<Integer> it = queue.iterator();
     assertTrue(it.hasNext());
     assertEquals(Integer.valueOf(1), it.next());
     assertTrue(it.hasNext());
     assertEquals(Integer.valueOf(2), it.next());
     assertFalse(it.hasNext());
-    try {
+    expectThrows(NoSuchElementException.class, () -> {
       it.next();
-      fail();
-    } catch (NoSuchElementException e) {
-      // ok
-    }
+    });
   }
 
   public void testIteratorRandom() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java b/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java
index 0ef25ee..d86cdf2 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java
@@ -127,13 +127,9 @@ public class TestUnicodeUtil extends LuceneTestCase {
   }
 
   private void assertcodePointCountThrowsAssertionOn(byte... bytes) {
-    boolean threwAssertion = false;
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       UnicodeUtil.codePointCount(new BytesRef(bytes));
-    } catch (IllegalArgumentException e) {
-      threwAssertion = true;
-    }
-    assertTrue(threwAssertion);
+    });
   }
 
   public void testUTF8toUTF32() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestVersion.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestVersion.java b/lucene/core/src/test/org/apache/lucene/util/TestVersion.java
index fd02ce2..9feadd2 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestVersion.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestVersion.java
@@ -58,34 +58,25 @@ public class TestVersion extends LuceneTestCase {
   }
   
   public void testParseLenientlyExceptions() {
-    try {
+    ParseException expected = expectThrows(ParseException.class, () -> {
       Version.parseLeniently("LUCENE");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("LUCENE"));
-    }
-    try {
+    });
+    assertTrue(expected.getMessage().contains("LUCENE"));
+
+    expected = expectThrows(ParseException.class, () -> {
       Version.parseLeniently("LUCENE_610");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("LUCENE_610"));
-    }
-    try {
+    });
+    assertTrue(expected.getMessage().contains("LUCENE_610"));
+
+    expected = expectThrows(ParseException.class, () -> {
       Version.parseLeniently("LUCENE61");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("LUCENE61"));
-    }
-    try {
+    });
+    assertTrue(expected.getMessage().contains("LUCENE61"));
+
+    expected = expectThrows(ParseException.class, () -> {
       Version.parseLeniently("LUCENE_6.0.0");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("LUCENE_6.0.0"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("LUCENE_6.0.0"));
   }
 
   public void testParseLenientlyOnAllConstants() throws Exception {
@@ -116,101 +107,65 @@ public class TestVersion extends LuceneTestCase {
   }
 
   public void testParseExceptions() {
-    try {
+    ParseException expected = expectThrows(ParseException.class, () -> {
       Version.parse("LUCENE_6_0_0");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("LUCENE_6_0_0"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("LUCENE_6_0_0"));
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       Version.parse("6.256");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("6.256"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("6.256"));
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       Version.parse("6.-1");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("6.-1"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("6.-1"));
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       Version.parse("6.1.256");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("6.1.256"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("6.1.256"));
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       Version.parse("6.1.-1");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("6.1.-1"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("6.1.-1"));
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       Version.parse("6.1.1.3");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("6.1.1.3"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("6.1.1.3"));
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       Version.parse("6.1.1.-1");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("6.1.1.-1"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("6.1.1.-1"));
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       Version.parse("6.1.1.1");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("6.1.1.1"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("6.1.1.1"));
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       Version.parse("6.1.1.2");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("6.1.1.2"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("6.1.1.2"));
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       Version.parse("6.0.0.0");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("6.0.0.0"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("6.0.0.0"));
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       Version.parse("6.0.0.1.42");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("6.0.0.1.42"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("6.0.0.1.42"));
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       Version.parse("6..0.1");
-      fail();
-    } catch (ParseException pe) {
-      // pass
-      assertTrue(pe.getMessage().contains("6..0.1"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("6..0.1"));
   }
   
   public void testDeprecations() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java b/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java
index 38d217d..4dfe86b 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.util;
 
-
 public class TestVirtualMethod extends LuceneTestCase {
 
   private static final VirtualMethod<TestVirtualMethod> publicTestMethod =
@@ -71,35 +70,26 @@ public class TestVirtualMethod extends LuceneTestCase {
 
   @SuppressWarnings({"rawtypes","unchecked"})
   public void testExceptions() {
-    try {
+    // LuceneTestCase is not a subclass and can never override publicTest(String)
+    expectThrows(IllegalArgumentException.class, () -> {
       // cast to Class to remove generics:
       publicTestMethod.getImplementationDistance((Class) LuceneTestCase.class);
-      fail("LuceneTestCase is not a subclass and can never override publicTest(String)");
-    } catch (IllegalArgumentException arg) {
-      // pass
-    }
+    });
     
-    try {
+    // Method bogus() does not exist, so IAE should be thrown
+    expectThrows(IllegalArgumentException.class, () -> {
       new VirtualMethod<>(TestVirtualMethod.class, "bogus");
-      fail("Method bogus() does not exist, so IAE should be thrown");
-    } catch (IllegalArgumentException arg) {
-      // pass
-    }
+    });
     
-    try {
+    // Method publicTest(String) is not declared in TestClass2, so IAE should be thrown
+    expectThrows(IllegalArgumentException.class, () -> {
       new VirtualMethod<>(TestClass2.class, "publicTest", String.class);
-      fail("Method publicTest(String) is not declared in TestClass2, so IAE should be thrown");
-    } catch (IllegalArgumentException arg) {
-      // pass
-    }
+    });
 
-    try {
-      // try to create a second instance of the same baseClass / method combination
+    // try to create a second instance of the same baseClass / method combination
+    expectThrows(UnsupportedOperationException.class, () -> {
       new VirtualMethod<>(TestVirtualMethod.class, "publicTest", String.class);
-      fail("Violating singleton status succeeded");
-    } catch (UnsupportedOperationException arg) {
-      // pass
-    }
+    });
   }
   
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java b/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java
index 4e0c7a5..76e42ab 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java
@@ -141,11 +141,9 @@ public class TestWeakIdentityMap extends LuceneTestCase {
     
     Iterator<String> it = map.keyIterator();
     assertFalse(it.hasNext());
-    try {
+    expectThrows(NoSuchElementException.class, () -> {
       it.next();
-      fail("Should throw NoSuchElementException");
-    } catch (NoSuchElementException nse) {
-    }
+    });
     
     key1 = new String("foo");
     key2 = new String("foo");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/automaton/FiniteStringsIteratorTest.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/FiniteStringsIteratorTest.java b/lucene/core/src/test/org/apache/lucene/util/automaton/FiniteStringsIteratorTest.java
index 57113d0..4edc7ad 100644
--- a/lucene/core/src/test/org/apache/lucene/util/automaton/FiniteStringsIteratorTest.java
+++ b/lucene/core/src/test/org/apache/lucene/util/automaton/FiniteStringsIteratorTest.java
@@ -17,6 +17,7 @@
 package org.apache.lucene.util.automaton;
 
 
+import org.apache.lucene.store.AlreadyClosedException;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.IntsRef;
 import org.apache.lucene.util.IntsRefBuilder;
@@ -133,14 +134,11 @@ public class FiniteStringsIteratorTest extends LuceneTestCase {
 
 
   public void testWithCycle() throws Exception {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       Automaton a = new RegExp("abc.*", RegExp.NONE).toAutomaton();
       FiniteStringsIterator iterator = new FiniteStringsIterator(a);
       getFiniteStrings(iterator);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
   }
 
   public void testSingletonNoLimit() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/automaton/LimitedFiniteStringsIteratorTest.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/LimitedFiniteStringsIteratorTest.java b/lucene/core/src/test/org/apache/lucene/util/automaton/LimitedFiniteStringsIteratorTest.java
index ddaa65a..5303417 100644
--- a/lucene/core/src/test/org/apache/lucene/util/automaton/LimitedFiniteStringsIteratorTest.java
+++ b/lucene/core/src/test/org/apache/lucene/util/automaton/LimitedFiniteStringsIteratorTest.java
@@ -19,6 +19,7 @@ package org.apache.lucene.util.automaton;
 
 import java.util.List;
 
+import org.apache.lucene.store.AlreadyClosedException;
 import org.apache.lucene.util.IntsRef;
 import org.apache.lucene.util.IntsRefBuilder;
 import org.apache.lucene.util.LuceneTestCase;
@@ -52,22 +53,17 @@ public class LimitedFiniteStringsIteratorTest extends LuceneTestCase {
 
   public void testInvalidLimitNegative() {
     Automaton a = AutomatonTestUtil.randomAutomaton(random());
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new LimitedFiniteStringsIterator(a, -7);
       fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
   }
 
   public void testInvalidLimitNull() {
     Automaton a = AutomatonTestUtil.randomAutomaton(random());
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new LimitedFiniteStringsIterator(a, 0);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
   }
 
   public void testSingleton() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java
index 83c5738..e4a09dc 100644
--- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java
+++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java
@@ -325,12 +325,9 @@ public class TestAutomaton extends LuceneTestCase {
     int s2 = a.createState();
     a.addTransition(s1, s2, 'a');
     a.addTransition(s2, s2, 'a');
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       a.addTransition(s1, s2, 'b');
-      fail("didn't hit expected exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
   }
 
   public void testBuilderRandom() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java
index afb8e36..b9ac619 100644
--- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java
+++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java
@@ -48,34 +48,30 @@ public class TestRegExp extends LuceneTestCase {
   public void testDeterminizeTooManyStates() {
     // LUCENE-6046
     String source = "[ac]*a[ac]{50,200}";
-    try {
+    TooComplexToDeterminizeException expected = expectThrows(TooComplexToDeterminizeException.class, () -> {
       new RegExp(source).toAutomaton();
-      fail();
-    } catch (TooComplexToDeterminizeException e) {
-      assert(e.getMessage().contains(source));
-    }
+    });
+    assertTrue(expected.getMessage().contains(source));
   }
 
   // LUCENE-6713
   public void testSerializeTooManyStatesToDeterminizeExc() throws Exception {
     // LUCENE-6046
     String source = "[ac]*a[ac]{50,200}";
-    try {
+    TooComplexToDeterminizeException expected = expectThrows(TooComplexToDeterminizeException.class, () -> {
       new RegExp(source).toAutomaton();
-      fail();
-    } catch (TooComplexToDeterminizeException e) {
-      assert(e.getMessage().contains(source));
+    });
+    assertTrue(expected.getMessage().contains(source));
 
-      ByteArrayOutputStream bos = new ByteArrayOutputStream();
-      ObjectOutput out = new ObjectOutputStream(bos);   
-      out.writeObject(e);
-      byte[] bytes = bos.toByteArray();
+    ByteArrayOutputStream bos = new ByteArrayOutputStream();
+    ObjectOutput out = new ObjectOutputStream(bos);   
+    out.writeObject(expected);
+    byte[] bytes = bos.toByteArray();
 
-      ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
-      ObjectInput in = new ObjectInputStream(bis);
-      TooComplexToDeterminizeException e2 = (TooComplexToDeterminizeException) in.readObject();
-      assertNotNull(e2.getMessage());
-    }
+    ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
+    ObjectInput in = new ObjectInputStream(bis);
+    TooComplexToDeterminizeException e2 = (TooComplexToDeterminizeException) in.readObject();
+    assertNotNull(e2.getMessage());
   }
 
   // LUCENE-6046

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
index 67819bd..8cee5c6 100644
--- a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
+++ b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
@@ -429,11 +429,10 @@ public class TestBKD extends LuceneTestCase {
 
   public void testTooLittleHeap() throws Exception { 
     try (Directory dir = getDirectory(0)) {
-      new BKDWriter(dir, "bkd", 1, 16, 1000000, 0.001);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertTrue(iae.getMessage().contains("either increase maxMBSortInHeap or decrease maxPointsInLeafNode"));
+      IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+        new BKDWriter(dir, "bkd", 1, 16, 1000000, 0.001);
+      });
+      assertTrue(expected.getMessage().contains("either increase maxMBSortInHeap or decrease maxPointsInLeafNode"));
     }
   }
 
@@ -563,11 +562,10 @@ public class TestBKD extends LuceneTestCase {
     Arrays.fill(bytes, (byte) 0xff);
     byte[] one = new byte[4];
     one[3] = 1;
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       NumericUtils.add(4, 0, bytes, one, new byte[4]);
-    } catch (IllegalArgumentException iae) {
-      assertEquals("a + b overflows bytesPerDim=4", iae.getMessage());
-    }
+    });
+    assertEquals("a + b overflows bytesPerDim=4", expected.getMessage());
   }
   
   public void testNumericUtilsSubtract() throws Exception {
@@ -607,11 +605,10 @@ public class TestBKD extends LuceneTestCase {
     v1[3] = (byte) 0xf0;
     byte[] v2 = new byte[4];
     v2[3] = (byte) 0xf1;
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       NumericUtils.subtract(4, 0, v1, v2, new byte[4]);
-    } catch (IllegalArgumentException iae) {
-      assertEquals("a < b", iae.getMessage());
-    }
+    });
+    assertEquals("a < b", expected.getMessage());
   }
 
   /** docIDs can be null, for the single valued case, else it maps value to docID */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java b/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java
index 4d72a69..774a2ce 100644
--- a/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java
+++ b/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java
@@ -66,12 +66,11 @@ public class TestDirectPacked extends LuceneTestCase {
     writer.add(0);
     writer.add(2);
     writer.add(1);
-    try {
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
       writer.finish();
-      fail("didn't get expected exception");
-    } catch (IllegalStateException expected) {
-      assertTrue(expected.getMessage().startsWith("Wrong number of values added"));
-    }
+    });
+    assertTrue(expected.getMessage().startsWith("Wrong number of values added"));
+
     output.close();
     dir.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
index 4062134..ce3447e 100644
--- a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
+++ b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
@@ -1033,12 +1033,9 @@ public class TestPackedInts extends LuceneTestCase {
         }
         assertEquals(arr.length, buf.size());
         final PackedLongValues values = buf.build();
-        try {
+        expectThrows(IllegalStateException.class, () -> {
           buf.add(random().nextLong());
-          fail("expected an exception");
-        } catch (IllegalStateException e) {
-          // ok
-        }
+        });
         assertEquals(arr.length, values.size());
 
         for (int i = 0; i < arr.length; ++i) {
@@ -1160,12 +1157,9 @@ public class TestPackedInts extends LuceneTestCase {
         assertEquals(i, it.ord());
       }
       assertEquals(fp, in instanceof ByteArrayDataInput ? ((ByteArrayDataInput) in).getPosition() : ((IndexInput) in).getFilePointer());
-      try {
+      expectThrows(IOException.class, () -> {
         it.next();
-        assertTrue(false);
-      } catch (IOException e) {
-        // OK
-      }
+      });
 
       if (in instanceof ByteArrayDataInput) {
         ((ByteArrayDataInput) in).setPosition(0);
@@ -1187,12 +1181,9 @@ public class TestPackedInts extends LuceneTestCase {
         }
       }
       assertEquals(fp, in instanceof ByteArrayDataInput ? ((ByteArrayDataInput) in).getPosition() : ((IndexInput) in).getFilePointer());
-      try {
+      expectThrows(IOException.class, () -> {
         it2.skip(1);
-        assertTrue(false);
-      } catch (IOException e) {
-        // OK
-      }
+      });
 
       in1.seek(0L);
       final BlockPackedReader reader = new BlockPackedReader(in1, PackedInts.VERSION_CURRENT, blockSize, valueCount, random().nextBoolean());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValidation.java
----------------------------------------------------------------------
diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValidation.java b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValidation.java
index 9aa9a39..56086b9 100644
--- a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValidation.java
+++ b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValidation.java
@@ -42,47 +42,39 @@ public class TestExpressionValidation extends LuceneTestCase {
     SimpleBindings bindings = new SimpleBindings();
     bindings.add(new SortField("valid", SortField.Type.INT));
     bindings.add("invalid", JavascriptCompiler.compile("badreference"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       bindings.validate();
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Invalid reference"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Invalid reference"));
   }
   
   public void testInvalidExternal2() throws Exception {
     SimpleBindings bindings = new SimpleBindings();
     bindings.add(new SortField("valid", SortField.Type.INT));
     bindings.add("invalid", JavascriptCompiler.compile("valid + badreference"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       bindings.validate();
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Invalid reference"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Invalid reference"));
   }
   
   public void testSelfRecursion() throws Exception {
     SimpleBindings bindings = new SimpleBindings();
     bindings.add("cycle0", JavascriptCompiler.compile("cycle0"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       bindings.validate();
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Cycle detected"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Cycle detected"));
   }
   
   public void testCoRecursion() throws Exception {
     SimpleBindings bindings = new SimpleBindings();
     bindings.add("cycle0", JavascriptCompiler.compile("cycle1"));
     bindings.add("cycle1", JavascriptCompiler.compile("cycle0"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       bindings.validate();
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Cycle detected"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Cycle detected"));
   }
   
   public void testCoRecursion2() throws Exception {
@@ -90,12 +82,10 @@ public class TestExpressionValidation extends LuceneTestCase {
     bindings.add("cycle0", JavascriptCompiler.compile("cycle1"));
     bindings.add("cycle1", JavascriptCompiler.compile("cycle2"));
     bindings.add("cycle2", JavascriptCompiler.compile("cycle0"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       bindings.validate();
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Cycle detected"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Cycle detected"));
   }
   
   public void testCoRecursion3() throws Exception {
@@ -103,12 +93,10 @@ public class TestExpressionValidation extends LuceneTestCase {
     bindings.add("cycle0", JavascriptCompiler.compile("100"));
     bindings.add("cycle1", JavascriptCompiler.compile("cycle0 + cycle2"));
     bindings.add("cycle2", JavascriptCompiler.compile("cycle0 + cycle1"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       bindings.validate();
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Cycle detected"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Cycle detected"));
   }
   
   public void testCoRecursion4() throws Exception {
@@ -117,11 +105,9 @@ public class TestExpressionValidation extends LuceneTestCase {
     bindings.add("cycle1", JavascriptCompiler.compile("100"));
     bindings.add("cycle2", JavascriptCompiler.compile("cycle1 + cycle0 + cycle3"));
     bindings.add("cycle3", JavascriptCompiler.compile("cycle0 + cycle1 + cycle2"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       bindings.validate();
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Cycle detected"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Cycle detected"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestCustomFunctions.java
----------------------------------------------------------------------
diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestCustomFunctions.java b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestCustomFunctions.java
index ca807e2..7c46b05 100644
--- a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestCustomFunctions.java
+++ b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestCustomFunctions.java
@@ -39,13 +39,11 @@ public class TestCustomFunctions extends LuceneTestCase {
   /** empty list of methods */
   public void testEmpty() throws Exception {
     Map<String,Method> functions = Collections.emptyMap();
-    try {
+    ParseException expected = expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("sqrt(20)", functions, getClass().getClassLoader());
-      fail();
-    } catch (ParseException expected) {
-      assertEquals("Invalid expression 'sqrt(20)': Unrecognized function call (sqrt).", expected.getMessage());
-      assertEquals(expected.getErrorOffset(), 0);
-    }
+    });
+    assertEquals("Invalid expression 'sqrt(20)': Unrecognized function call (sqrt).", expected.getMessage());
+    assertEquals(expected.getErrorOffset(), 0);
   }
   
   /** using the default map explicitly */
@@ -96,38 +94,23 @@ public class TestCustomFunctions extends LuceneTestCase {
 
   /** tests invalid methods that are not allowed to become variables to be mapped */
   public void testInvalidVariableMethods() {
-    try {
+    ParseException expected = expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("method()");
-      fail();
-    } catch (IllegalArgumentException exception) {
-      fail();
-    } catch (ParseException expected) {
-      //expected
-      assertEquals("Invalid expression 'method()': Unrecognized function call (method).", expected.getMessage());
-      assertEquals(0, expected.getErrorOffset());
-    }
+    });
+    assertEquals("Invalid expression 'method()': Unrecognized function call (method).", expected.getMessage());
+    assertEquals(0, expected.getErrorOffset());
 
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("method.method(1)");
-      fail();
-    } catch (IllegalArgumentException exception) {
-      fail();
-    } catch (ParseException expected) {
-      //expected
-      assertEquals("Invalid expression 'method.method(1)': Unrecognized function call (method.method).", expected.getMessage());
-      assertEquals(0, expected.getErrorOffset());
-    }
+    });
+    assertEquals("Invalid expression 'method.method(1)': Unrecognized function call (method.method).", expected.getMessage());
+    assertEquals(0, expected.getErrorOffset());
     
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("1 + method()");
-      fail();
-    } catch (IllegalArgumentException exception) {
-      fail();
-    } catch (ParseException expected) {
-      //expected
-      assertEquals("Invalid expression '1 + method()': Unrecognized function call (method).", expected.getMessage());
-      assertEquals(4, expected.getErrorOffset());
-    }
+    });
+    assertEquals("Invalid expression '1 + method()': Unrecognized function call (method).", expected.getMessage());
+    assertEquals(4, expected.getErrorOffset());
   }
 
   public static String bogusReturnType() { return "bogus!"; }
@@ -136,12 +119,10 @@ public class TestCustomFunctions extends LuceneTestCase {
   public void testWrongReturnType() throws Exception {
     Map<String,Method> functions = new HashMap<>();
     functions.put("foo", getClass().getMethod("bogusReturnType"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       JavascriptCompiler.compile("foo()", functions, getClass().getClassLoader());
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("does not return a double"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("does not return a double"));
   }
   
   public static double bogusParameterType(String s) { return 0; }
@@ -150,12 +131,10 @@ public class TestCustomFunctions extends LuceneTestCase {
   public void testWrongParameterType() throws Exception {
     Map<String,Method> functions = new HashMap<>();
     functions.put("foo", getClass().getMethod("bogusParameterType", String.class));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       JavascriptCompiler.compile("foo(2)", functions, getClass().getClassLoader());
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("must take only double parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("must take only double parameters"));
   }
   
   public double nonStaticMethod() { return 0; }
@@ -164,12 +143,10 @@ public class TestCustomFunctions extends LuceneTestCase {
   public void testWrongNotStatic() throws Exception {
     Map<String,Method> functions = new HashMap<>();
     functions.put("foo", getClass().getMethod("nonStaticMethod"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       JavascriptCompiler.compile("foo()", functions, getClass().getClassLoader());
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("is not static"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("is not static"));
   }
   
   static double nonPublicMethod() { return 0; }
@@ -178,12 +155,10 @@ public class TestCustomFunctions extends LuceneTestCase {
   public void testWrongNotPublic() throws Exception {
     Map<String,Method> functions = new HashMap<>();
     functions.put("foo", getClass().getDeclaredMethod("nonPublicMethod"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       JavascriptCompiler.compile("foo()", functions, getClass().getClassLoader());
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("not public"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("not public"));
   }
 
   static class NestedNotPublic {
@@ -194,12 +169,10 @@ public class TestCustomFunctions extends LuceneTestCase {
   public void testWrongNestedNotPublic() throws Exception {
     Map<String,Method> functions = new HashMap<>();
     functions.put("foo", NestedNotPublic.class.getMethod("method"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       JavascriptCompiler.compile("foo()", functions, getClass().getClassLoader());
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("not public"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("not public"));
   }
   
   /** Classloader that can be used to create a fake static class that has one method returning a static var */
@@ -250,12 +223,10 @@ public class TestCustomFunctions extends LuceneTestCase {
     assertEquals(2.0, expr.evaluate(0, null), DELTA);
     
     // use our classloader, not the foreign one, which should fail!
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       JavascriptCompiler.compile("bar()", functions, thisLoader);
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("is not declared by a class which is accessible by the given parent ClassLoader"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("is not declared by a class which is accessible by the given parent ClassLoader"));
     
     // mix foreign and default functions
     Map<String,Method> mixedFunctions = new HashMap<>(JavascriptCompiler.DEFAULT_FUNCTIONS);
@@ -266,12 +237,10 @@ public class TestCustomFunctions extends LuceneTestCase {
     assertEquals(Math.sqrt(20), expr.evaluate(0, null), DELTA);
     
     // use our classloader, not the foreign one, which should fail!
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       JavascriptCompiler.compile("bar()", mixedFunctions, thisLoader);
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("is not declared by a class which is accessible by the given parent ClassLoader"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("is not declared by a class which is accessible by the given parent ClassLoader"));
   }
   
   static String MESSAGE = "This should not happen but it happens";
@@ -286,17 +255,15 @@ public class TestCustomFunctions extends LuceneTestCase {
     functions.put("foo", StaticThrowingException.class.getMethod("method"));
     String source = "3 * foo() / 5";
     Expression expr = JavascriptCompiler.compile(source, functions, getClass().getClassLoader());
-    try {
+    ArithmeticException expected = expectThrows(ArithmeticException.class, () -> {
       expr.evaluate(0, null);
-      fail();
-    } catch (ArithmeticException e) {
-      assertEquals(MESSAGE, e.getMessage());
-      StringWriter sw = new StringWriter();
-      PrintWriter pw = new PrintWriter(sw);
-      e.printStackTrace(pw);
-      pw.flush();
-      assertTrue(sw.toString().contains("JavascriptCompiler$CompiledExpression.evaluate(" + source + ")"));
-    }
+    });
+    assertEquals(MESSAGE, expected.getMessage());
+    StringWriter sw = new StringWriter();
+    PrintWriter pw = new PrintWriter(sw);
+    expected.printStackTrace(pw);
+    pw.flush();
+    assertTrue(sw.toString().contains("JavascriptCompiler$CompiledExpression.evaluate(" + source + ")"));
   }
 
   /** test that namespaces work with custom expressions. */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java
----------------------------------------------------------------------
diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java
index 8a95321..9941865 100644
--- a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java
+++ b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java
@@ -90,124 +90,84 @@ public class TestJavascriptCompiler extends LuceneTestCase {
   }
 
   void doTestInvalidVariable(String variable) {
-    try {
+    expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile(variable);
-      fail("\"" + variable + " should have failed to compile");
-    }
-    catch (ParseException expected) {
-      //expected
-    }
+    });
   }
 
   public void testInvalidLexer() throws Exception {
-    try {
+    ParseException expected = expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("\n .");
-      fail();
-    } catch (ParseException pe) {
-      assertTrue(pe.getMessage().contains("unexpected character '.' on line (2) position (1)"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("unexpected character '.' on line (2) position (1)"));
   }
 
   public void testInvalidCompiles() throws Exception {
-    try {
+    expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("100 100");
-      fail();
-    } catch (ParseException expected) {
-      // expected exception
-    }
+    });
     
-    try {
+    expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("7*/-8");
-      fail();
-    } catch (ParseException expected) {
-      // expected exception
-    }
+    });
     
-    try {
+    expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("0y1234");
-      fail();
-    } catch (ParseException expected) {
-      // expected exception
-    }
+    });
     
-    try {
+    expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("500EE");
-      fail();
-    } catch (ParseException expected) {
-      // expected exception
-    }
+    });
     
-    try {
+    expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("500.5EE");
-      fail();
-    } catch (ParseException expected) {
-      // expected exception
-    }
+    });
   }
   
   public void testEmpty() {
-    try {
+    expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("");
-      fail();
-    } catch (ParseException expected) {
-      // expected exception
-    }
+    });
     
-    try {
+    expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("()");
-      fail();
-    } catch (ParseException expected) {
-      // expected exception
-    }
+    });
     
-    try {
+    expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("   \r\n   \n \t");
-      fail();
-    } catch (ParseException expected) {
-      // expected exception
-    }
+    });
   }
   
   public void testNull() throws Exception {
-    try {
+    expectThrows(NullPointerException.class, () -> {
       JavascriptCompiler.compile(null);
-      fail();
-    } catch (NullPointerException expected) {
-      // expected exception
-    }
+    });
   }
   
   public void testWrongArity() throws Exception {
-    try {
+    ParseException expected = expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("tan()");
       fail();
-    } catch (ParseException expected) {
-      assertEquals("Invalid expression 'tan()': Expected (1) arguments for function call (tan), but found (0).", expected.getMessage());
-      assertEquals(expected.getErrorOffset(), 0);
-    }
+    });
+    assertEquals("Invalid expression 'tan()': Expected (1) arguments for function call (tan), but found (0).", expected.getMessage());
+    assertEquals(expected.getErrorOffset(), 0);
     
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("tan(1, 1)");
-      fail();
-    } catch (ParseException expected) {
-      assertTrue(expected.getMessage().contains("arguments for function call"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("arguments for function call"));
     
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile(" tan()");
-      fail();
-    } catch (ParseException expected) {
-      assertEquals("Invalid expression ' tan()': Expected (1) arguments for function call (tan), but found (0).", expected.getMessage());
-      assertEquals(expected.getErrorOffset(), 1);
-    }
+    });
+    assertEquals("Invalid expression ' tan()': Expected (1) arguments for function call (tan), but found (0).", expected.getMessage());
+    assertEquals(expected.getErrorOffset(), 1);
     
-    try {
+    expected = expectThrows(ParseException.class, () -> {
       JavascriptCompiler.compile("1 + tan()");
-      fail();
-    } catch (ParseException expected) {
-      assertEquals("Invalid expression '1 + tan()': Expected (1) arguments for function call (tan), but found (0).", expected.getMessage());
-      assertEquals(expected.getErrorOffset(), 4);
-    }
+    });
+    assertEquals("Invalid expression '1 + tan()': Expected (1) arguments for function call (tan), but found (0).", expected.getMessage());
+    assertEquals(expected.getErrorOffset(), 4);
   }
 
   public void testVariableNormalization() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java b/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
index 27e1bd6..7d154b3 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
@@ -104,32 +104,19 @@ public class TestRangeFacetCounts extends FacetTestCase {
     d.close();
   }
 
-  @SuppressWarnings("unused")
   public void testUselessRange() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new LongRange("useless", 7, true, 6, true);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new LongRange("useless", 7, true, 7, false);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new DoubleRange("useless", 7.0, true, 6.0, true);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new DoubleRange("useless", 7.0, true, 7.0, false);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
   }
 
   public void testLongMinMax() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java b/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java
index 736a8a7..7659be8 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java
@@ -124,12 +124,9 @@ public class TestSortedSetDocValuesFacets extends FacetTestCase {
 
     searcher.search(new MatchAllDocsQuery(), c);
 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       new SortedSetDocValuesFacetCounts(state, c);
-      fail("did not hit expected exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
 
     r.close();
     writer.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestFacetLabel.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestFacetLabel.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestFacetLabel.java
index 41171b3..436c78b 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestFacetLabel.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestFacetLabel.java
@@ -155,110 +155,61 @@ public class TestFacetLabel extends FacetTestCase {
       new String[] { "test", null, "foo" }, // null in the middle
     };
 
+    // empty or null components should not be allowed.
     for (String[] components : components_tests) {
-      try {
-        assertNotNull(new FacetLabel(components));
-        fail("empty or null components should not be allowed: " + Arrays.toString(components));
-      } catch (IllegalArgumentException e) {
-        // expected
-      }
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
+        new FacetLabel(components);
+      });
+      expectThrows(IllegalArgumentException.class, () -> {
         new FacetField("dim", components);
-        fail("empty or null components should not be allowed: " + Arrays.toString(components));
-      } catch (IllegalArgumentException e) {
-        // expected
-      }
-      try {
+      });
+      expectThrows(IllegalArgumentException.class, () -> {
         new AssociationFacetField(new BytesRef(), "dim", components);
-        fail("empty or null components should not be allowed: " + Arrays.toString(components));
-      } catch (IllegalArgumentException e) {
-        // expected
-      }
-      try {
+      });
+      expectThrows(IllegalArgumentException.class, () -> {
         new IntAssociationFacetField(17, "dim", components);
-        fail("empty or null components should not be allowed: " + Arrays.toString(components));
-      } catch (IllegalArgumentException e) {
-        // expected
-      }
-      try {
+      });
+      expectThrows(IllegalArgumentException.class, () -> {
         new FloatAssociationFacetField(17.0f, "dim", components);
-        fail("empty or null components should not be allowed: " + Arrays.toString(components));
-      } catch (IllegalArgumentException e) {
-        // expected
-      }
+      });
     }
-    try {
+
+    expectThrows(IllegalArgumentException.class, () -> {
       new FacetField(null, new String[] {"abc"});
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new FacetField("", new String[] {"abc"});
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new IntAssociationFacetField(17, null, new String[] {"abc"});
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new IntAssociationFacetField(17, "", new String[] {"abc"});
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new FloatAssociationFacetField(17.0f, null, new String[] {"abc"});
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new FloatAssociationFacetField(17.0f, "", new String[] {"abc"});
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new AssociationFacetField(new BytesRef(), null, new String[] {"abc"});
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new AssociationFacetField(new BytesRef(), "", new String[] {"abc"});
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new SortedSetDocValuesFacetField(null, "abc");
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new SortedSetDocValuesFacetField("", "abc");
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new SortedSetDocValuesFacetField("dim", null);
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       new SortedSetDocValuesFacetField("dim", "");
-      fail("empty or null components should not be allowed");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
+    });
   }
 
   @Test
@@ -273,11 +224,10 @@ public class TestFacetLabel extends FacetTestCase {
       break;
     }
 
-    try {
-      assertNotNull(new FacetLabel("dim", bigComp));
-      fail("long paths should not be allowed; len=" + bigComp.length());
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
+    // long paths should not be allowed
+    final String longPath = bigComp;
+    expectThrows(IllegalArgumentException.class, () -> {
+      new FacetLabel("dim", longPath);
+    });
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java
index c6a8b5f..a1e0344 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java
@@ -274,12 +274,9 @@ public class TestSearcherTaxonomyManager extends FacetTestCase {
     tw.replaceTaxonomy(taxoDir2);
     taxoDir2.close();
 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       mgr.maybeRefresh();
-      fail("should have hit exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
 
     w.close();
     IOUtils.close(mgr, tw, taxoDir, dir);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java
index 559683f..ecf1401 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java
@@ -490,25 +490,15 @@ public class TestTaxonomyCombined extends FacetTestCase {
     }
 
     // check parent of of invalid ordinals:
-    try {
+    expectThrows(ArrayIndexOutOfBoundsException.class, () -> {
       tw.getParent(-1);
-      fail("getParent for -1 should throw exception");
-    } catch (ArrayIndexOutOfBoundsException e) {
-      // ok
-    }
-    try {
+    });
+    expectThrows(ArrayIndexOutOfBoundsException.class, () -> {
       tw.getParent(TaxonomyReader.INVALID_ORDINAL);
-      fail("getParent for INVALID_ORDINAL should throw exception");
-    } catch (ArrayIndexOutOfBoundsException e) {
-      // ok
-    }
-    try {
-      int parent = tw.getParent(tr.getSize());
-      fail("getParent for getSize() should throw exception, but returned "
-          + parent);
-    } catch (ArrayIndexOutOfBoundsException e) {
-      // ok
-    }
+    });
+    expectThrows(ArrayIndexOutOfBoundsException.class, () -> {
+      tw.getParent(tr.getSize());
+    });
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetAssociations.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetAssociations.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetAssociations.java
index a300e47..b065a8d 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetAssociations.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetAssociations.java
@@ -142,19 +142,13 @@ public class TestTaxonomyFacetAssociations extends FacetTestCase {
     IndexSearcher searcher = newSearcher(reader);
     searcher.search(new MatchAllDocsQuery(), fc);
     Facets facets = new TaxonomyFacetSumFloatAssociations(taxoReader, config, fc);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       facets.getSpecificValue("float");
-      fail("should have hit exc");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       facets.getTopChildren(10, "float");
-      fail("should have hit exc");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
   }
 
   public void testMixedTypesInSameIndexField() throws Exception {
@@ -168,12 +162,9 @@ public class TestTaxonomyFacetAssociations extends FacetTestCase {
     Document doc = new Document();
     doc.add(new IntAssociationFacetField(14, "a", "x"));
     doc.add(new FloatAssociationFacetField(55.0f, "b", "y"));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       writer.addDocument(config.build(taxoWriter, doc));
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException exc) {
-      // expected
-    }
+    });
     writer.close();
     IOUtils.close(taxoWriter, dir, taxoDir);
   }
@@ -189,12 +180,10 @@ public class TestTaxonomyFacetAssociations extends FacetTestCase {
 
     Document doc = new Document();
     doc.add(new IntAssociationFacetField(14, "a", "x"));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       writer.addDocument(config.build(taxoWriter, doc));
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException exc) {
-      // expected
-    }
+    });
+
     writer.close();
     IOUtils.close(taxoWriter, dir, taxoDir);
   }
@@ -210,12 +199,10 @@ public class TestTaxonomyFacetAssociations extends FacetTestCase {
 
     Document doc = new Document();
     doc.add(new IntAssociationFacetField(14, "a", "x"));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       writer.addDocument(config.build(taxoWriter, doc));
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException exc) {
-      // expected
-    }
+    });
+
     writer.close();
     IOUtils.close(taxoWriter, dir, taxoDir);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts.java
index 78787e4..20bfdb5 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts.java
@@ -243,19 +243,13 @@ public class TestTaxonomyFacetCounts extends FacetTestCase {
     List<FacetResult> results = facets.getAllDims(10);
     assertTrue(results.isEmpty());
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       facets.getSpecificValue("a");
-      fail("should have hit exc");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       facets.getTopChildren(10, "a");
-      fail("should have hit exc");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
     writer.close();
     IOUtils.close(taxoWriter, searcher.getIndexReader(), taxoReader, taxoDir, dir);
@@ -317,12 +311,9 @@ public class TestTaxonomyFacetCounts extends FacetTestCase {
     searcher.search(new MatchAllDocsQuery(), c);
     Facets facets = getTaxonomyFacetCounts(taxoReader, config, c);
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       facets.getSpecificValue("a");
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
     FacetResult result = facets.getTopChildren(10, "a");
     assertEquals(1, result.labelValues.length);
@@ -404,12 +395,9 @@ public class TestTaxonomyFacetCounts extends FacetTestCase {
     assertEquals(1, facets.getTopChildren(10, "dim").value);
     assertEquals(1, facets.getTopChildren(10, "dim2").value);
     assertEquals(1, facets.getTopChildren(10, "dim3").value);
-    try {
-      assertEquals(1, facets.getSpecificValue("dim"));
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    expectThrows(IllegalArgumentException.class, () -> {
+      facets.getSpecificValue("dim");
+    });
     assertEquals(1, facets.getSpecificValue("dim2"));
     assertEquals(1, facets.getSpecificValue("dim3"));
     writer.close();
@@ -479,12 +467,10 @@ public class TestTaxonomyFacetCounts extends FacetTestCase {
     Document doc = new Document();
     doc.add(newTextField("field", "text", Field.Store.NO));
     doc.add(new FacetField("a", "path", "other"));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       config.build(taxoWriter, doc);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     writer.close();
     IOUtils.close(taxoWriter, dir, taxoDir);
   }
@@ -502,12 +488,10 @@ public class TestTaxonomyFacetCounts extends FacetTestCase {
     doc.add(newTextField("field", "text", Field.Store.NO));
     doc.add(new FacetField("a", "path"));
     doc.add(new FacetField("a", "path2"));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       config.build(taxoWriter, doc);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     writer.close();
     IOUtils.close(taxoWriter, dir, taxoDir);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java
index 09aa5df..0ad90ba 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java
@@ -229,19 +229,13 @@ public class TestTaxonomyFacetSumValueSource extends FacetTestCase {
     List<FacetResult> results = facets.getAllDims(10);
     assertTrue(results.isEmpty());
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       facets.getSpecificValue("a");
-      fail("should have hit exc");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       facets.getTopChildren(10, "a");
-      fail("should have hit exc");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
     IOUtils.close(searcher.getIndexReader(), taxoReader, dir, taxoDir);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java
index 9b117c0..1982048 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java
@@ -110,12 +110,10 @@ public class TestDirectoryTaxonomyReader extends FacetTestCase {
     
     DirectoryTaxonomyReader ltr = new DirectoryTaxonomyReader(dir);
     ltr.close();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       ltr.getSize();
-      fail("An AlreadyClosedException should have been thrown here");
-    } catch (AlreadyClosedException ace) {
-      // good!
-    }
+    });
+
     dir.close();
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java
index 2e98598..2edee33 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java
@@ -134,13 +134,11 @@ public class TestDirectoryTaxonomyWriter extends FacetTestCase {
     DirectoryTaxonomyWriter dtw = new DirectoryTaxonomyWriter(dir);
     dtw.addCategory(new FacetLabel("a"));
     dtw.rollback();
-    try {
+    // should not have succeeded to add a category following rollback.
+    expectThrows(AlreadyClosedException.class, () -> {
       dtw.addCategory(new FacetLabel("a"));
-      fail("should not have succeeded to add a category following rollback.");
-    } catch (AlreadyClosedException e) {
-      // expected
-    }
-    
+    });
+
     dir.close();
   }
   
@@ -162,12 +160,11 @@ public class TestDirectoryTaxonomyWriter extends FacetTestCase {
     Directory dir = newDirectory();
     DirectoryTaxonomyWriter dtw = new DirectoryTaxonomyWriter(dir);
     dtw.close();
-    try {
+    // should not succeed to add a category following close.
+    expectThrows(AlreadyClosedException.class, () -> {
       dtw.addCategory(new FacetLabel("a"));
-      fail("should not have succeeded to add a category following close.");
-    } catch (AlreadyClosedException e) {
-      // expected
-    }
+    });
+
     dir.close();
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestPostingsHighlighter.java
----------------------------------------------------------------------
diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestPostingsHighlighter.java b/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestPostingsHighlighter.java
index 6574b62..4b7e66b 100644
--- a/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestPostingsHighlighter.java
+++ b/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestPostingsHighlighter.java
@@ -405,19 +405,15 @@ public class TestPostingsHighlighter extends LuceneTestCase {
     Query query = new TermQuery(new Term("body", "test"));
     TopDocs topDocs = searcher.search(query, 10, Sort.INDEXORDER);
     assertEquals(2, topDocs.totalHits);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       highlighter.highlight("body", query, searcher, topDocs, 2);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       highlighter.highlight("title", new TermQuery(new Term("title", "test")), searcher, topDocs, 2);
       fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     ir.close();
     dir.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java
----------------------------------------------------------------------
diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java
index f21e0dd..98ec2d6 100644
--- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java
+++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java
@@ -28,13 +28,10 @@ public class SimpleFragListBuilderTest extends AbstractTestCase {
   }
   
   public void testTooSmallFragSize() throws Exception {
-    try{
+    expectThrows(IllegalArgumentException.class, () -> {
       SimpleFragListBuilder sflb = new SimpleFragListBuilder();
-      sflb.createFieldFragList( fpl(new TermQuery(new Term(F, "a")), "b c d" ), sflb.minFragCharSize - 1 );
-      fail( "IllegalArgumentException must be thrown" );
-    }
-    catch ( IllegalArgumentException expected ) {
-    }
+      sflb.createFieldFragList(fpl(new TermQuery(new Term(F, "a")), "b c d"), sflb.minFragCharSize - 1);
+    });
   }
   
   public void testSmallerFragSizeThanTermQuery() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java
----------------------------------------------------------------------
diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java
index e331c8a..a198774 100644
--- a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java
+++ b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java
@@ -1458,12 +1458,10 @@ public class TestBlockJoin extends LuceneTestCase {
     ToParentBlockJoinCollector c = new ToParentBlockJoinCollector(new Sort(new SortField("parentID", SortField.Type.STRING)),
                                                                   10, true, true);
 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       newSearcher(r).search(parentQuery.build(), c);
-      fail("should have hit exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
+
 
     r.close();
     d.close();


[41/53] [abbrv] lucene-solr git commit: LUCENE-7042: more cleanup for Point encodings

Posted by no...@apache.org.
LUCENE-7042: more cleanup for Point encodings


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9ca1a19b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9ca1a19b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9ca1a19b

Branch: refs/heads/apiv2
Commit: 9ca1a19b81448594bbaf046da5d5e33228e6974f
Parents: d610533
Author: Robert Muir <rm...@apache.org>
Authored: Mon Feb 22 19:32:28 2016 -0500
Committer: Robert Muir <rm...@apache.org>
Committed: Mon Feb 22 19:32:52 2016 -0500

----------------------------------------------------------------------
 .../lucene/analysis/en/PorterStemmer.java       |  3 +-
 .../miscellaneous/ASCIIFoldingFilter.java       |  4 +-
 .../miscellaneous/WordDelimiterFilter.java      |  3 +-
 .../lucene/analysis/synonym/SynonymFilter.java  |  7 +---
 .../lucene/analysis/util/RollingCharBuffer.java |  4 +-
 .../org/tartarus/snowball/SnowballProgram.java  |  4 +-
 .../lucene/analysis/ja/JapaneseTokenizer.java   |  5 +--
 .../lucene50/Lucene50DocValuesProducer.java     |  6 +--
 .../codecs/blocktreeords/FSTOrdsOutputs.java    |  2 +-
 .../bloom/BloomFilteringPostingsFormat.java     |  5 +--
 .../codecs/memory/DirectPostingsFormat.java     |  3 +-
 .../codecs/memory/MemoryPostingsFormat.java     |  5 +--
 .../tokenattributes/CharTermAttributeImpl.java  |  8 ++--
 .../lucene54/Lucene54DocValuesProducer.java     |  3 +-
 .../perfield/PerFieldDocValuesFormat.java       |  5 +--
 .../org/apache/lucene/document/DoublePoint.java | 30 +++++++-------
 .../org/apache/lucene/document/FloatPoint.java  | 28 ++++++-------
 .../org/apache/lucene/document/IntPoint.java    | 28 ++++++-------
 .../org/apache/lucene/document/LongPoint.java   | 28 ++++++-------
 .../apache/lucene/index/BufferedUpdates.java    | 16 ++++----
 .../apache/lucene/index/DocValuesUpdate.java    | 14 +++----
 .../lucene/index/DocumentsWriterPerThread.java  |  7 +---
 .../index/FreqProxTermsWriterPerField.java      | 10 ++---
 .../lucene/index/FrozenBufferedUpdates.java     |  3 +-
 .../lucene/index/ParallelPostingsArray.java     |  4 +-
 .../apache/lucene/index/PointValuesWriter.java  |  6 +--
 .../apache/lucene/index/PrefixCodedTerms.java   |  4 +-
 .../lucene/index/SortedDocValuesWriter.java     |  4 +-
 .../lucene/index/SortedSetDocValuesWriter.java  |  6 +--
 .../index/TermVectorsConsumerPerField.java      |  3 +-
 .../apache/lucene/search/CachingCollector.java  |  8 ++--
 .../apache/lucene/search/PointRangeQuery.java   |  8 ++--
 .../apache/lucene/search/ScoringRewrite.java    |  3 +-
 .../java/org/apache/lucene/util/ArrayUtil.java  | 21 +++++-----
 .../org/apache/lucene/util/BytesRefArray.java   |  6 +--
 .../org/apache/lucene/util/BytesRefHash.java    | 15 ++++---
 .../org/apache/lucene/util/DocIdSetBuilder.java |  3 +-
 .../org/apache/lucene/util/NumericUtils.java    | 31 +++++++--------
 .../apache/lucene/util/RamUsageEstimator.java   | 41 ++++++++------------
 .../lucene/util/RecyclingIntBlockAllocator.java |  6 +--
 .../org/apache/lucene/util/SentinelIntSet.java  |  2 +-
 .../apache/lucene/util/automaton/Automaton.java |  4 +-
 .../lucene/util/automaton/SortedIntSet.java     |  4 +-
 .../org/apache/lucene/util/bkd/BKDReader.java   |  4 +-
 .../org/apache/lucene/util/bkd/BKDWriter.java   |  5 +--
 .../apache/lucene/util/bkd/HeapPointWriter.java |  4 +-
 .../lucene/util/bkd/OfflinePointReader.java     |  5 +--
 .../lucene/util/bkd/OfflinePointWriter.java     |  6 +--
 .../util/packed/AbstractPagedMutable.java       |  4 +-
 .../org/apache/lucene/util/packed/Direct16.java |  2 +-
 .../org/apache/lucene/util/packed/Direct32.java |  2 +-
 .../org/apache/lucene/util/packed/Direct64.java |  2 +-
 .../org/apache/lucene/util/packed/Direct8.java  |  2 +-
 .../lucene/util/packed/GrowableWriter.java      |  4 +-
 .../lucene/util/packed/Packed16ThreeBlocks.java |  2 +-
 .../org/apache/lucene/util/packed/Packed64.java |  4 +-
 .../lucene/util/packed/Packed64SingleBlock.java |  2 +-
 .../lucene/util/packed/Packed8ThreeBlocks.java  |  2 +-
 .../apache/lucene/util/packed/PackedInts.java   |  2 +-
 .../lucene/util/packed/PagedGrowableWriter.java |  4 +-
 .../apache/lucene/index/TestIntBlockPool.java   | 11 ++----
 .../org/apache/lucene/util/bkd/TestBKD.java     | 12 +++---
 .../apache/lucene/index/memory/MemoryIndex.java | 10 ++---
 .../lucene/uninverting/FieldCacheImpl.java      |  4 +-
 .../org/apache/lucene/document/LatLonPoint.java |  4 +-
 .../lucene/search/PointInPolygonQuery.java      |  6 +--
 .../apache/lucene/search/PointInRectQuery.java  |  6 +--
 .../lucene/search/TestDocValuesRangeQuery.java  |  2 +-
 .../spatial/prefix/ContainsPrefixTreeQuery.java |  2 +-
 .../org/apache/lucene/geo3d/Geo3DPoint.java     |  6 +--
 .../lucene/geo3d/PointInGeo3DShapeQuery.java    | 12 +++---
 .../search/suggest/tst/TernaryTreeNode.java     |  2 +-
 72 files changed, 221 insertions(+), 322 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/PorterStemmer.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/PorterStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/PorterStemmer.java
index 041d7b8..ef239b1 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/PorterStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/en/PorterStemmer.java
@@ -48,7 +48,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.FileInputStream;
 
-import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_CHAR;
 import org.apache.lucene.util.ArrayUtil;
 
 /**
@@ -453,7 +452,7 @@ class PorterStemmer
   public boolean stem(char[] wordBuffer, int offset, int wordLen) {
     reset();
     if (b.length < wordLen) {
-      b = new char[ArrayUtil.oversize(wordLen, NUM_BYTES_CHAR)];
+      b = new char[ArrayUtil.oversize(wordLen, Character.BYTES)];
     }
     System.arraycopy(wordBuffer, offset, b, 0, wordLen);
     i = wordLen;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.java
index bd8d571..a327d17 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.analysis.miscellaneous;
 
-
 import java.io.IOException;
 
 import org.apache.lucene.analysis.TokenFilter;
@@ -24,7 +23,6 @@ import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
 import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /**
  * This class converts alphabetic, numeric, and symbolic Unicode characters
@@ -142,7 +140,7 @@ public final class ASCIIFoldingFilter extends TokenFilter {
     // Worst-case length required:
     final int maxSizeNeeded = 4 * length;
     if (output.length < maxSizeNeeded) {
-      output = new char[ArrayUtil.oversize(maxSizeNeeded, RamUsageEstimator.NUM_BYTES_CHAR)];
+      output = new char[ArrayUtil.oversize(maxSizeNeeded, Character.BYTES)];
     }
 
     outputPos = foldToASCII(input, 0, output, 0, length);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterFilter.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterFilter.java
index e2e7074..20e013d 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterFilter.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterFilter.java
@@ -28,7 +28,6 @@ import org.apache.lucene.analysis.util.CharArraySet;
 import org.apache.lucene.util.ArrayUtil;
 import org.apache.lucene.util.AttributeSource;
 import org.apache.lucene.util.InPlaceMergeSorter;
-import org.apache.lucene.util.RamUsageEstimator;
 
 import java.io.IOException;
 import java.util.Arrays;
@@ -429,7 +428,7 @@ public final class WordDelimiterFilter extends TokenFilter {
     savedType = typeAttribute.type();
 
     if (savedBuffer.length < termAttribute.length()) {
-      savedBuffer = new char[ArrayUtil.oversize(termAttribute.length(), RamUsageEstimator.NUM_BYTES_CHAR)];
+      savedBuffer = new char[ArrayUtil.oversize(termAttribute.length(), Character.BYTES)];
     }
 
     System.arraycopy(termAttribute.buffer(), 0, savedBuffer, 0, termAttribute.length());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilter.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilter.java
index 8b298f7..6a72920 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilter.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilter.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.analysis.synonym;
 
-
 import java.io.IOException;
 import java.util.Arrays;
 
@@ -31,11 +30,9 @@ import org.apache.lucene.store.ByteArrayDataInput;
 import org.apache.lucene.util.ArrayUtil;
 import org.apache.lucene.util.AttributeSource;
 import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.BytesRefBuilder;
 import org.apache.lucene.util.CharsRef;
 import org.apache.lucene.util.CharsRefBuilder;
 import org.apache.lucene.util.RamUsageEstimator;
-import org.apache.lucene.util.UnicodeUtil;
 import org.apache.lucene.util.fst.FST;
 
 /**
@@ -207,12 +204,12 @@ public final class SynonymFilter extends TokenFilter {
         outputs = Arrays.copyOf(outputs, ArrayUtil.oversize(1+count, RamUsageEstimator.NUM_BYTES_OBJECT_REF));
       }
       if (count == endOffsets.length) {
-        final int[] next = new int[ArrayUtil.oversize(1+count, RamUsageEstimator.NUM_BYTES_INT)];
+        final int[] next = new int[ArrayUtil.oversize(1+count, Integer.BYTES)];
         System.arraycopy(endOffsets, 0, next, 0, count);
         endOffsets = next;
       }
       if (count == posLengths.length) {
-        final int[] next = new int[ArrayUtil.oversize(1+count, RamUsageEstimator.NUM_BYTES_INT)];
+        final int[] next = new int[ArrayUtil.oversize(1+count, Integer.BYTES)];
         System.arraycopy(posLengths, 0, next, 0, count);
         posLengths = next;
       }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/RollingCharBuffer.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/RollingCharBuffer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/RollingCharBuffer.java
index 1ced960..2464ebd 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/RollingCharBuffer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/RollingCharBuffer.java
@@ -16,12 +16,10 @@
  */
 package org.apache.lucene.analysis.util;
 
-
 import java.io.IOException;
 import java.io.Reader;
 
 import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /** Acts like a forever growing char[] as you read
  *  characters into it from the provided reader, but
@@ -71,7 +69,7 @@ public final class RollingCharBuffer {
       }
       if (count == buffer.length) {
         // Grow
-        final char[] newBuffer = new char[ArrayUtil.oversize(1+count, RamUsageEstimator.NUM_BYTES_CHAR)];
+        final char[] newBuffer = new char[ArrayUtil.oversize(1+count, Character.BYTES)];
         //System.out.println(Thread.currentThread().getName() + ": cb grow " + newBuffer.length);
         System.arraycopy(buffer, nextWrite, newBuffer, 0, buffer.length - nextWrite);
         System.arraycopy(buffer, 0, newBuffer, buffer.length - nextWrite, nextWrite);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/analysis/common/src/java/org/tartarus/snowball/SnowballProgram.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/java/org/tartarus/snowball/SnowballProgram.java b/lucene/analysis/common/src/java/org/tartarus/snowball/SnowballProgram.java
index 7032749..bfc8ec0 100644
--- a/lucene/analysis/common/src/java/org/tartarus/snowball/SnowballProgram.java
+++ b/lucene/analysis/common/src/java/org/tartarus/snowball/SnowballProgram.java
@@ -29,11 +29,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
  */
 
-
 package org.tartarus.snowball;
 
 import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /**
  * This is the rev 502 of the Snowball SVN trunk,
@@ -397,7 +395,7 @@ public abstract class SnowballProgram {
     final int newLength = limit + adjustment;
     //resize if necessary
     if (newLength > current.length) {
-      char newBuffer[] = new char[ArrayUtil.oversize(newLength, RamUsageEstimator.NUM_BYTES_CHAR)];
+      char newBuffer[] = new char[ArrayUtil.oversize(newLength, Character.BYTES)];
       System.arraycopy(current, 0, newBuffer, 0, limit);
       current = newBuffer;
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java
index 5641e6c..dfab482 100644
--- a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java
+++ b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.analysis.ja;
 
-
 import java.io.IOException;
 import java.io.StringReader;
 import java.util.ArrayList;
@@ -1053,7 +1052,7 @@ public final class JapaneseTokenizer extends Tokenizer {
       assert baseOffset <= lastOffset;
       int size = lastOffset - baseOffset + 1;
       if (rootCapacity < size) {
-        int oversize = ArrayUtil.oversize(size, RamUsageEstimator.NUM_BYTES_INT);
+        int oversize = ArrayUtil.oversize(size, Integer.BYTES);
         lRoot = new int[oversize];
         rRoot = new int[oversize];
         rootCapacity = oversize;
@@ -1067,7 +1066,7 @@ public final class JapaneseTokenizer extends Tokenizer {
     // Reserve at least N nodes.
     private void reserve(int n) {
       if (capacity < n) {
-        int oversize = ArrayUtil.oversize(n, RamUsageEstimator.NUM_BYTES_INT);
+        int oversize = ArrayUtil.oversize(n, Integer.BYTES);
         nodeDicType = new Type[oversize];
         nodeWordID = new int[oversize];
         nodeMark = new int[oversize];

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene50/Lucene50DocValuesProducer.java
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene50/Lucene50DocValuesProducer.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene50/Lucene50DocValuesProducer.java
index c323d6e..62c9477 100644
--- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene50/Lucene50DocValuesProducer.java
+++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene50/Lucene50DocValuesProducer.java
@@ -537,7 +537,7 @@ class Lucene50DocValuesProducer extends DocValuesProducer implements Closeable {
       addresses = MonotonicBlockPackedReader.of(data, bytes.packedIntsVersion, bytes.blockSize, bytes.count+1, false);
       if (!merging) {
         addressInstances.put(field.name, addresses);
-        ramBytesUsed.addAndGet(addresses.ramBytesUsed() + RamUsageEstimator.NUM_BYTES_INT);
+        ramBytesUsed.addAndGet(addresses.ramBytesUsed() + Integer.BYTES);
       }
     }
     return addresses;
@@ -577,7 +577,7 @@ class Lucene50DocValuesProducer extends DocValuesProducer implements Closeable {
       addresses = MonotonicBlockPackedReader.of(data, bytes.packedIntsVersion, bytes.blockSize, size, false);
       if (!merging) {
         addressInstances.put(field.name, addresses);
-        ramBytesUsed.addAndGet(addresses.ramBytesUsed() + RamUsageEstimator.NUM_BYTES_INT);
+        ramBytesUsed.addAndGet(addresses.ramBytesUsed() + Integer.BYTES);
       }
     }
     return addresses;
@@ -662,7 +662,7 @@ class Lucene50DocValuesProducer extends DocValuesProducer implements Closeable {
       instance = MonotonicBlockPackedReader.of(data, entry.packedIntsVersion, entry.blockSize, entry.count+1, false);
       if (!merging) {
         ordIndexInstances.put(field.name, instance);
-        ramBytesUsed.addAndGet(instance.ramBytesUsed() + RamUsageEstimator.NUM_BYTES_INT);
+        ramBytesUsed.addAndGet(instance.ramBytesUsed() + Integer.BYTES);
       }
     }
     return instance;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/codecs/src/java/org/apache/lucene/codecs/blocktreeords/FSTOrdsOutputs.java
----------------------------------------------------------------------
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/blocktreeords/FSTOrdsOutputs.java b/lucene/codecs/src/java/org/apache/lucene/codecs/blocktreeords/FSTOrdsOutputs.java
index 050ad2f..8d61e2d 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/blocktreeords/FSTOrdsOutputs.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/blocktreeords/FSTOrdsOutputs.java
@@ -228,6 +228,6 @@ final class FSTOrdsOutputs extends Outputs<FSTOrdsOutputs.Output> {
 
   @Override
   public long ramBytesUsed(Output output) {
-    return 2 * RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + 2 * RamUsageEstimator.NUM_BYTES_LONG + 2 * RamUsageEstimator.NUM_BYTES_OBJECT_REF + RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + 2 * RamUsageEstimator.NUM_BYTES_INT + output.bytes.length;
+    return 2 * RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + 2 * Long.BYTES + 2 * RamUsageEstimator.NUM_BYTES_OBJECT_REF + RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + 2 * Integer.BYTES + output.bytes.length;
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/codecs/src/java/org/apache/lucene/codecs/bloom/BloomFilteringPostingsFormat.java
----------------------------------------------------------------------
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/bloom/BloomFilteringPostingsFormat.java b/lucene/codecs/src/java/org/apache/lucene/codecs/bloom/BloomFilteringPostingsFormat.java
index 6b838bb..ffe9fa1 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/bloom/BloomFilteringPostingsFormat.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/bloom/BloomFilteringPostingsFormat.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.codecs.bloom;
 
-
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -45,10 +44,8 @@ import org.apache.lucene.store.DataOutput;
 import org.apache.lucene.store.IndexOutput;
 import org.apache.lucene.util.Accountable;
 import org.apache.lucene.util.Accountables;
-import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.lucene.util.automaton.CompiledAutomaton;
 
 /**
@@ -380,7 +377,7 @@ public final class BloomFilteringPostingsFormat extends PostingsFormat {
     public long ramBytesUsed() {
       long sizeInBytes =  ((delegateFieldsProducer!=null) ? delegateFieldsProducer.ramBytesUsed() : 0);
       for(Map.Entry<String,FuzzySet> entry: bloomsByFieldName.entrySet()) {
-        sizeInBytes += entry.getKey().length() * RamUsageEstimator.NUM_BYTES_CHAR;
+        sizeInBytes += entry.getKey().length() * Character.BYTES;
         sizeInBytes += entry.getValue().ramBytesUsed();
       }
       return sizeInBytes;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
----------------------------------------------------------------------
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java b/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
index a1fa24d..56b1a36 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.codecs.memory;
 
-
 import java.io.IOException;
 import java.util.Collection;
 import java.util.Collections;
@@ -154,7 +153,7 @@ public final class DirectPostingsFormat extends PostingsFormat {
     public long ramBytesUsed() {
       long sizeInBytes = 0;
       for(Map.Entry<String,DirectField> entry: fields.entrySet()) {
-        sizeInBytes += entry.getKey().length() * RamUsageEstimator.NUM_BYTES_CHAR;
+        sizeInBytes += entry.getKey().length() * Character.BYTES;
         sizeInBytes += entry.getValue().ramBytesUsed();
       }
       return sizeInBytes;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/codecs/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java
----------------------------------------------------------------------
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java b/lucene/codecs/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java
index 0fb320c..1427dec 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.codecs.memory;
 
-
 import java.io.IOException;
 import java.util.Collection;
 import java.util.Collections;
@@ -50,12 +49,10 @@ import org.apache.lucene.store.RAMOutputStream;
 import org.apache.lucene.util.Accountable;
 import org.apache.lucene.util.Accountables;
 import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.IntsRefBuilder;
-import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.lucene.util.fst.Builder;
 import org.apache.lucene.util.fst.ByteSequenceOutputs;
 import org.apache.lucene.util.fst.BytesRefFSTEnum;
@@ -1016,7 +1013,7 @@ public final class MemoryPostingsFormat extends PostingsFormat {
       public long ramBytesUsed() {
         long sizeInBytes = 0;
         for(Map.Entry<String,TermsReader> entry: fields.entrySet()) {
-          sizeInBytes += (entry.getKey().length() * RamUsageEstimator.NUM_BYTES_CHAR);
+          sizeInBytes += (entry.getKey().length() * Character.BYTES);
           sizeInBytes += entry.getValue().ramBytesUsed();
         }
         return sizeInBytes;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/CharTermAttributeImpl.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/CharTermAttributeImpl.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/CharTermAttributeImpl.java
index a1ac69b..cde8dd9 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/CharTermAttributeImpl.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/CharTermAttributeImpl.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.analysis.tokenattributes;
 
-
 import java.nio.CharBuffer;
 
 import org.apache.lucene.util.ArrayUtil;
@@ -24,13 +23,12 @@ import org.apache.lucene.util.AttributeImpl;
 import org.apache.lucene.util.AttributeReflector;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.BytesRefBuilder;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /** Default implementation of {@link CharTermAttribute}. */
 public class CharTermAttributeImpl extends AttributeImpl implements CharTermAttribute, TermToBytesRefAttribute, Cloneable {
   private static int MIN_BUFFER_SIZE = 10;
   
-  private char[] termBuffer = new char[ArrayUtil.oversize(MIN_BUFFER_SIZE, RamUsageEstimator.NUM_BYTES_CHAR)];
+  private char[] termBuffer = new char[ArrayUtil.oversize(MIN_BUFFER_SIZE, Character.BYTES)];
   private int termLength = 0;
   
   /** May be used by subclasses to convert to different charsets / encodings for implementing {@link #getBytesRef()}. */
@@ -56,7 +54,7 @@ public class CharTermAttributeImpl extends AttributeImpl implements CharTermAttr
     if(termBuffer.length < newSize){
       // Not big enough; create a new array with slight
       // over allocation and preserve content
-      final char[] newCharBuffer = new char[ArrayUtil.oversize(newSize, RamUsageEstimator.NUM_BYTES_CHAR)];
+      final char[] newCharBuffer = new char[ArrayUtil.oversize(newSize, Character.BYTES)];
       System.arraycopy(termBuffer, 0, newCharBuffer, 0, termBuffer.length);
       termBuffer = newCharBuffer;
     }
@@ -67,7 +65,7 @@ public class CharTermAttributeImpl extends AttributeImpl implements CharTermAttr
     if(termBuffer.length < newSize){
       // Not big enough; create a new array with slight
       // over allocation:
-      termBuffer = new char[ArrayUtil.oversize(newSize, RamUsageEstimator.NUM_BYTES_CHAR)];
+      termBuffer = new char[ArrayUtil.oversize(newSize, Character.BYTES)];
     }
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/codecs/lucene54/Lucene54DocValuesProducer.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene54/Lucene54DocValuesProducer.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene54/Lucene54DocValuesProducer.java
index 4e24c7a..67027ea 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene54/Lucene54DocValuesProducer.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene54/Lucene54DocValuesProducer.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.codecs.lucene54;
 
-
 import java.io.Closeable;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -753,7 +752,7 @@ final class Lucene54DocValuesProducer extends DocValuesProducer implements Close
       addresses = MonotonicBlockPackedReader.of(data, bytes.packedIntsVersion, bytes.blockSize, size, false);
       if (!merging) {
         addressInstances.put(field.name, addresses);
-        ramBytesUsed.addAndGet(addresses.ramBytesUsed() + RamUsageEstimator.NUM_BYTES_INT);
+        ramBytesUsed.addAndGet(addresses.ramBytesUsed() + Integer.BYTES);
       }
     }
     return addresses;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldDocValuesFormat.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldDocValuesFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldDocValuesFormat.java
index 25566e0..baadf1e 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldDocValuesFormat.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldDocValuesFormat.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.codecs.perfield;
 
-
 import java.io.Closeable;
 import java.io.IOException;
 import java.util.Collection;
@@ -44,7 +43,6 @@ import org.apache.lucene.util.Accountables;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /**
  * Enables per field docvalues support.
@@ -324,8 +322,7 @@ public abstract class PerFieldDocValuesFormat extends DocValuesFormat {
     public long ramBytesUsed() {
       long size = 0;
       for (Map.Entry<String,DocValuesProducer> entry : formats.entrySet()) {
-        size += (entry.getKey().length() * RamUsageEstimator.NUM_BYTES_CHAR) + 
-            entry.getValue().ramBytesUsed();
+        size += (entry.getKey().length() * Character.BYTES) + entry.getValue().ramBytesUsed();
       }
       return size;
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java b/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
index 1619857..9099cce 100644
--- a/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
@@ -16,10 +16,8 @@
  */
 package org.apache.lucene.document;
 
-
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.NumericUtils;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /** A double field that is indexed dimensionally such that finding
  *  all documents within an N-dimensional shape or range at search time is
@@ -30,7 +28,7 @@ public final class DoublePoint extends Field {
 
   private static FieldType getType(int numDims) {
     FieldType type = new FieldType();
-    type.setDimensions(numDims, RamUsageEstimator.NUM_BYTES_LONG);
+    type.setDimensions(numDims, Double.BYTES);
     type.freeze();
     return type;
   }
@@ -59,8 +57,8 @@ public final class DoublePoint extends Field {
       throw new IllegalStateException("this field (name=" + name + ") uses " + type.pointDimensionCount() + " dimensions; cannot convert to a single numeric value");
     }
     BytesRef bytes = (BytesRef) fieldsData;
-    assert bytes.length == RamUsageEstimator.NUM_BYTES_LONG;
-    return NumericUtils.sortableLongToDouble(NumericUtils.bytesToLongDirect(bytes.bytes, bytes.offset));
+    assert bytes.length == Double.BYTES;
+    return decodeDimension(bytes.bytes, bytes.offset);
   }
 
   private static BytesRef pack(double... point) {
@@ -70,10 +68,10 @@ public final class DoublePoint extends Field {
     if (point.length == 0) {
       throw new IllegalArgumentException("point cannot be 0 dimensions");
     }
-    byte[] packed = new byte[point.length * RamUsageEstimator.NUM_BYTES_LONG];
+    byte[] packed = new byte[point.length * Double.BYTES];
     
-    for(int dim=0;dim<point.length;dim++) {
-      NumericUtils.longToBytesDirect(NumericUtils.doubleToSortableLong(point[dim]), packed, dim);
+    for (int dim = 0; dim < point.length ; dim++) {
+      encodeDimension(point[dim], packed, dim * Double.BYTES);
     }
 
     return new BytesRef(packed);
@@ -91,28 +89,26 @@ public final class DoublePoint extends Field {
   }
   
   // public helper methods (e.g. for queries)
-  // TODO: try to rectify with pack() above, which works on a single concatenated array...
 
   /** Encode n-dimensional double point into binary encoding */
   public static byte[][] encode(Double value[]) {
     byte[][] encoded = new byte[value.length][];
     for (int i = 0; i < value.length; i++) {
       if (value[i] != null) {
-        encoded[i] = encodeDimension(value[i]);
+        encoded[i] = new byte[Double.BYTES];
+        encodeDimension(value[i], encoded[i], 0);
       }
     }
     return encoded;
   }
   
   /** Encode single double dimension */
-  public static byte[] encodeDimension(Double value) {
-    byte encoded[] = new byte[Long.BYTES];
-    NumericUtils.longToBytesDirect(NumericUtils.doubleToSortableLong(value), encoded, 0);
-    return encoded;
+  public static void encodeDimension(Double value, byte dest[], int offset) {
+    NumericUtils.longToBytesDirect(NumericUtils.doubleToSortableLong(value), dest, offset);
   }
   
-  /** Decode single double value */
-  public static Double decodeDimension(byte value[]) {
-    return NumericUtils.sortableLongToDouble(NumericUtils.bytesToLongDirect(value, 0));
+  /** Decode single double dimension */
+  public static Double decodeDimension(byte value[], int offset) {
+    return NumericUtils.sortableLongToDouble(NumericUtils.bytesToLongDirect(value, offset));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java b/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
index cfd6c7c..c47f4ae 100644
--- a/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
@@ -16,10 +16,8 @@
  */
 package org.apache.lucene.document;
 
-
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.NumericUtils;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /** A field that is indexed dimensionally such that finding
  *  all documents within an N-dimensional at search time is
@@ -30,7 +28,7 @@ public final class FloatPoint extends Field {
 
   private static FieldType getType(int numDims) {
     FieldType type = new FieldType();
-    type.setDimensions(numDims, RamUsageEstimator.NUM_BYTES_INT);
+    type.setDimensions(numDims, Float.BYTES);
     type.freeze();
     return type;
   }
@@ -59,8 +57,8 @@ public final class FloatPoint extends Field {
       throw new IllegalStateException("this field (name=" + name + ") uses " + type.pointDimensionCount() + " dimensions; cannot convert to a single numeric value");
     }
     BytesRef bytes = (BytesRef) fieldsData;
-    assert bytes.length == RamUsageEstimator.NUM_BYTES_INT;
-    return NumericUtils.sortableIntToFloat(NumericUtils.bytesToIntDirect(bytes.bytes, bytes.offset));
+    assert bytes.length == Float.BYTES;
+    return decodeDimension(bytes.bytes, bytes.offset);
   }
 
   private static BytesRef pack(float... point) {
@@ -70,10 +68,10 @@ public final class FloatPoint extends Field {
     if (point.length == 0) {
       throw new IllegalArgumentException("point cannot be 0 dimensions");
     }
-    byte[] packed = new byte[point.length * RamUsageEstimator.NUM_BYTES_INT];
+    byte[] packed = new byte[point.length * Float.BYTES];
     
-    for(int dim=0;dim<point.length;dim++) {
-      NumericUtils.intToBytesDirect(NumericUtils.floatToSortableInt(point[dim]), packed, dim);
+    for (int dim = 0; dim < point.length; dim++) {
+      encodeDimension(point[dim], packed, dim * Float.BYTES);
     }
 
     return new BytesRef(packed);
@@ -91,28 +89,26 @@ public final class FloatPoint extends Field {
   }
   
   // public helper methods (e.g. for queries)
-  // TODO: try to rectify with pack() above, which works on a single concatenated array...
 
   /** Encode n-dimensional float values into binary encoding */
   public static byte[][] encode(Float value[]) {
     byte[][] encoded = new byte[value.length][];
     for (int i = 0; i < value.length; i++) {
       if (value[i] != null) {
-        encoded[i] = encodeDimension(value[i]);
+        encoded[i] = new byte[Float.BYTES];
+        encodeDimension(value[i], encoded[i], 0);
       }
     }
     return encoded;
   }
   
   /** Encode single float dimension */
-  public static byte[] encodeDimension(Float value) {
-    byte encoded[] = new byte[Integer.BYTES];
-    NumericUtils.intToBytesDirect(NumericUtils.floatToSortableInt(value), encoded, 0);
-    return encoded;
+  public static void encodeDimension(Float value, byte dest[], int offset) {
+    NumericUtils.intToBytesDirect(NumericUtils.floatToSortableInt(value), dest, offset);
   }
   
   /** Decode single float dimension */
-  public static Float decodeDimension(byte value[]) {
-    return NumericUtils.sortableIntToFloat(NumericUtils.bytesToIntDirect(value, 0));
+  public static Float decodeDimension(byte value[], int offset) {
+    return NumericUtils.sortableIntToFloat(NumericUtils.bytesToIntDirect(value, offset));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/IntPoint.java b/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
index 40ddf07..32d2b59 100644
--- a/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
@@ -16,10 +16,8 @@
  */
 package org.apache.lucene.document;
 
-
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.NumericUtils;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /** An int field that is indexed dimensionally such that finding
  *  all documents within an N-dimensional shape or range at search time is
@@ -30,7 +28,7 @@ public final class IntPoint extends Field {
 
   private static FieldType getType(int numDims) {
     FieldType type = new FieldType();
-    type.setDimensions(numDims, RamUsageEstimator.NUM_BYTES_INT);
+    type.setDimensions(numDims, Integer.BYTES);
     type.freeze();
     return type;
   }
@@ -59,8 +57,8 @@ public final class IntPoint extends Field {
       throw new IllegalStateException("this field (name=" + name + ") uses " + type.pointDimensionCount() + " dimensions; cannot convert to a single numeric value");
     }
     BytesRef bytes = (BytesRef) fieldsData;
-    assert bytes.length == RamUsageEstimator.NUM_BYTES_INT;
-    return NumericUtils.bytesToInt(bytes.bytes, bytes.offset);
+    assert bytes.length == Integer.BYTES;
+    return decodeDimension(bytes.bytes, bytes.offset);
   }
 
   private static BytesRef pack(int... point) {
@@ -70,10 +68,10 @@ public final class IntPoint extends Field {
     if (point.length == 0) {
       throw new IllegalArgumentException("point cannot be 0 dimensions");
     }
-    byte[] packed = new byte[point.length * RamUsageEstimator.NUM_BYTES_INT];
+    byte[] packed = new byte[point.length * Integer.BYTES];
     
-    for(int dim=0;dim<point.length;dim++) {
-      NumericUtils.intToBytes(point[dim], packed, dim);
+    for (int dim = 0; dim < point.length; dim++) {
+      encodeDimension(point[dim], packed, dim * Integer.BYTES);
     }
 
     return new BytesRef(packed);
@@ -91,28 +89,26 @@ public final class IntPoint extends Field {
   }
 
   // public helper methods (e.g. for queries)
-  // TODO: try to rectify with pack() above, which works on a single concatenated array...
 
   /** Encode n-dimensional integer values into binary encoding */
   public static byte[][] encode(Integer value[]) {
     byte[][] encoded = new byte[value.length][];
     for (int i = 0; i < value.length; i++) {
       if (value[i] != null) {
-        encoded[i] = encodeDimension(value[i]);
+        encoded[i] = new byte[Integer.BYTES];
+        encodeDimension(value[i], encoded[i], 0);
       }
     }
     return encoded;
   }
   
   /** Encode single integer dimension */
-  public static byte[] encodeDimension(Integer value) {
-    byte encoded[] = new byte[Integer.BYTES];
-    NumericUtils.intToBytes(value, encoded, 0);
-    return encoded;
+  public static void encodeDimension(Integer value, byte dest[], int offset) {
+    NumericUtils.intToBytes(value, dest, offset);
   }
   
   /** Decode single integer dimension */
-  public static Integer decodeDimension(byte value[]) {
-    return NumericUtils.bytesToInt(value, 0);
+  public static Integer decodeDimension(byte value[], int offset) {
+    return NumericUtils.bytesToInt(value, offset);
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/LongPoint.java b/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
index 08a904c..b2ec29b 100644
--- a/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/LongPoint.java
@@ -16,10 +16,8 @@
  */
 package org.apache.lucene.document;
 
-
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.NumericUtils;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /** A long field that is indexed dimensionally such that finding
  *  all documents within an N-dimensional shape or range at search time is
@@ -30,7 +28,7 @@ public final class LongPoint extends Field {
 
   private static FieldType getType(int numDims) {
     FieldType type = new FieldType();
-    type.setDimensions(numDims, RamUsageEstimator.NUM_BYTES_LONG);
+    type.setDimensions(numDims, Long.BYTES);
     type.freeze();
     return type;
   }
@@ -59,8 +57,8 @@ public final class LongPoint extends Field {
       throw new IllegalStateException("this field (name=" + name + ") uses " + type.pointDimensionCount() + " dimensions; cannot convert to a single numeric value");
     }
     BytesRef bytes = (BytesRef) fieldsData;
-    assert bytes.length == RamUsageEstimator.NUM_BYTES_LONG;
-    return NumericUtils.bytesToLong(bytes.bytes, bytes.offset);
+    assert bytes.length == Long.BYTES;
+    return decodeDimension(bytes.bytes, bytes.offset);
   }
 
   private static BytesRef pack(long... point) {
@@ -70,10 +68,10 @@ public final class LongPoint extends Field {
     if (point.length == 0) {
       throw new IllegalArgumentException("point cannot be 0 dimensions");
     }
-    byte[] packed = new byte[point.length * RamUsageEstimator.NUM_BYTES_LONG];
+    byte[] packed = new byte[point.length * Long.BYTES];
     
-    for(int dim=0;dim<point.length;dim++) {
-      NumericUtils.longToBytes(point[dim], packed, dim);
+    for (int dim = 0; dim < point.length; dim++) {
+      encodeDimension(point[dim], packed, dim * Long.BYTES);
     }
 
     return new BytesRef(packed);
@@ -91,28 +89,26 @@ public final class LongPoint extends Field {
   }
   
   // public helper methods (e.g. for queries)
-  // TODO: try to rectify with pack() above, which works on a single concatenated array...
 
   /** Encode n-dimensional long values into binary encoding */
   public static byte[][] encode(Long value[]) {
     byte[][] encoded = new byte[value.length][];
     for (int i = 0; i < value.length; i++) {
       if (value[i] != null) {
-        encoded[i] = encodeDimension(value[i]);
+        encoded[i] = new byte[Long.BYTES];
+        encodeDimension(value[i], encoded[i], 0);
       }
     }
     return encoded;
   }
   
   /** Encode single long dimension */
-  public static byte[] encodeDimension(Long value) {
-    byte encoded[] = new byte[Long.BYTES];
-    NumericUtils.longToBytes(value, encoded, 0);
-    return encoded;
+  public static void encodeDimension(Long value, byte dest[], int offset) {
+    NumericUtils.longToBytes(value, dest, offset);
   }
   
   /** Decode single long dimension */
-  public static Long decodeDimension(byte value[]) {
-    return NumericUtils.bytesToLong(value, 0);
+  public static Long decodeDimension(byte value[], int offset) {
+    return NumericUtils.bytesToLong(value, offset);
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/index/BufferedUpdates.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/BufferedUpdates.java b/lucene/core/src/java/org/apache/lucene/index/BufferedUpdates.java
index 259547f..6225337 100644
--- a/lucene/core/src/java/org/apache/lucene/index/BufferedUpdates.java
+++ b/lucene/core/src/java/org/apache/lucene/index/BufferedUpdates.java
@@ -52,19 +52,19 @@ class BufferedUpdates {
      Term's text is String (OBJ_HEADER + 4*INT + POINTER +
      OBJ_HEADER + string.length*CHAR).  Integer is
      OBJ_HEADER + INT. */
-  final static int BYTES_PER_DEL_TERM = 9*RamUsageEstimator.NUM_BYTES_OBJECT_REF + 7*RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + 10*RamUsageEstimator.NUM_BYTES_INT;
+  final static int BYTES_PER_DEL_TERM = 9*RamUsageEstimator.NUM_BYTES_OBJECT_REF + 7*RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + 10*Integer.BYTES;
 
   /* Rough logic: del docIDs are List<Integer>.  Say list
      allocates ~2X size (2*POINTER).  Integer is OBJ_HEADER
      + int */
-  final static int BYTES_PER_DEL_DOCID = 2*RamUsageEstimator.NUM_BYTES_OBJECT_REF + RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + RamUsageEstimator.NUM_BYTES_INT;
+  final static int BYTES_PER_DEL_DOCID = 2*RamUsageEstimator.NUM_BYTES_OBJECT_REF + RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + Integer.BYTES;
 
   /* Rough logic: HashMap has an array[Entry] w/ varying
      load factor (say 2 * POINTER).  Entry is object w/
      Query key, Integer val, int hash, Entry next
      (OBJ_HEADER + 3*POINTER + INT).  Query we often
      undercount (say 24 bytes).  Integer is OBJ_HEADER + INT. */
-  final static int BYTES_PER_DEL_QUERY = 5*RamUsageEstimator.NUM_BYTES_OBJECT_REF + 2*RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + 2*RamUsageEstimator.NUM_BYTES_INT + 24;
+  final static int BYTES_PER_DEL_QUERY = 5*RamUsageEstimator.NUM_BYTES_OBJECT_REF + 2*RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + 2*Integer.BYTES + 24;
 
   /* Rough logic: NumericUpdate calculates its actual size,
    * including the update Term and DV field (String). The 
@@ -82,7 +82,7 @@ class BufferedUpdates {
    */
   final static int BYTES_PER_NUMERIC_FIELD_ENTRY =
       7*RamUsageEstimator.NUM_BYTES_OBJECT_REF + 3*RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + 
-      RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + 5*RamUsageEstimator.NUM_BYTES_INT + RamUsageEstimator.NUM_BYTES_FLOAT;
+      RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + 5*Integer.BYTES + Float.BYTES;
       
   /* Rough logic: Incremented when we see another Term for an already updated
    * field.
@@ -93,7 +93,7 @@ class BufferedUpdates {
    * Term (key) is counted only as POINTER.
    * NumericUpdate (val) counts its own size and isn't accounted for here.
    */
-  final static int BYTES_PER_NUMERIC_UPDATE_ENTRY = 7*RamUsageEstimator.NUM_BYTES_OBJECT_REF + RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + RamUsageEstimator.NUM_BYTES_INT;
+  final static int BYTES_PER_NUMERIC_UPDATE_ENTRY = 7*RamUsageEstimator.NUM_BYTES_OBJECT_REF + RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + Integer.BYTES;
 
   /* Rough logic: BinaryUpdate calculates its actual size,
    * including the update Term and DV field (String). The 
@@ -111,7 +111,7 @@ class BufferedUpdates {
    */
   final static int BYTES_PER_BINARY_FIELD_ENTRY =
       7*RamUsageEstimator.NUM_BYTES_OBJECT_REF + 3*RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + 
-      RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + 5*RamUsageEstimator.NUM_BYTES_INT + RamUsageEstimator.NUM_BYTES_FLOAT;
+      RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + 5*Integer.BYTES + Float.BYTES;
       
   /* Rough logic: Incremented when we see another Term for an already updated
    * field.
@@ -122,7 +122,7 @@ class BufferedUpdates {
    * Term (key) is counted only as POINTER.
    * BinaryUpdate (val) counts its own size and isn't accounted for here.
    */
-  final static int BYTES_PER_BINARY_UPDATE_ENTRY = 7*RamUsageEstimator.NUM_BYTES_OBJECT_REF + RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + RamUsageEstimator.NUM_BYTES_INT;
+  final static int BYTES_PER_BINARY_UPDATE_ENTRY = 7*RamUsageEstimator.NUM_BYTES_OBJECT_REF + RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + Integer.BYTES;
   
   final AtomicInteger numTermDeletes = new AtomicInteger();
   final AtomicInteger numNumericUpdates = new AtomicInteger();
@@ -226,7 +226,7 @@ class BufferedUpdates {
     // is done to respect IndexWriterConfig.setMaxBufferedDeleteTerms.
     numTermDeletes.incrementAndGet();
     if (current == null) {
-      bytesUsed.addAndGet(BYTES_PER_DEL_TERM + term.bytes.length + (RamUsageEstimator.NUM_BYTES_CHAR * term.field().length()));
+      bytesUsed.addAndGet(BYTES_PER_DEL_TERM + term.bytes.length + (Character.BYTES * term.field().length()));
     }
   }
  

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java b/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java
index e7b1781..c972964 100644
--- a/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java
@@ -16,16 +16,12 @@
  */
 package org.apache.lucene.index;
 
-
 import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_ARRAY_HEADER;
-import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_CHAR;
-import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_INT;
 import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_OBJECT_HEADER;
 import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_OBJECT_REF;
 
 import org.apache.lucene.document.NumericDocValuesField;
 import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /** An in-place update to a DocValues field. */
 abstract class DocValuesUpdate {
@@ -37,7 +33,7 @@ abstract class DocValuesUpdate {
    * String: 2*OBJ_HEADER + 4*INT + PTR + string.length*CHAR
    * T: OBJ_HEADER
    */
-  private static final int RAW_SIZE_IN_BYTES = 8*NUM_BYTES_OBJECT_HEADER + 8*NUM_BYTES_OBJECT_REF + 8*NUM_BYTES_INT;
+  private static final int RAW_SIZE_IN_BYTES = 8*NUM_BYTES_OBJECT_HEADER + 8*NUM_BYTES_OBJECT_REF + 8*Integer.BYTES;
   
   final DocValuesType type;
   final Term term;
@@ -63,9 +59,9 @@ abstract class DocValuesUpdate {
   
   final int sizeInBytes() {
     int sizeInBytes = RAW_SIZE_IN_BYTES;
-    sizeInBytes += term.field.length() * NUM_BYTES_CHAR;
+    sizeInBytes += term.field.length() * Character.BYTES;
     sizeInBytes += term.bytes.bytes.length;
-    sizeInBytes += field.length() * NUM_BYTES_CHAR;
+    sizeInBytes += field.length() * Character.BYTES;
     sizeInBytes += valueSizeInBytes();
     return sizeInBytes;
   }
@@ -79,7 +75,7 @@ abstract class DocValuesUpdate {
   static final class BinaryDocValuesUpdate extends DocValuesUpdate {
     
     /* Size of BytesRef: 2*INT + ARRAY_HEADER + PTR */
-    private static final long RAW_VALUE_SIZE_IN_BYTES = NUM_BYTES_ARRAY_HEADER + 2*NUM_BYTES_INT + NUM_BYTES_OBJECT_REF;
+    private static final long RAW_VALUE_SIZE_IN_BYTES = NUM_BYTES_ARRAY_HEADER + 2*Integer.BYTES + NUM_BYTES_OBJECT_REF;
     
     BinaryDocValuesUpdate(Term term, String field, BytesRef value) {
       super(DocValuesType.BINARY, term, field, value);
@@ -101,7 +97,7 @@ abstract class DocValuesUpdate {
 
     @Override
     long valueSizeInBytes() {
-      return RamUsageEstimator.NUM_BYTES_LONG;
+      return Long.BYTES;
     }
     
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
index e5998de..65d6a14 100644
--- a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.index;
 
-
 import java.io.IOException;
 import java.text.NumberFormat;
 import java.util.Collections;
@@ -40,7 +39,6 @@ import org.apache.lucene.util.Counter;
 import org.apache.lucene.util.InfoStream;
 import org.apache.lucene.util.IntBlockPool;
 import org.apache.lucene.util.MutableBits;
-import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.lucene.util.StringHelper;
 import org.apache.lucene.util.Version;
 
@@ -576,14 +574,13 @@ class DocumentsWriterPerThread {
     @Override
     public int[] getIntBlock() {
       int[] b = new int[IntBlockPool.INT_BLOCK_SIZE];
-      bytesUsed.addAndGet(IntBlockPool.INT_BLOCK_SIZE
-          * RamUsageEstimator.NUM_BYTES_INT);
+      bytesUsed.addAndGet(IntBlockPool.INT_BLOCK_SIZE * Integer.BYTES);
       return b;
     }
     
     @Override
     public void recycleIntBlocks(int[][] blocks, int offset, int length) {
-      bytesUsed.addAndGet(-(length * (IntBlockPool.INT_BLOCK_SIZE * RamUsageEstimator.NUM_BYTES_INT)));
+      bytesUsed.addAndGet(-(length * (IntBlockPool.INT_BLOCK_SIZE * Integer.BYTES)));
     }
     
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java b/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java
index 0a7dcfd..28fe872 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java
@@ -16,13 +16,11 @@
  */
 package org.apache.lucene.index;
 
-
 import java.io.IOException;
 
 import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
 import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
 import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.RamUsageEstimator;
 
 // TODO: break into separate freq and prox writers as
 // codecs; make separate container (tii/tis/skip/*) that can
@@ -257,15 +255,15 @@ final class FreqProxTermsWriterPerField extends TermsHashPerField {
 
     @Override
     int bytesPerPosting() {
-      int bytes = ParallelPostingsArray.BYTES_PER_POSTING + 2 * RamUsageEstimator.NUM_BYTES_INT;
+      int bytes = ParallelPostingsArray.BYTES_PER_POSTING + 2 * Integer.BYTES;
       if (lastPositions != null) {
-        bytes += RamUsageEstimator.NUM_BYTES_INT;
+        bytes += Integer.BYTES;
       }
       if (lastOffsets != null) {
-        bytes += RamUsageEstimator.NUM_BYTES_INT;
+        bytes += Integer.BYTES;
       }
       if (termFreqs != null) {
-        bytes += RamUsageEstimator.NUM_BYTES_INT;
+        bytes += Integer.BYTES;
       }
 
       return bytes;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/index/FrozenBufferedUpdates.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/FrozenBufferedUpdates.java b/lucene/core/src/java/org/apache/lucene/index/FrozenBufferedUpdates.java
index a3a57a3..4f482ad 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FrozenBufferedUpdates.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FrozenBufferedUpdates.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.index;
 
-
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -40,7 +39,7 @@ import org.apache.lucene.util.RamUsageEstimator;
 class FrozenBufferedUpdates {
 
   /* Query we often undercount (say 24 bytes), plus int. */
-  final static int BYTES_PER_DEL_QUERY = RamUsageEstimator.NUM_BYTES_OBJECT_REF + RamUsageEstimator.NUM_BYTES_INT + 24;
+  final static int BYTES_PER_DEL_QUERY = RamUsageEstimator.NUM_BYTES_OBJECT_REF + Integer.BYTES + 24;
   
   // Terms, in sorted order:
   final PrefixCodedTerms terms;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/index/ParallelPostingsArray.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/ParallelPostingsArray.java b/lucene/core/src/java/org/apache/lucene/index/ParallelPostingsArray.java
index 400f441..35e8e4f 100644
--- a/lucene/core/src/java/org/apache/lucene/index/ParallelPostingsArray.java
+++ b/lucene/core/src/java/org/apache/lucene/index/ParallelPostingsArray.java
@@ -16,12 +16,10 @@
  */
 package org.apache.lucene.index;
 
-
 import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.RamUsageEstimator;
 
 class ParallelPostingsArray {
-  final static int BYTES_PER_POSTING = 3 * RamUsageEstimator.NUM_BYTES_INT;
+  final static int BYTES_PER_POSTING = 3 * Integer.BYTES;
 
   final int size;
   final int[] textStarts;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/index/PointValuesWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/PointValuesWriter.java b/lucene/core/src/java/org/apache/lucene/index/PointValuesWriter.java
index 1008f05..283f7bd 100644
--- a/lucene/core/src/java/org/apache/lucene/index/PointValuesWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/PointValuesWriter.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.index;
 
-
 import java.io.IOException;
 
 import org.apache.lucene.codecs.PointReader;
@@ -25,7 +24,6 @@ import org.apache.lucene.util.ArrayUtil;
 import org.apache.lucene.util.ByteBlockPool;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.Counter;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /** Buffers up pending byte[][] value(s) per doc, then flushes when segment flushes. */
 class PointValuesWriter {
@@ -41,7 +39,7 @@ class PointValuesWriter {
     this.iwBytesUsed = docWriter.bytesUsed;
     this.bytes = new ByteBlockPool(docWriter.byteBlockAllocator);
     docIDs = new int[16];
-    iwBytesUsed.addAndGet(16 * RamUsageEstimator.NUM_BYTES_INT);
+    iwBytesUsed.addAndGet(16 * Integer.BYTES);
     packedValue = new byte[fieldInfo.getPointDimensionCount() * fieldInfo.getPointNumBytes()];
   }
 
@@ -54,7 +52,7 @@ class PointValuesWriter {
     }
     if (docIDs.length == numDocs) {
       docIDs = ArrayUtil.grow(docIDs, numDocs+1);
-      iwBytesUsed.addAndGet((docIDs.length - numDocs) * RamUsageEstimator.NUM_BYTES_INT);
+      iwBytesUsed.addAndGet((docIDs.length - numDocs) * Integer.BYTES);
     }
     bytes.append(value);
     docIDs[numDocs] = docID;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/index/PrefixCodedTerms.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/PrefixCodedTerms.java b/lucene/core/src/java/org/apache/lucene/index/PrefixCodedTerms.java
index d4b23fe..87a9ae2 100644
--- a/lucene/core/src/java/org/apache/lucene/index/PrefixCodedTerms.java
+++ b/lucene/core/src/java/org/apache/lucene/index/PrefixCodedTerms.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.index;
 
-
 import java.io.IOException;
 import java.util.Objects;
 
@@ -27,7 +26,6 @@ import org.apache.lucene.store.RAMOutputStream;
 import org.apache.lucene.util.Accountable;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.BytesRefBuilder;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /**
  * Prefix codes term instances (prefixes are shared)
@@ -45,7 +43,7 @@ public class PrefixCodedTerms implements Accountable {
 
   @Override
   public long ramBytesUsed() {
-    return buffer.ramBytesUsed() + 2 * RamUsageEstimator.NUM_BYTES_LONG;
+    return buffer.ramBytesUsed() + 2 * Long.BYTES;
   }
 
   /** Records del gen for this packet. */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/index/SortedDocValuesWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/SortedDocValuesWriter.java b/lucene/core/src/java/org/apache/lucene/index/SortedDocValuesWriter.java
index 3231c60..2d8557b 100644
--- a/lucene/core/src/java/org/apache/lucene/index/SortedDocValuesWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/SortedDocValuesWriter.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.index;
 
-
 import static org.apache.lucene.util.ByteBlockPool.BYTE_BLOCK_SIZE;
 
 import java.io.IOException;
@@ -29,7 +28,6 @@ import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.BytesRefHash.DirectBytesStartArray;
 import org.apache.lucene.util.BytesRefHash;
 import org.apache.lucene.util.Counter;
-import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.lucene.util.packed.PackedInts;
 import org.apache.lucene.util.packed.PackedLongValues;
 
@@ -93,7 +91,7 @@ class SortedDocValuesWriter extends DocValuesWriter {
       // 1. when indexing, when hash is 50% full, rehash() suddenly needs 2*size ints.
       //    TODO: can this same OOM happen in THPF?
       // 2. when flushing, we need 1 int per value (slot in the ordMap).
-      iwBytesUsed.addAndGet(2 * RamUsageEstimator.NUM_BYTES_INT);
+      iwBytesUsed.addAndGet(2 * Integer.BYTES);
     }
     
     pending.add(termID);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/index/SortedSetDocValuesWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/SortedSetDocValuesWriter.java b/lucene/core/src/java/org/apache/lucene/index/SortedSetDocValuesWriter.java
index 52c6b5d..e98fc82 100644
--- a/lucene/core/src/java/org/apache/lucene/index/SortedSetDocValuesWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/SortedSetDocValuesWriter.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.index;
 
-
 import static org.apache.lucene.util.ByteBlockPool.BYTE_BLOCK_SIZE;
 
 import java.io.IOException;
@@ -31,7 +30,6 @@ import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.BytesRefHash.DirectBytesStartArray;
 import org.apache.lucene.util.BytesRefHash;
 import org.apache.lucene.util.Counter;
-import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.lucene.util.packed.PackedInts;
 import org.apache.lucene.util.packed.PackedLongValues;
 
@@ -125,14 +123,14 @@ class SortedSetDocValuesWriter extends DocValuesWriter {
       // 1. when indexing, when hash is 50% full, rehash() suddenly needs 2*size ints.
       //    TODO: can this same OOM happen in THPF?
       // 2. when flushing, we need 1 int per value (slot in the ordMap).
-      iwBytesUsed.addAndGet(2 * RamUsageEstimator.NUM_BYTES_INT);
+      iwBytesUsed.addAndGet(2 * Integer.BYTES);
     }
     
     if (currentUpto == currentValues.length) {
       currentValues = ArrayUtil.grow(currentValues, currentValues.length+1);
       // reserve additional space for max # values per-doc
       // when flushing, we need an int[] to sort the mapped-ords within the doc
-      iwBytesUsed.addAndGet((currentValues.length - currentUpto) * 2 * RamUsageEstimator.NUM_BYTES_INT);
+      iwBytesUsed.addAndGet((currentValues.length - currentUpto) * 2 * Integer.BYTES);
     }
     
     currentValues[currentUpto] = termID;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java b/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java
index f252147..f69817a 100644
--- a/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java
+++ b/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.index;
 
-
 import java.io.IOException;
 
 import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
@@ -283,7 +282,7 @@ final class TermVectorsConsumerPerField extends TermsHashPerField {
 
     @Override
     int bytesPerPosting() {
-      return super.bytesPerPosting() + 3 * RamUsageEstimator.NUM_BYTES_INT;
+      return super.bytesPerPosting() + 3 * Integer.BYTES;
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/search/CachingCollector.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/CachingCollector.java b/lucene/core/src/java/org/apache/lucene/search/CachingCollector.java
index 55fb305..344ec3a 100644
--- a/lucene/core/src/java/org/apache/lucene/search/CachingCollector.java
+++ b/lucene/core/src/java/org/apache/lucene/search/CachingCollector.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.search;
 
-
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -24,7 +23,6 @@ import java.util.List;
 
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.RamUsageEstimator;
 
 /**
  * Caches all docs, and optionally also scores, coming from
@@ -233,7 +231,7 @@ public abstract class CachingCollector extends FilterCollector {
           if (docCount >= maxDocsToCache) {
             invalidate();
           } else {
-            final int newLen = Math.min(ArrayUtil.oversize(docCount + 1, RamUsageEstimator.NUM_BYTES_INT), maxDocsToCache);
+            final int newLen = Math.min(ArrayUtil.oversize(docCount + 1, Integer.BYTES), maxDocsToCache);
             grow(newLen);
           }
         }
@@ -329,9 +327,9 @@ public abstract class CachingCollector extends FilterCollector {
    *          scores are cached.
    */
   public static CachingCollector create(Collector other, boolean cacheScores, double maxRAMMB) {
-    int bytesPerDoc = RamUsageEstimator.NUM_BYTES_INT;
+    int bytesPerDoc = Integer.BYTES;
     if (cacheScores) {
-      bytesPerDoc += RamUsageEstimator.NUM_BYTES_FLOAT;
+      bytesPerDoc += Float.BYTES;
     }
     final int maxDocsToCache = (int) ((maxRAMMB * 1024 * 1024) / bytesPerDoc);
     return create(other, cacheScores, maxDocsToCache);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java b/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
index 949cffe..9fe2a8d 100644
--- a/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
@@ -194,7 +194,7 @@ public class PointRangeQuery extends Query {
     return new PointRangeQuery(field, IntPoint.encode(lowerValue), lowerInclusive, IntPoint.encode(upperValue), upperInclusive) {
       @Override
       protected String toString(byte[] value) {
-        return IntPoint.decodeDimension(value).toString();
+        return IntPoint.decodeDimension(value, 0).toString();
       }
     };
   }
@@ -264,7 +264,7 @@ public class PointRangeQuery extends Query {
     return new PointRangeQuery(field, LongPoint.encode(lowerValue), lowerInclusive, LongPoint.encode(upperValue), upperInclusive) {
       @Override
       protected String toString(byte[] value) {
-        return LongPoint.decodeDimension(value).toString();
+        return LongPoint.decodeDimension(value, 0).toString();
       }
     };
   }
@@ -334,7 +334,7 @@ public class PointRangeQuery extends Query {
     return new PointRangeQuery(field, FloatPoint.encode(lowerValue), lowerInclusive, FloatPoint.encode(upperValue), upperInclusive) {
       @Override
       protected String toString(byte[] value) {
-        return FloatPoint.decodeDimension(value).toString();
+        return FloatPoint.decodeDimension(value, 0).toString();
       }
     };
   }
@@ -404,7 +404,7 @@ public class PointRangeQuery extends Query {
     return new PointRangeQuery(field, DoublePoint.encode(lowerValue), lowerInclusive, DoublePoint.encode(upperValue), upperInclusive) {
       @Override
       protected String toString(byte[] value) {
-        return DoublePoint.decodeDimension(value).toString();
+        return DoublePoint.decodeDimension(value, 0).toString();
       }
     };
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java b/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java
index f472f5c..e0917eb 100644
--- a/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java
+++ b/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.search;
 
-
 import java.io.IOException;
 
 import org.apache.lucene.index.IndexReader;
@@ -168,7 +167,7 @@ public abstract class ScoringRewrite<B> extends TermCollectingRewrite<B> {
     @Override
     public int[] init() {
       final int[] ord = super.init();
-      boost = new float[ArrayUtil.oversize(ord.length, RamUsageEstimator.NUM_BYTES_FLOAT)];
+      boost = new float[ArrayUtil.oversize(ord.length, Float.BYTES)];
       termState = new TermContext[ArrayUtil.oversize(ord.length, RamUsageEstimator.NUM_BYTES_OBJECT_REF)];
       assert termState.length >= ord.length && boost.length >= ord.length;
       return ord;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/ArrayUtil.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/ArrayUtil.java b/lucene/core/src/java/org/apache/lucene/util/ArrayUtil.java
index a826d35..3ab5da2 100644
--- a/lucene/core/src/java/org/apache/lucene/util/ArrayUtil.java
+++ b/lucene/core/src/java/org/apache/lucene/util/ArrayUtil.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.util;
 
-
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Comparator;
@@ -248,7 +247,7 @@ public final class ArrayUtil {
   public static short[] grow(short[] array, int minSize) {
     assert minSize >= 0: "size must be positive (got " + minSize + "): likely integer overflow?";
     if (array.length < minSize) {
-      short[] newArray = new short[oversize(minSize, RamUsageEstimator.NUM_BYTES_SHORT)];
+      short[] newArray = new short[oversize(minSize, Short.BYTES)];
       System.arraycopy(array, 0, newArray, 0, array.length);
       return newArray;
     } else
@@ -262,7 +261,7 @@ public final class ArrayUtil {
   public static float[] grow(float[] array, int minSize) {
     assert minSize >= 0: "size must be positive (got " + minSize + "): likely integer overflow?";
     if (array.length < minSize) {
-      float[] newArray = new float[oversize(minSize, RamUsageEstimator.NUM_BYTES_FLOAT)];
+      float[] newArray = new float[oversize(minSize, Float.BYTES)];
       System.arraycopy(array, 0, newArray, 0, array.length);
       return newArray;
     } else
@@ -276,7 +275,7 @@ public final class ArrayUtil {
   public static double[] grow(double[] array, int minSize) {
     assert minSize >= 0: "size must be positive (got " + minSize + "): likely integer overflow?";
     if (array.length < minSize) {
-      double[] newArray = new double[oversize(minSize, RamUsageEstimator.NUM_BYTES_DOUBLE)];
+      double[] newArray = new double[oversize(minSize, Double.BYTES)];
       System.arraycopy(array, 0, newArray, 0, array.length);
       return newArray;
     } else
@@ -289,7 +288,7 @@ public final class ArrayUtil {
 
   public static short[] shrink(short[] array, int targetSize) {
     assert targetSize >= 0: "size must be positive (got " + targetSize + "): likely integer overflow?";
-    final int newSize = getShrinkSize(array.length, targetSize, RamUsageEstimator.NUM_BYTES_SHORT);
+    final int newSize = getShrinkSize(array.length, targetSize, Short.BYTES);
     if (newSize != array.length) {
       short[] newArray = new short[newSize];
       System.arraycopy(array, 0, newArray, 0, newSize);
@@ -301,7 +300,7 @@ public final class ArrayUtil {
   public static int[] grow(int[] array, int minSize) {
     assert minSize >= 0: "size must be positive (got " + minSize + "): likely integer overflow?";
     if (array.length < minSize) {
-      int[] newArray = new int[oversize(minSize, RamUsageEstimator.NUM_BYTES_INT)];
+      int[] newArray = new int[oversize(minSize, Integer.BYTES)];
       System.arraycopy(array, 0, newArray, 0, array.length);
       return newArray;
     } else
@@ -314,7 +313,7 @@ public final class ArrayUtil {
 
   public static int[] shrink(int[] array, int targetSize) {
     assert targetSize >= 0: "size must be positive (got " + targetSize + "): likely integer overflow?";
-    final int newSize = getShrinkSize(array.length, targetSize, RamUsageEstimator.NUM_BYTES_INT);
+    final int newSize = getShrinkSize(array.length, targetSize, Integer.BYTES);
     if (newSize != array.length) {
       int[] newArray = new int[newSize];
       System.arraycopy(array, 0, newArray, 0, newSize);
@@ -326,7 +325,7 @@ public final class ArrayUtil {
   public static long[] grow(long[] array, int minSize) {
     assert minSize >= 0: "size must be positive (got " + minSize + "): likely integer overflow?";
     if (array.length < minSize) {
-      long[] newArray = new long[oversize(minSize, RamUsageEstimator.NUM_BYTES_LONG)];
+      long[] newArray = new long[oversize(minSize, Long.BYTES)];
       System.arraycopy(array, 0, newArray, 0, array.length);
       return newArray;
     } else
@@ -339,7 +338,7 @@ public final class ArrayUtil {
 
   public static long[] shrink(long[] array, int targetSize) {
     assert targetSize >= 0: "size must be positive (got " + targetSize + "): likely integer overflow?";
-    final int newSize = getShrinkSize(array.length, targetSize, RamUsageEstimator.NUM_BYTES_LONG);
+    final int newSize = getShrinkSize(array.length, targetSize, Long.BYTES);
     if (newSize != array.length) {
       long[] newArray = new long[newSize];
       System.arraycopy(array, 0, newArray, 0, newSize);
@@ -401,7 +400,7 @@ public final class ArrayUtil {
   public static char[] grow(char[] array, int minSize) {
     assert minSize >= 0: "size must be positive (got " + minSize + "): likely integer overflow?";
     if (array.length < minSize) {
-      char[] newArray = new char[oversize(minSize, RamUsageEstimator.NUM_BYTES_CHAR)];
+      char[] newArray = new char[oversize(minSize, Character.BYTES)];
       System.arraycopy(array, 0, newArray, 0, array.length);
       return newArray;
     } else
@@ -414,7 +413,7 @@ public final class ArrayUtil {
 
   public static char[] shrink(char[] array, int targetSize) {
     assert targetSize >= 0: "size must be positive (got " + targetSize + "): likely integer overflow?";
-    final int newSize = getShrinkSize(array.length, targetSize, RamUsageEstimator.NUM_BYTES_CHAR);
+    final int newSize = getShrinkSize(array.length, targetSize, Character.BYTES);
     if (newSize != array.length) {
       char[] newArray = new char[newSize];
       System.arraycopy(array, 0, newArray, 0, newSize);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/BytesRefArray.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/BytesRefArray.java b/lucene/core/src/java/org/apache/lucene/util/BytesRefArray.java
index d7394c7..47ca52b 100644
--- a/lucene/core/src/java/org/apache/lucene/util/BytesRefArray.java
+++ b/lucene/core/src/java/org/apache/lucene/util/BytesRefArray.java
@@ -51,8 +51,7 @@ public final class BytesRefArray {
     this.pool = new ByteBlockPool(new ByteBlockPool.DirectTrackingAllocator(
         bytesUsed));
     pool.nextBuffer();
-    bytesUsed.addAndGet(RamUsageEstimator.NUM_BYTES_ARRAY_HEADER
-        + RamUsageEstimator.NUM_BYTES_INT);
+    bytesUsed.addAndGet(RamUsageEstimator.NUM_BYTES_ARRAY_HEADER * Integer.BYTES);
     this.bytesUsed = bytesUsed;
   }
  
@@ -75,8 +74,7 @@ public final class BytesRefArray {
     if (lastElement >= offsets.length) {
       int oldLen = offsets.length;
       offsets = ArrayUtil.grow(offsets, offsets.length + 1);
-      bytesUsed.addAndGet((offsets.length - oldLen)
-          * RamUsageEstimator.NUM_BYTES_INT);
+      bytesUsed.addAndGet((offsets.length - oldLen) * Integer.BYTES);
     }
     pool.append(bytes);
     offsets[lastElement++] = currentOffset;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java b/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java
index 149e8b7..25b74a6 100644
--- a/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java
+++ b/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java
@@ -90,7 +90,7 @@ public final class BytesRefHash {
     this.bytesStartArray = bytesStartArray;
     bytesStart = bytesStartArray.init();
     bytesUsed = bytesStartArray.bytesUsed() == null? Counter.newCounter() : bytesStartArray.bytesUsed();
-    bytesUsed.addAndGet(hashSize * RamUsageEstimator.NUM_BYTES_INT);
+    bytesUsed.addAndGet(hashSize * Integer.BYTES);
   }
 
   /**
@@ -213,7 +213,7 @@ public final class BytesRefHash {
       newSize /= 2;
     }
     if (newSize != hashSize) {
-      bytesUsed.addAndGet(RamUsageEstimator.NUM_BYTES_INT * -(hashSize - newSize));
+      bytesUsed.addAndGet(Integer.BYTES * -(hashSize - newSize));
       hashSize = newSize;
       ids = new int[hashSize];
       Arrays.fill(ids, -1);
@@ -252,7 +252,7 @@ public final class BytesRefHash {
   public void close() {
     clear(true);
     ids = null;
-    bytesUsed.addAndGet(RamUsageEstimator.NUM_BYTES_INT * -hashSize);
+    bytesUsed.addAndGet(Integer.BYTES * -hashSize);
   }
 
   /**
@@ -408,7 +408,7 @@ public final class BytesRefHash {
    */
   private void rehash(final int newSize, boolean hashOnData) {
     final int newMask = newSize - 1;
-    bytesUsed.addAndGet(RamUsageEstimator.NUM_BYTES_INT * (newSize));
+    bytesUsed.addAndGet(Integer.BYTES * (newSize));
     final int[] newHash = new int[newSize];
     Arrays.fill(newHash, -1);
     for (int i = 0; i < hashSize; i++) {
@@ -449,7 +449,7 @@ public final class BytesRefHash {
     }
 
     hashMask = newMask;
-    bytesUsed.addAndGet(RamUsageEstimator.NUM_BYTES_INT * (-ids.length));
+    bytesUsed.addAndGet(Integer.BYTES * (-ids.length));
     ids = newHash;
     hashSize = newSize;
     hashHalfSize = newSize / 2;
@@ -472,7 +472,7 @@ public final class BytesRefHash {
     
     if (ids == null) {
       ids = new int[hashSize];
-      bytesUsed.addAndGet(RamUsageEstimator.NUM_BYTES_INT * hashSize);
+      bytesUsed.addAndGet(Integer.BYTES * hashSize);
     }
   }
 
@@ -570,8 +570,7 @@ public final class BytesRefHash {
 
     @Override
     public int[] init() {
-      return bytesStart = new int[ArrayUtil.oversize(initSize,
-          RamUsageEstimator.NUM_BYTES_INT)];
+      return bytesStart = new int[ArrayUtil.oversize(initSize, Integer.BYTES)];
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/DocIdSetBuilder.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/DocIdSetBuilder.java b/lucene/core/src/java/org/apache/lucene/util/DocIdSetBuilder.java
index 31a9762..e8b8b98 100644
--- a/lucene/core/src/java/org/apache/lucene/util/DocIdSetBuilder.java
+++ b/lucene/core/src/java/org/apache/lucene/util/DocIdSetBuilder.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.util;
 
-
 import java.io.IOException;
 
 import org.apache.lucene.search.DocIdSet;
@@ -68,7 +67,7 @@ public final class DocIdSetBuilder {
   private void growBuffer(int minSize) {
     assert minSize < threshold;
     if (buffer.length < minSize) {
-      int nextSize = Math.min(threshold, ArrayUtil.oversize(minSize, RamUsageEstimator.NUM_BYTES_INT));
+      int nextSize = Math.min(threshold, ArrayUtil.oversize(minSize, Integer.BYTES));
       int[] newBuffer = new int[nextSize];
       System.arraycopy(buffer, 0, newBuffer, 0, buffer.length);
       buffer = newBuffer;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca1a19b/lucene/core/src/java/org/apache/lucene/util/NumericUtils.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/NumericUtils.java b/lucene/core/src/java/org/apache/lucene/util/NumericUtils.java
index b66f468..58e25f3 100644
--- a/lucene/core/src/java/org/apache/lucene/util/NumericUtils.java
+++ b/lucene/core/src/java/org/apache/lucene/util/NumericUtils.java
@@ -155,16 +155,15 @@ public final class NumericUtils {
     return true;
   }
 
-  public static void intToBytes(int x, byte[] dest, int index) {
+  public static void intToBytes(int x, byte[] dest, int offset) {
     // Flip the sign bit, so negative ints sort before positive ints correctly:
     x ^= 0x80000000;
-    intToBytesDirect(x, dest, index);
+    intToBytesDirect(x, dest, offset);
   }
 
-  public static void intToBytesDirect(int x, byte[] dest, int index) {
-    // Flip the sign bit, so negative ints sort before positive ints correctly:
-    for(int i=0;i<4;i++) {
-      dest[4*index+i] = (byte) (x >> 24-i*8);
+  public static void intToBytesDirect(int x, byte[] dest, int offset) {
+    for (int i = 0; i < 4; i++) {
+      dest[offset+i] = (byte) (x >> 24-i*8);
     }
   }
 
@@ -174,22 +173,21 @@ public final class NumericUtils {
     return x ^ 0x80000000;
   }
 
-  public static int bytesToIntDirect(byte[] src, int index) {
+  public static int bytesToIntDirect(byte[] src, int offset) {
     int x = 0;
-    for(int i=0;i<4;i++) {
-      x |= (src[4*index+i] & 0xff) << (24-i*8);
+    for (int i = 0; i < 4; i++) {
+      x |= (src[offset+i] & 0xff) << (24-i*8);
     }
     return x;
   }
 
-  public static void longToBytes(long v, byte[] bytes, int dim) {
+  public static void longToBytes(long v, byte[] bytes, int offset) {
     // Flip the sign bit so negative longs sort before positive longs:
     v ^= 0x8000000000000000L;
-    longToBytesDirect(v, bytes, dim);
+    longToBytesDirect(v, bytes, offset);
   }
 
-  public static void longToBytesDirect(long v, byte[] bytes, int dim) {
-    int offset = 8 * dim;
+  public static void longToBytesDirect(long v, byte[] bytes, int offset) {
     bytes[offset] = (byte) (v >> 56);
     bytes[offset+1] = (byte) (v >> 48);
     bytes[offset+2] = (byte) (v >> 40);
@@ -200,15 +198,14 @@ public final class NumericUtils {
     bytes[offset+7] = (byte) v;
   }
 
-  public static long bytesToLong(byte[] bytes, int index) {
-    long v = bytesToLongDirect(bytes, index);
+  public static long bytesToLong(byte[] bytes, int offset) {
+    long v = bytesToLongDirect(bytes, offset);
     // Flip the sign bit back
     v ^= 0x8000000000000000L;
     return v;
   }
 
-  public static long bytesToLongDirect(byte[] bytes, int index) {
-    int offset = 8 * index;
+  public static long bytesToLongDirect(byte[] bytes, int offset) {
     long v = ((bytes[offset] & 0xffL) << 56) |
       ((bytes[offset+1] & 0xffL) << 48) |
       ((bytes[offset+2] & 0xffL) << 40) |


[42/53] [abbrv] lucene-solr git commit: SOLR-8377 removed an unnecessary for loop

Posted by no...@apache.org.
SOLR-8377 removed an unnecessary for loop


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/eb1f8e24
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/eb1f8e24
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/eb1f8e24

Branch: refs/heads/apiv2
Commit: eb1f8e2409c56a915bf8b88c19b7f6f66823a7f9
Parents: 261681c
Author: Noble Paul <no...@apache.org>
Authored: Tue Feb 23 06:12:33 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Tue Feb 23 06:12:33 2016 +0530

----------------------------------------------------------------------
 .../apache/solr/cloud/rule/ReplicaAssigner.java | 22 +++++++++-----------
 1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/eb1f8e24/solr/core/src/java/org/apache/solr/cloud/rule/ReplicaAssigner.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/rule/ReplicaAssigner.java b/solr/core/src/java/org/apache/solr/cloud/rule/ReplicaAssigner.java
index f3f5b41..51d9848 100644
--- a/solr/core/src/java/org/apache/solr/cloud/rule/ReplicaAssigner.java
+++ b/solr/core/src/java/org/apache/solr/cloud/rule/ReplicaAssigner.java
@@ -189,20 +189,18 @@ public class ReplicaAssigner {
 
     for (; shardPermutations.hasNext(); ) {
       int[] p = shardPermutations.next();
-      for (int i = 0; i < p.length; i++) {
-        List<Position> positions = new ArrayList<>();
-        for (int pos : p) {
-          for (int j = 0; j < shardVsReplicaCount.get(shardNames.get(pos)); j++) {
-            positions.add(new Position(shardNames.get(pos), j));
-          }
-        }
-        Collections.sort(positions);
-        for (Iterator<int[]> it = permutations(rules.size()); it.hasNext(); ) {
-          int[] permutation = it.next();
-          Map<Position, String> result = tryAPermutationOfRules(permutation, positions, fuzzyPhase);
-          if (result != null) return result;
+      List<Position> positions = new ArrayList<>();
+      for (int pos : p) {
+        for (int j = 0; j < shardVsReplicaCount.get(shardNames.get(pos)); j++) {
+          positions.add(new Position(shardNames.get(pos), j));
         }
       }
+      Collections.sort(positions);
+      for (Iterator<int[]> it = permutations(rules.size()); it.hasNext(); ) {
+        int[] permutation = it.next();
+        Map<Position, String> result = tryAPermutationOfRules(permutation, positions, fuzzyPhase);
+        if (result != null) return result;
+      }
     }
 
     return null;


[25/53] [abbrv] lucene-solr git commit: Update reference to Unicode version of Java 9

Posted by no...@apache.org.
Update reference to Unicode version of Java 9


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/da28b989
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/da28b989
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/da28b989

Branch: refs/heads/apiv2
Commit: da28b98920f74cd27df31dca2a026edf652bdff0
Parents: 3d34728
Author: Uwe Schindler <us...@apache.org>
Authored: Sun Feb 21 16:55:20 2016 +0100
Committer: Uwe Schindler <us...@apache.org>
Committed: Sun Feb 21 16:55:20 2016 +0100

----------------------------------------------------------------------
 lucene/JRE_VERSION_MIGRATION.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/da28b989/lucene/JRE_VERSION_MIGRATION.txt
----------------------------------------------------------------------
diff --git a/lucene/JRE_VERSION_MIGRATION.txt b/lucene/JRE_VERSION_MIGRATION.txt
index 6face9e..c840464 100644
--- a/lucene/JRE_VERSION_MIGRATION.txt
+++ b/lucene/JRE_VERSION_MIGRATION.txt
@@ -17,7 +17,7 @@ For reference, JRE major versions with their corresponding Unicode versions:
  * Java 6, Unicode 4.0
  * Java 7, Unicode 6.0
  * Java 8, Unicode 6.2
- * Java 9 (not yet released / offcially supported by Lucene), Unicode 7.0
+ * Java 9 (not yet released / offcially supported by Lucene), Unicode 8.0
 
 In general, whether or not you need to re-index largely depends upon the data that
 you are searching, and what was changed in any given Unicode version. For example, 


[50/53] [abbrv] lucene-solr git commit: SOLR-8698: params.json can now have appends and invariants as well. 'useParams' specified in the requestHandler is always applied

Posted by no...@apache.org.
SOLR-8698: params.json can now have appends and invariants as well. 'useParams' specified in the requestHandler is always applied


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9ce2d0d2
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9ce2d0d2
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9ce2d0d2

Branch: refs/heads/apiv2
Commit: 9ce2d0d25df7d619ef9ea16a8b5e7f5341d3fc71
Parents: a33236a
Author: Noble Paul <no...@apache.org>
Authored: Tue Feb 23 17:40:49 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Tue Feb 23 17:40:49 2016 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                |   5 +
 .../org/apache/solr/core/RequestParams.java     | 126 +++++++++++++------
 .../apache/solr/handler/SolrConfigHandler.java  |  24 ++--
 .../org/apache/solr/util/SolrPluginUtils.java   |  74 +++++++----
 .../solr/core/BlobStoreTestRequestHandler.java  |  16 +--
 .../apache/solr/core/TestSolrConfigHandler.java |   2 +-
 .../apache/solr/handler/TestReqParamsAPI.java   |  36 +++++-
 .../handler/TestSolrConfigHandlerCloud.java     |   7 +-
 8 files changed, 204 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ce2d0d2/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 525e8d5..65820f1 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -78,6 +78,8 @@ Upgrading from Solr 5.x
 * SolrIndexSearcher.QueryCommand and QueryResult were moved to their own classes. If you reference them
   in your code, you should import them under o.a.s.search (or use your IDE's "Organize Imports").
 
+* SOLR-8698: 'useParams' attribute specified in request handler cannot be overridden from request params
+
 Detailed Change List
 ----------------------
 
@@ -155,6 +157,9 @@ New Features
 
 * SOLR-8522: Make it possible to use ip fragments in replica placement rules , such as ip_1, ip_2 etc (Arcadius Ahouansou, noble)
 
+* SOLR-8698: params.json can now specify 'appends' and 'invariants' (noble)
+
+
 Bug Fixes
 ----------------------
 * SOLR-8386: Add field option in the new admin UI schema page loads up even when no schemaFactory has been

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ce2d0d2/solr/core/src/java/org/apache/solr/core/RequestParams.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/RequestParams.java b/solr/core/src/java/org/apache/solr/core/RequestParams.java
index d27a1c6..6712106 100644
--- a/solr/core/src/java/org/apache/solr/core/RequestParams.java
+++ b/solr/core/src/java/org/apache/solr/core/RequestParams.java
@@ -26,6 +26,7 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.ImmutableMap;
 import org.apache.solr.cloud.ZkSolrResourceLoader;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.MapSolrParams;
@@ -37,6 +38,9 @@ import org.noggit.ObjectBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static java.util.Collections.singletonMap;
+import static org.apache.solr.common.util.Utils.getDeepCopy;
+
 /**
  * The class encapsulates the request time parameters . This is immutable and any changes performed
  * returns a copy of the Object with the changed values
@@ -45,7 +49,7 @@ public class RequestParams implements MapSerializable {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private final Map data;
-  private final Map<String, VersionedParams> paramsets = new LinkedHashMap<>();
+  private final Map<String, ParamSet> paramsets = new LinkedHashMap<>();
   private final int znodeVersion;
 
   public RequestParams(Map data, int znodeVersion) {
@@ -57,15 +61,28 @@ public class RequestParams implements MapSerializable {
         Map.Entry e = (Map.Entry) o;
         if (e.getValue() instanceof Map) {
           Map value = (Map) e.getValue();
-          Map copy = getMapCopy(value);
-          Map meta = (Map) copy.remove("");
-          this.paramsets.put((String) e.getKey(), new VersionedParams(Collections.unmodifiableMap(copy), meta));
+          this.paramsets.put((String) e.getKey(), createParamSet(value, 0l));
         }
       }
     }
     this.znodeVersion = znodeVersion;
   }
 
+  public static ParamSet createParamSet(Map map, Long version) {
+    Map copy = getDeepCopy(map, 3);
+    Map meta = (Map) copy.remove("");
+    if (meta == null && version != null) {
+      meta = Collections.singletonMap("v", version);
+    }
+    Map invariants = (Map) copy.remove(INVARIANTS);
+    Map appends = (Map) copy.remove(APPENDS);
+    return new ParamSet(copy, invariants, appends, meta);
+  }
+
+  /**
+   * This converts Lists to arrays of strings. Because Solr expects
+   * params to be String[]
+   */
   private static Map getMapCopy(Map value) {
     Map copy = new LinkedHashMap<>();
     for (Object o1 : value.entrySet()) {
@@ -92,10 +109,15 @@ public class RequestParams implements MapSerializable {
     return copy;
   }
 
-  public VersionedParams getParams(String name) {
+  public ParamSet getParams(String name) {
     return paramsets.get(name);
   }
 
+  public VersionedParams getParams(String name, String type) {
+    ParamSet paramSet = paramsets.get(name);
+    return paramSet == null ? null : paramSet.getParams(type);
+  }
+
   public int getZnodeVersion() {
     return znodeVersion;
   }
@@ -112,32 +134,12 @@ public class RequestParams implements MapSerializable {
     return result;
   }
 
-  public RequestParams setParams(String name, Map values) {
-    Map deepCopy = Utils.getDeepCopy(data, 3);
+  public RequestParams setParams(String name, ParamSet paramSet) {
+    Map deepCopy = getDeepCopy(data, 3);
     Map p = (Map) deepCopy.get(NAME);
     if (p == null) deepCopy.put(NAME, p = new LinkedHashMap());
-    if (values == null) {
-      p.remove(name);
-    } else {
-      Map old = (Map) p.get(name);
-      long version = 0;
-      Map meta = null;
-      if (old != null) {
-        meta = (Map) old.get("");
-        if (meta != null) {
-          Long oldVersion = (Long) old.get("v");
-          if (oldVersion != null) version = oldVersion.longValue() + 1;
-        }
-        meta = new LinkedHashMap<>(meta);
-      } else {
-        meta = new LinkedHashMap<>();
-      }
-
-      meta.put("v", version);
-      values = new LinkedHashMap<>(values);
-      values.put("", meta);
-      p.put(name, values);
-    }
+    if (paramSet == null) p.remove(name);
+    else p.put(name, paramSet.toMap());
     return new RequestParams(deepCopy, znodeVersion);
   }
 
@@ -146,7 +148,7 @@ public class RequestParams implements MapSerializable {
       ZkSolrResourceLoader resourceLoader = (ZkSolrResourceLoader) loader;
       try {
         Stat stat = resourceLoader.getZkController().getZkClient().exists(resourceLoader.getConfigSetZkPath() + "/" + RequestParams.RESOURCE, null, true);
-        log.debug("latest version of {} in ZK  is : {}", resourceLoader.getConfigSetZkPath() + "/" + RequestParams.RESOURCE, stat == null ? "": stat.getVersion());
+        log.debug("latest version of {} in ZK  is : {}", resourceLoader.getConfigSetZkPath() + "/" + RequestParams.RESOURCE, stat == null ? "" : stat.getVersion());
         if (stat == null) {
           requestParams = new RequestParams(Collections.EMPTY_MAP, -1);
         } else if (requestParams == null || stat.getVersion() > requestParams.getZnodeVersion()) {
@@ -199,22 +201,70 @@ public class RequestParams implements MapSerializable {
   public static final String USEPARAM = "useParams";
   public static final String NAME = "params";
   public static final String RESOURCE = "params.json";
+  public static final String APPENDS = "_appends_";
+  public static final String INVARIANTS = "_invariants_";
 
-  public static class VersionedParams extends MapSolrParams {
-    Map meta;
+  public static class ParamSet implements MapSerializable {
+    private final Map defaults, appends, invariants;
+    Map<String, VersionedParams> paramsMap;
+    public final Map meta;
 
-    public VersionedParams(Map<String, String> map, Map meta) {
-      super(map);
+    ParamSet(Map defaults, Map invariants, Map appends, Map meta) {
+      this.defaults = defaults;
+      this.invariants = invariants;
+      this.appends = appends;
+      ImmutableMap.Builder<String, VersionedParams> builder = ImmutableMap.<String, VersionedParams>builder().put(PluginInfo.DEFAULTS,
+          new VersionedParams(defaults, this));
+      if (appends != null) builder.put(PluginInfo.APPENDS, new VersionedParams(appends, this));
+      if (invariants != null) builder.put(PluginInfo.INVARIANTS, new VersionedParams(invariants, this));
+      paramsMap = builder.build();
       this.meta = meta;
     }
 
-    public Map getRawMap() {
-      return meta;
+    public Long getVersion() {
+      return meta == null ? 0l : (Long) meta.get("v");
+    }
+
+    @Override
+    public Map<String, Object> toMap() {
+      LinkedHashMap result = new LinkedHashMap();
+      result.putAll(defaults);
+      if (appends != null) result.put(APPENDS, appends);
+      if (invariants != null) result.put(INVARIANTS, invariants);
+      if(meta != null) result.put("", meta);
+      return result;
     }
 
 
-    public Long getVersion() {
-      return meta == null ? 0l : (Long) meta.get("v");
+    public ParamSet update(Map map) {
+      ParamSet p = createParamSet(map, null);
+      return new ParamSet(
+          mergeMaps(getDeepCopy(defaults, 2), p.defaults),
+          mergeMaps(getDeepCopy(invariants, 2), p.invariants),
+          mergeMaps(getDeepCopy(appends, 2), p.appends),
+          mergeMaps(getDeepCopy(meta, 2), singletonMap("v", getVersion() + 1))
+      );
+    }
+
+    private static Map mergeMaps(Map m1, Map m2) {
+      if (m1 == null && m2 == null) return null;
+      if (m1 == null) return m2;
+      if (m2 == null) return m1;
+      m1.putAll(m2);
+      return m1;
+    }
+
+    public VersionedParams getParams(String type) {
+      return paramsMap.get(type);
+    }
+  }
+
+  public static class VersionedParams extends MapSolrParams {
+    final ParamSet paramSet;
+
+    public VersionedParams(Map map, ParamSet paramSet) {
+      super(getMapCopy(map));
+      this.paramSet = paramSet;
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ce2d0d2/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
index a566c0e..4a6e553 100644
--- a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
@@ -37,6 +37,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
+import com.google.common.base.Strings;
 import com.google.common.collect.ImmutableSet;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
@@ -74,6 +75,7 @@ import org.apache.solr.util.plugin.SolrCoreAware;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static com.google.common.base.Strings.isNullOrEmpty;
 import static java.util.Collections.singletonList;
 import static org.apache.solr.common.util.Utils.makeMap;
 import static org.apache.solr.common.params.CoreAdminParams.NAME;
@@ -169,11 +171,11 @@ public class SolrConfigHandler extends RequestHandlerBase implements SolrCoreAwa
         } else if (RequestParams.NAME.equals(parts.get(1))) {
           if (parts.size() == 3) {
             RequestParams params = req.getCore().getSolrConfig().getRequestParams();
-            MapSolrParams p = params.getParams(parts.get(2));
+            RequestParams.ParamSet p = params.getParams(parts.get(2));
             Map m = new LinkedHashMap<>();
             m.put(ZNODEVER, params.getZnodeVersion());
             if (p != null) {
-              m.put(RequestParams.NAME, makeMap(parts.get(2), p.getMap()));
+              m.put(RequestParams.NAME, makeMap(parts.get(2), p.toMap()));
             }
             resp.add(SolrQueryResponse.NAME, m);
           } else {
@@ -289,7 +291,7 @@ public class SolrConfigHandler extends RequestHandlerBase implements SolrCoreAwa
 
               Map val = null;
               String key = entry.getKey();
-              if (key == null || key.trim().isEmpty()) {
+              if (isNullOrEmpty(key)) {
                 op.addError("null key ");
                 continue;
               }
@@ -312,13 +314,17 @@ public class SolrConfigHandler extends RequestHandlerBase implements SolrCoreAwa
                 continue;
               }
 
-              MapSolrParams old = params.getParams(key);
+              RequestParams.ParamSet old = params.getParams(key);
               if (op.name.equals(UPDATE)) {
-                LinkedHashMap m = new LinkedHashMap(old.getMap());
-                m.putAll(val);
-                val = m;
+                if (old == null) {
+                  op.addError(formatString("unknown paramset {} cannot update ", key));
+                  continue;
+                }
+                params = params.setParams(key, old.update(val));
+              } else {
+                Long version = old == null ? 0 : old.getVersion() + 1;
+                params = params.setParams(key, RequestParams.createParamSet(val, version));
               }
-              params = params.setParams(key, val);
 
             }
             break;
@@ -350,7 +356,7 @@ public class SolrConfigHandler extends RequestHandlerBase implements SolrCoreAwa
         if (ops.isEmpty()) {
           ZkController.touchConfDir(zkLoader);
         } else {
-          log.info("persisting params version : {}", params.toMap());
+          log.debug("persisting params version : {}", Utils.toJSONString(params.toMap()));
           int latestVersion = ZkController.persistConfigResourceToZooKeeper(zkLoader,
               params.getZnodeVersion(),
               RequestParams.RESOURCE,

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ce2d0d2/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java b/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java
index debec54..b30cc06 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java
@@ -49,6 +49,7 @@ import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SimpleOrderedMap;
 import org.apache.solr.common.util.StrUtils;
+import org.apache.solr.core.PluginInfo;
 import org.apache.solr.core.RequestParams;
 import org.apache.solr.handler.component.HighlightComponent;
 import org.apache.solr.handler.component.ResponseBuilder;
@@ -80,6 +81,11 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableMap;
 
+import static org.apache.solr.core.PluginInfo.APPENDS;
+import static org.apache.solr.core.PluginInfo.DEFAULTS;
+import static org.apache.solr.core.PluginInfo.INVARIANTS;
+import static org.apache.solr.core.RequestParams.USEPARAM;
+
 /**
  * <p>Utilities that may be of use to RequestHandlers.</p>
  *
@@ -125,7 +131,7 @@ public class SolrPluginUtils {
   }
 
   private static final MapSolrParams maskUseParams = new MapSolrParams(ImmutableMap.<String, String>builder()
-      .put(RequestParams.USEPARAM, "")
+      .put(USEPARAM, "")
       .build());
 
   /**
@@ -145,10 +151,16 @@ public class SolrPluginUtils {
 
   public static void setDefaults(SolrRequestHandler handler, SolrQueryRequest req, SolrParams defaults,
                                  SolrParams appends, SolrParams invariants) {
-
-    List<String> paramNames = null;
-    String useParams = req.getParams().get(RequestParams.USEPARAM);
+    String useParams = (String) req.getContext().get(USEPARAM);
+    if(useParams != null) {
+      RequestParams rp = req.getCore().getSolrConfig().getRequestParams();
+      defaults = applyParamSet(rp, defaults, useParams, DEFAULTS);
+      appends = applyParamSet(rp, appends, useParams, APPENDS);
+      invariants = applyParamSet(rp, invariants, useParams, INVARIANTS);
+    }
+    useParams = req.getParams().get(USEPARAM);
     if (useParams != null && !useParams.isEmpty()) {
+      RequestParams rp = req.getCore().getSolrConfig().getRequestParams();
       // now that we have expanded the request macro useParams with the actual values
       // it makes no sense to keep it visible now on.
       // distrib request sends all params to the nodes down the line and
@@ -157,19 +169,27 @@ public class SolrPluginUtils {
       // value as an empty string to other nodes we get the desired benefit of
       // overriding the useParams specified in the requestHandler directly
       req.setParams(SolrParams.wrapDefaults(maskUseParams, req.getParams()));
+      defaults = applyParamSet(rp, defaults, useParams, DEFAULTS);
+      appends = applyParamSet(rp, appends, useParams, APPENDS);
+      invariants = applyParamSet(rp, invariants, useParams, INVARIANTS);
     }
-    if (useParams == null) useParams = (String) req.getContext().get(RequestParams.USEPARAM);
-    if (useParams != null && !useParams.isEmpty()) paramNames = StrUtils.splitSmart(useParams, ',');
-    if (paramNames != null) {
-      for (String name : paramNames) {
-        SolrParams requestParams = req.getCore().getSolrConfig().getRequestParams().getParams(name);
-        if (requestParams != null) {
-          defaults = SolrParams.wrapDefaults(requestParams, defaults);
-        }
+    RequestUtil.processParams(handler, req, defaults, appends, invariants);
+  }
+
+  private static SolrParams applyParamSet(RequestParams requestParams,
+                                          SolrParams defaults, String paramSets, String type) {
+    if (paramSets == null) return defaults;
+    for (String name : StrUtils.splitSmart(paramSets, ',')) {
+      RequestParams.VersionedParams params = requestParams.getParams(name, type);
+      if (type.equals(DEFAULTS)) {
+        defaults = SolrParams.wrapDefaults(params, defaults);
+      } else if (type.equals(INVARIANTS)) {
+        defaults = SolrParams.wrapAppended(params, defaults);
+      } else {
+        defaults = SolrParams.wrapAppended(params, defaults);
       }
     }
-
-    RequestUtil.processParams(handler, req, defaults, appends, invariants);
+    return defaults;
   }
 
 
@@ -323,14 +343,14 @@ public class SolrPluginUtils {
           DocList results,
           boolean dbgQuery,
           boolean dbgResults)
-          throws IOException 
+          throws IOException
   {
     NamedList dbg = new SimpleOrderedMap();
     doStandardQueryDebug(req, userQuery, query, dbgQuery, dbg);
     doStandardResultsDebug(req, query, results, dbgResults, dbg);
     return dbg;
   }
-  
+
 
   public static void doStandardQueryDebug(
           SolrQueryRequest req,
@@ -352,7 +372,7 @@ public class SolrPluginUtils {
       dbg.add("parsedquery_toString", query.toString());
     }
   }
-  
+
   public static void doStandardResultsDebug(
           SolrQueryRequest req,
           Query query,
@@ -520,7 +540,7 @@ public class SolrPluginUtils {
       if(in.length()==0) {
         continue;
       }
-      
+
       String[] bb = whitespacePattern.split(in);
       for (String s : bb) {
         String[] bbb = caratPattern.split(s);
@@ -530,7 +550,7 @@ public class SolrPluginUtils {
     return out;
   }
   /**
-  
+
   /**
    * Like {@link #parseFieldBoosts}, but allows for an optional slop value prefixed by "~".
    *
@@ -788,10 +808,10 @@ public class SolrPluginUtils {
     }
     return s.toString().replace("\"","");
   }
-  
+
   /**
    * Adds to {@code dest} all the not-null elements of {@code entries} that have non-null names
-   * 
+   *
    * @param entries The array of entries to be added to the {@link NamedList} {@code dest}
    * @param dest The {@link NamedList} instance where the not-null elements of entries are added
    * @return Returns The {@code dest} input object
@@ -883,7 +903,7 @@ public class SolrPluginUtils {
      */
     @Override
     protected Query getFieldQuery(String field, String queryText, boolean quoted)
-      throws SyntaxError {
+        throws SyntaxError {
 
       if (aliases.containsKey(field)) {
 
@@ -1018,7 +1038,7 @@ public class SolrPluginUtils {
 
       Document luceneDoc = searcher.doc(docid, fields);
       SolrDocument doc = new SolrDocument();
-      
+
       for( IndexableField field : luceneDoc) {
         if (null == fields || fields.contains(field.name())) {
           SchemaField sf = schema.getField( field.name() );
@@ -1065,9 +1085,9 @@ public class SolrPluginUtils {
   }
 
    /**
-   * Given the integer purpose of a request generates a readable value corresponding 
-   * the request purposes (there can be more than one on a single request). If 
-   * there is a purpose parameter present that's not known this method will 
+   * Given the integer purpose of a request generates a readable value corresponding
+   * the request purposes (there can be more than one on a single request). If
+   * there is a purpose parameter present that's not known this method will
    * return {@value #UNKNOWN_VALUE}
    * @param reqPurpose Numeric request purpose
    * @return a comma separated list of purposes or {@value #UNKNOWN_VALUE}
@@ -1088,7 +1108,7 @@ public class SolrPluginUtils {
       }
       return UNKNOWN_VALUE;
   }
-  
+
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ce2d0d2/solr/core/src/test/org/apache/solr/core/BlobStoreTestRequestHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/BlobStoreTestRequestHandler.java b/solr/core/src/test/org/apache/solr/core/BlobStoreTestRequestHandler.java
index 893533e..ff5e1cb 100644
--- a/solr/core/src/test/org/apache/solr/core/BlobStoreTestRequestHandler.java
+++ b/solr/core/src/test/org/apache/solr/core/BlobStoreTestRequestHandler.java
@@ -23,31 +23,31 @@ import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.util.plugin.SolrCoreAware;
 
-public class BlobStoreTestRequestHandler extends DumpRequestHandler implements Runnable, SolrCoreAware{
+public class BlobStoreTestRequestHandler extends DumpRequestHandler implements Runnable, SolrCoreAware {
 
   private SolrCore core;
 
-  private long version = 1;
+  private long version = 0;
   private String watchedVal = null;
 
   @Override
   public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
     super.handleRequestBody(req, rsp);
     rsp.add("class", this.getClass().getName());
-    rsp.add("x",watchedVal);
+    rsp.add("x", watchedVal);
   }
 
   @Override
   public void run() {
     RequestParams p = core.getSolrConfig().getRequestParams();
-    RequestParams.VersionedParams v = p.getParams("watched");
-    if(v== null){
+    RequestParams.ParamSet v = p.getParams("watched");
+    if (v == null) {
       watchedVal = null;
-      version=-1;
+      version = -1;
       return;
     }
-    if(v.getVersion() != version){
-      watchedVal =  v.getMap().get("x");
+    if (v.getVersion() != version) {
+      watchedVal = v.getParams(PluginInfo.DEFAULTS).get("x");
     }
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ce2d0d2/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java b/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
index 6aa54da..9f80cbe 100644
--- a/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
+++ b/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java
@@ -585,7 +585,7 @@ public class TestSolrConfigHandler extends RestTestBase {
         "/dump1?wt=json&useParams=y",
         null,
         Arrays.asList("params", "a"),
-        null,
+        "A val",
         5);
 
     TestSolrConfigHandler.testForResponseElement(

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ce2d0d2/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java b/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
index d38122d..a4bc0ea 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
@@ -20,8 +20,8 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Predicate;
 
-import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.cloud.AbstractFullDistribZkTestBase;
@@ -171,6 +171,7 @@ public class TestReqParamsAPI extends AbstractFullDistribZkTestBase {
         "CY val",
         10);
     compareValues(result, 20l, asList("response", "params", "y", "i"));
+    compareValues(result, null, asList("response", "params", "y", "a"));
 
 
     result = TestSolrConfigHandler.testForResponseElement(null,
@@ -181,7 +182,7 @@ public class TestReqParamsAPI extends AbstractFullDistribZkTestBase {
         "CY val",
         5);
     compareValues(result, "BY val", asList("params", "b"));
-    compareValues(result, null, asList("params", "a"));
+    compareValues(result, "A val", asList("params", "a"));
     compareValues(result, Arrays.asList("val 1", "val 2"), asList("params", "d"));
     compareValues(result, "20", asList("params", "i"));
     payload = " {\n" +
@@ -226,6 +227,37 @@ public class TestReqParamsAPI extends AbstractFullDistribZkTestBase {
         "P val",
         10);
     compareValues(result, null, asList("response", "params", "y", "c"));
+    compareValues(result, 2l, asList("response", "params", "y", "","v"));
+    compareValues(result, 0l, asList("response", "params", "x", "","v"));
+
+    payload = "{update :{x : {_appends_ :{ add : 'first' },  _invariants_ : {fixed: f }}}}";
+    TestSolrConfigHandler.runConfigCommand(writeHarness, "/config/params?wt=json", payload);
+
+    result = TestSolrConfigHandler.testForResponseElement(
+        null,
+        urls.get(random().nextInt(urls.size())),
+        "/config/params?wt=json",
+        cloudClient,
+        asList("response", "params", "x", "_appends_", "add"),
+        "first",
+        10);
+    compareValues(result, "f", asList("response", "params", "x", "_invariants_", "fixed"));
+
+
+    result = TestSolrConfigHandler.testForResponseElement(null,
+        urls.get(random().nextInt(urls.size())),
+        "/dump1?wt=json&fixed=changeit&add=second",
+        cloudClient,
+        asList("params", "fixed"),
+        "f",
+        5);
+    compareValues(result, new Predicate() {
+      @Override
+      public boolean test(Object o) {
+        List l = (List) o;
+        return l.contains("first") && l.contains("second");
+      }
+    }, asList("params", "add"));
 
     payload = " {'delete' : 'y'}";
     TestSolrConfigHandler.runConfigCommand(writeHarness, "/config/params?wt=json", payload);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ce2d0d2/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java
index ea6eb52..76ba9c5 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java
@@ -21,6 +21,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.function.Predicate;
 
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
@@ -288,8 +289,12 @@ public class TestSolrConfigHandlerCloud extends AbstractFullDistribZkTestBase {
   }
 
   public static void compareValues(Map result, Object expected, List<String> jsonPath) {
+    Object val = Utils.getObjectByPath(result, false, jsonPath);
     assertTrue(StrUtils.formatString("Could not get expected value  {0} for path {1} full output {2}", expected, jsonPath, getAsString(result)),
-        Objects.equals(expected, Utils.getObjectByPath(result, false, jsonPath)));
+        expected instanceof Predicate ?
+            ((Predicate)expected ).test(val) :
+            Objects.equals(expected, val)
+        );
   }
 
 }


[44/53] [abbrv] lucene-solr git commit: SOLR-8718: Corrects location for note for SOLR-8666 in solr/CHANGES.txt

Posted by no...@apache.org.
SOLR-8718: Corrects location for note for SOLR-8666 in solr/CHANGES.txt


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a7a66637
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a7a66637
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a7a66637

Branch: refs/heads/apiv2
Commit: a7a6663720638c84d409088bfe89cb806c41877d
Parents: 982654b
Author: Dennis Gove <dp...@gmail.com>
Authored: Mon Feb 22 20:39:35 2016 -0500
Committer: Dennis Gove <dp...@gmail.com>
Committed: Mon Feb 22 20:39:35 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a7a66637/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index a85e6fa..a3e59b4 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -149,6 +149,10 @@ New Features
 
 * SOLR-8588: Add TopicStream to the streaming API to support publish/subscribe messaging (Joel Bernstein, Kevin Risden)
 
+* SOLR-8666: Adds header 'zkConnected' to response of SearchHandler and PingRequestHandler to notify the client when
+  a connection to zookeeper has been lost and there is a possibility of stale data on the node the request is coming
+  from. (Keith Laban, Dennis Gove)
+
 Bug Fixes
 ----------------------
 * SOLR-8386: Add field option in the new admin UI schema page loads up even when no schemaFactory has been
@@ -201,10 +205,6 @@ Bug Fixes
 * SOLR-8599: After a failed connection during construction of SolrZkClient attempt to retry until a connection
   can be made. (Keith Laban, Dennis Gove)
 
-* SOLR-8666: Adds header 'zkConnected' to response of SearchHandler and PingRequestHandler to notify the client when
-  a connection to zookeeper has been lost and there is a possibility of stale data on the node the request is coming
-  from. (Keith Laban, Dennis Gove)
-
 Optimizations
 ----------------------
 * SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been


[35/53] [abbrv] lucene-solr git commit: SOLR-8691: Cache index fingerprints per searcher

Posted by no...@apache.org.
SOLR-8691: Cache index fingerprints per searcher


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/12032646
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/12032646
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/12032646

Branch: refs/heads/apiv2
Commit: 12032646406239e3d4afb84652cdbf91d0025ea4
Parents: f47e6b2
Author: yonik <yo...@apache.org>
Authored: Mon Feb 22 13:00:38 2016 -0500
Committer: yonik <yo...@apache.org>
Committed: Mon Feb 22 13:00:38 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                  |  2 ++
 .../org/apache/solr/search/SolrIndexSearcher.java | 18 ++++++++++++++++++
 .../org/apache/solr/update/IndexFingerprint.java  |  5 +++--
 3 files changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/12032646/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f005ae8..866fdde 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -297,6 +297,8 @@ Other Changes
 * SOLR-8690: Make peersync fingerprinting optional with solr.disableFingerprint system
   property. (yonik)
 
+* SOLR-8691: Cache index fingerprints per searcher. (yonik)
+
 ======================= 5.5.0 =======================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/12032646/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
index 8057a97..da0c7bf 100644
--- a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
+++ b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
@@ -123,6 +123,7 @@ import org.apache.solr.schema.TrieFloatField;
 import org.apache.solr.schema.TrieIntField;
 import org.apache.solr.search.facet.UnInvertedField;
 import org.apache.solr.search.stats.StatsSource;
+import org.apache.solr.update.IndexFingerprint;
 import org.apache.solr.update.SolrIndexConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -192,6 +193,9 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
   private final String path;
   private boolean releaseDirectory;
 
+  private volatile IndexFingerprint fingerprint;
+  private final Object fingerprintLock = new Object();
+
   private static DirectoryReader getReader(SolrCore core, SolrIndexConfig config, DirectoryFactory directoryFactory,
       String path) throws IOException {
     final Directory dir = directoryFactory.get(path, DirContext.DEFAULT, config.lockType);
@@ -2398,6 +2402,20 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
     return super.explain(QueryUtils.makeQueryable(query), doc);
   }
 
+  /** @lucene.internal
+   * gets a cached version of the IndexFingerprint for this searcher
+   **/
+  public IndexFingerprint getIndexFingerprint(long maxVersion) throws IOException {
+    // possibly expensive, so prevent more than one thread from calculating it for this searcher
+    synchronized (fingerprintLock) {
+      if (fingerprint == null) {
+        fingerprint = IndexFingerprint.getFingerprint(this, maxVersion);
+      }
+    }
+
+    return fingerprint;
+  }
+
   /////////////////////////////////////////////////////////////////////
   // SolrInfoMBean stuff: Statistics and Module Info
   /////////////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/12032646/solr/core/src/java/org/apache/solr/update/IndexFingerprint.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/IndexFingerprint.java b/solr/core/src/java/org/apache/solr/update/IndexFingerprint.java
index 1ece092..7b8a731 100644
--- a/solr/core/src/java/org/apache/solr/update/IndexFingerprint.java
+++ b/solr/core/src/java/org/apache/solr/update/IndexFingerprint.java
@@ -76,12 +76,12 @@ public class IndexFingerprint {
     return maxDoc;
   }
 
-  /** Opens a new realtime searcher and returns it's fingerprint */
+  /** Opens a new realtime searcher and returns it's (possibly cached) fingerprint */
   public static IndexFingerprint getFingerprint(SolrCore core, long maxVersion) throws IOException {
     core.getUpdateHandler().getUpdateLog().openRealtimeSearcher();
     RefCounted<SolrIndexSearcher> newestSearcher = core.getUpdateHandler().getUpdateLog().uhandler.core.getRealtimeSearcher();
     try {
-      return getFingerprint(newestSearcher.get(), maxVersion);
+      return newestSearcher.get().getIndexFingerprint(maxVersion);
     } finally {
       if (newestSearcher != null) {
         newestSearcher.decref();
@@ -89,6 +89,7 @@ public class IndexFingerprint {
     }
   }
 
+  /** Calculates an index fingerprint */
   public static IndexFingerprint getFingerprint(SolrIndexSearcher searcher, long maxVersion) throws IOException {
     RTimer timer = new RTimer();
 


[16/53] [abbrv] lucene-solr git commit: SOLR-8588: Add TopicStream to the streaming API to support publish/subscribe messaging

Posted by no...@apache.org.
SOLR-8588: Add TopicStream to the streaming API to support publish/subscribe messaging


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b2475bf9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b2475bf9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b2475bf9

Branch: refs/heads/apiv2
Commit: b2475bf9fdc59c02454f730a6cc4916cff03f862
Parents: 3124a4d
Author: jbernste <jb...@apache.org>
Authored: Fri Feb 19 20:03:06 2016 -0500
Committer: jbernste <jb...@apache.org>
Committed: Fri Feb 19 20:03:43 2016 -0500

----------------------------------------------------------------------
 .../org/apache/solr/handler/StreamHandler.java  |  11 +-
 .../solr/client/solrj/io/stream/SolrStream.java |  24 +
 .../client/solrj/io/stream/TopicStream.java     | 463 +++++++++++++++++++
 .../solr/collection1/conf/schema-streaming.xml  |   1 +
 .../solrj/io/stream/StreamExpressionTest.java   | 180 ++++++-
 .../stream/StreamExpressionToExpessionTest.java |  20 +-
 6 files changed, 682 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b2475bf9/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
index de38c9b..113fa93 100644
--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
@@ -107,8 +107,10 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware {
       .withFunctionName("intersect", IntersectStream.class)
       .withFunctionName("complement", ComplementStream.class)
          .withFunctionName("daemon", DaemonStream.class)
-      
-      // metrics
+         .withFunctionName("topic", TopicStream.class)
+
+
+    // metrics
       .withFunctionName("min", MinMetric.class)
       .withFunctionName("max", MaxMetric.class)
       .withFunctionName("avg", MeanMetric.class)
@@ -121,9 +123,8 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware {
       
       // stream reduction operations
       .withFunctionName("group", GroupOperation.class)
-      .withFunctionName("distinct", DistinctOperation.class)
-      ;
-    
+      .withFunctionName("distinct", DistinctOperation.class);
+
     // This pulls all the overrides and additions from the config
     Object functionMappingsObj = initArgs.get("streamFunctions");
     if(null != functionMappingsObj){

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b2475bf9/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java
index abd98c8..1c149cc 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java
@@ -17,6 +17,7 @@
 package org.apache.solr.client.solrj.io.stream;
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.Map;
 import java.util.HashMap;
@@ -29,12 +30,17 @@ import org.apache.solr.client.solrj.io.Tuple;
 import org.apache.solr.client.solrj.io.comp.StreamComparator;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.params.SolrParams;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
 *  Queries a single Solr instance and maps SolrDocs to a Stream of Tuples.
 **/
 
 public class SolrStream extends TupleStream {
 
+  private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
   private static final long serialVersionUID = 1;
 
   private String baseUrl;
@@ -46,6 +52,8 @@ public class SolrStream extends TupleStream {
   private transient JSONTupleStream jsonTupleStream;
   private transient HttpSolrClient client;
   private transient SolrClientCache cache;
+  private String slice;
+  private long checkpoint = -1;
 
   public SolrStream(String baseUrl, Map params) {
     this.baseUrl = baseUrl;
@@ -76,6 +84,7 @@ public class SolrStream extends TupleStream {
 
   public void open() throws IOException {
 
+
     if(cache == null) {
       client = new HttpSolrClient(baseUrl);
     } else {
@@ -97,6 +106,14 @@ public class SolrStream extends TupleStream {
     this.trace = trace;
   }
 
+  public void setSlice(String slice) {
+    this.slice = slice;
+  }
+
+  public void setCheckpoint(long checkpoint) {
+    this.checkpoint = checkpoint;
+  }
+
   private SolrParams loadParams(Map params) throws IOException {
     ModifiableSolrParams solrParams = new ModifiableSolrParams();
     if(params.containsKey("partitionKeys")) {
@@ -110,6 +127,10 @@ public class SolrStream extends TupleStream {
       }
     }
 
+    if(checkpoint > 0) {
+      solrParams.add("fq", "{!frange cost=100 incl=false l="+checkpoint+"}_version_");
+    }
+
     Iterator<Map.Entry> it = params.entrySet().iterator();
     while(it.hasNext()) {
       Map.Entry entry = it.next();
@@ -166,6 +187,9 @@ public class SolrStream extends TupleStream {
 
         if (trace) {
           fields.put("_CORE_", this.baseUrl);
+          if(slice != null) {
+            fields.put("_SLICE_", slice);
+          }
         }
 
         if (fieldMappings != null) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b2475bf9/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java
new file mode 100644
index 0000000..3b7aa90
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java
@@ -0,0 +1,463 @@
+package org.apache.solr.client.solrj.io.stream;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Random;
+import java.util.Set;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TreeSet;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.io.Tuple;
+import org.apache.solr.client.solrj.io.comp.ComparatorOrder;
+import org.apache.solr.client.solrj.io.comp.FieldComparator;
+import org.apache.solr.client.solrj.io.stream.expr.Expressible;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpression;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionNamedParameter;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionParameter;
+import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionValue;
+import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
+import org.apache.solr.client.solrj.request.UpdateRequest;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.cloud.ClusterState;
+import org.apache.solr.common.cloud.Slice;
+import org.apache.solr.common.cloud.Replica;
+import org.apache.solr.common.cloud.ZkCoreNodeProps;
+import org.apache.solr.common.cloud.ZkStateReader;
+import org.apache.solr.common.util.ExecutorUtil;
+import org.apache.solr.common.util.SolrjNamedThreadFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TopicStream extends CloudSolrStream implements Expressible  {
+
+  private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+
+  private static final long serialVersionUID = 1;
+
+  private long count;
+  private String id;
+  protected long checkpointEvery;
+
+  private Map<String, Long> checkpoints = new HashMap();
+  private String checkpointCollection;
+
+  public TopicStream(String zkHost,
+                     String checkpointCollection,
+                     String collection,
+                     String id,
+                     long checkpointEvery,
+                     Map<String, String> params) {
+    init(zkHost,
+         checkpointCollection,
+         collection,
+         id,
+         checkpointEvery,
+         params);
+  }
+
+  private void init(String zkHost,
+                    String checkpointCollection,
+                    String collection,
+                    String id,
+                    long checkpointEvery,
+                    Map<String, String> params) {
+    this.zkHost  = zkHost;
+    this.params  = params;
+    this.collection = collection;
+    this.checkpointCollection = checkpointCollection;
+    this.checkpointEvery = checkpointEvery;
+    this.id = id;
+    this.comp = new FieldComparator("_version_", ComparatorOrder.ASCENDING);
+  }
+
+  public TopicStream(StreamExpression expression, StreamFactory factory) throws IOException{
+    // grab all parameters out
+    String checkpointCollectionName = factory.getValueOperand(expression, 0);
+    String collectionName = factory.getValueOperand(expression, 1);
+    List<StreamExpressionNamedParameter> namedParams = factory.getNamedOperands(expression);
+    StreamExpressionNamedParameter zkHostExpression = factory.getNamedOperand(expression, "zkHost");
+
+    StreamExpressionNamedParameter idParam = factory.getNamedOperand(expression, "id");
+    if(null == idParam) {
+      throw new IOException("invalid TopicStream id cannot be null");
+    }
+
+    StreamExpressionNamedParameter flParam = factory.getNamedOperand(expression, "fl");
+
+    if(null == flParam) {
+      throw new IOException("invalid TopicStream fl cannot be null");
+    }
+
+    long checkpointEvery = -1;
+    StreamExpressionNamedParameter checkpointEveryParam = factory.getNamedOperand(expression, "checkpointEvery");
+
+    if(checkpointEveryParam != null) {
+      checkpointEvery = Long.parseLong(((StreamExpressionValue) checkpointEveryParam.getParameter()).getValue());
+    }
+
+    //  Checkpoint Collection Name
+    if(null == checkpointCollectionName){
+      throw new IOException(String.format(Locale.ROOT,"invalid expression %s - checkpointCollectionName expected as first operand",expression));
+    }
+
+    // Collection Name
+    if(null == collectionName){
+      throw new IOException(String.format(Locale.ROOT,"invalid expression %s - collectionName expected as second operand",expression));
+    }
+
+    // Named parameters - passed directly to solr as solrparams
+    if(0 == namedParams.size()){
+      throw new IOException(String.format(Locale.ROOT,"invalid expression %s - at least one named parameter expected. eg. 'q=*:*'",expression));
+    }
+
+    Map<String,String> params = new HashMap<String,String>();
+    for(StreamExpressionNamedParameter namedParam : namedParams){
+      if(!namedParam.getName().equals("zkHost") &&
+          !namedParam.getName().equals("id") &&
+          !namedParam.getName().equals("checkpointEvery")) {
+        params.put(namedParam.getName(), namedParam.getParameter().toString().trim());
+      }
+    }
+
+    // zkHost, optional - if not provided then will look into factory list to get
+    String zkHost = null;
+    if(null == zkHostExpression){
+      zkHost = factory.getCollectionZkHost(collectionName);
+      if(zkHost == null) {
+        zkHost = factory.getDefaultZkHost();
+      }
+    }
+    else if(zkHostExpression.getParameter() instanceof StreamExpressionValue){
+      zkHost = ((StreamExpressionValue)zkHostExpression.getParameter()).getValue();
+    }
+    if(null == zkHost){
+      throw new IOException(String.format(Locale.ROOT,"invalid expression %s - zkHost not found for collection '%s'",expression,collectionName));
+    }
+
+    // We've got all the required items
+    init(zkHost,
+        checkpointCollectionName,
+        collectionName,
+        ((StreamExpressionValue) idParam.getParameter()).getValue(),
+        checkpointEvery,
+        params);
+  }
+
+  @Override
+  public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException {
+    // function name
+    StreamExpression expression = new StreamExpression(factory.getFunctionName(this.getClass()));
+
+    expression.addParameter(checkpointCollection);
+    // collection
+    expression.addParameter(collection);
+
+    for(Entry<String,String> param : params.entrySet()) {
+      String value = param.getValue();
+
+      // SOLR-8409: This is a special case where the params contain a " character
+      // Do note that in any other BASE streams with parameters where a " might come into play
+      // that this same replacement needs to take place.
+      value = value.replace("\"", "\\\"");
+
+      expression.addParameter(new StreamExpressionNamedParameter(param.getKey(), value));
+    }
+
+    // zkHost
+    expression.addParameter(new StreamExpressionNamedParameter("zkHost", zkHost));
+    expression.addParameter(new StreamExpressionNamedParameter("id", id));
+    expression.addParameter(new StreamExpressionNamedParameter("checkpointEvery", Long.toString(checkpointEvery)));
+
+    return expression;
+  }
+
+  public List<TupleStream> children() {
+    List<TupleStream> l =  new ArrayList();
+    return l;
+  }
+
+  public void open() throws IOException {
+    this.tuples = new TreeSet();
+    this.solrStreams = new ArrayList();
+    this.eofTuples = Collections.synchronizedMap(new HashMap());
+
+    if(cache != null) {
+      cloudSolrClient = cache.getCloudSolrClient(zkHost);
+    } else {
+      cloudSolrClient = new CloudSolrClient(zkHost);
+      this.cloudSolrClient.connect();
+    }
+
+    if(checkpoints.size() == 0) {
+      getPersistedCheckpoints();
+      if(checkpoints.size() == 0) {
+        getCheckpoints();
+      }
+    }
+
+    constructStreams();
+    openStreams();
+  }
+
+
+  private void openStreams() throws IOException {
+
+    ExecutorService service = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("TopicStream"));
+    try {
+      List<Future<TupleWrapper>> futures = new ArrayList();
+      for (TupleStream solrStream : solrStreams) {
+        StreamOpener so = new StreamOpener((SolrStream) solrStream, comp);
+        Future<TupleWrapper> future = service.submit(so);
+        futures.add(future);
+      }
+
+      try {
+        for (Future<TupleWrapper> f : futures) {
+          TupleWrapper w = f.get();
+          if (w != null) {
+            tuples.add(w);
+          }
+        }
+      } catch (Exception e) {
+        throw new IOException(e);
+      }
+    } finally {
+      service.shutdown();
+    }
+  }
+
+  public void close() throws IOException {
+    try {
+      persistCheckpoints();
+    } finally {
+
+      if(solrStreams != null) {
+        for (TupleStream solrStream : solrStreams) {
+          solrStream.close();
+        }
+      }
+
+      if (cache == null) {
+        cloudSolrClient.close();
+      }
+    }
+  }
+
+  public Tuple read() throws IOException {
+    Tuple tuple = _read();
+
+    if(tuple.EOF) {
+      return tuple;
+    }
+
+    ++count;
+    if(checkpointEvery > -1 && (count % checkpointEvery) == 0) {
+      persistCheckpoints();
+    }
+
+    long version = tuple.getLong("_version_");
+    String slice = tuple.getString("_SLICE_");
+    checkpoints.put(slice, version);
+
+    tuple.remove("_SLICE_");
+    tuple.remove("_CORE_");
+
+    return tuple;
+  }
+
+  public int getCost() {
+    return 0;
+  }
+
+  private void getCheckpoints() throws IOException {
+    this.checkpoints = new HashMap();
+    ZkStateReader zkStateReader = cloudSolrClient.getZkStateReader();
+    ClusterState clusterState = zkStateReader.getClusterState();
+    Collection<Slice> slices = clusterState.getActiveSlices(collection);
+
+    for(Slice slice : slices) {
+      String sliceName = slice.getName();
+      long checkpoint = getCheckpoint(slice, clusterState.getLiveNodes());
+      this.checkpoints.put(sliceName, checkpoint);
+    }
+  }
+
+  //Gets the highest version number for the slice.
+  private long getCheckpoint(Slice slice, Set<String> liveNodes) throws IOException {
+    Collection<Replica> replicas = slice.getReplicas();
+    long checkpoint = -1;
+    Map params = new HashMap();
+    params.put("q","*:*");
+    params.put("sort", "_version_ desc");
+    params.put("distrib", "false");
+    params.put("rows", 1);
+    for(Replica replica : replicas) {
+      if(replica.getState() == Replica.State.ACTIVE && liveNodes.contains(replica.getNodeName())) {
+        String coreUrl = replica.getCoreUrl();
+        SolrStream solrStream = new SolrStream(coreUrl, params);
+
+        if(streamContext != null) {
+          solrStream.setStreamContext(streamContext);
+        }
+
+        try {
+          solrStream.open();
+          Tuple tuple = solrStream.read();
+          if(tuple.EOF) {
+            return 0;
+          } else {
+            checkpoint = tuple.getLong("_version_");
+          }
+          break;
+        } finally {
+          solrStream.close();
+        }
+      }
+    }
+    return checkpoint;
+  }
+
+  private void persistCheckpoints() throws IOException{
+
+    UpdateRequest request = new UpdateRequest();
+    request.setParam("collection", checkpointCollection);
+    SolrInputDocument doc = new SolrInputDocument();
+    doc.addField("id", id);
+
+    for(Map.Entry<String, Long> entry : checkpoints.entrySet()) {
+      doc.addField("checkpoint_ss", entry.getKey()+"~"+entry.getValue());
+    }
+
+    request.add(doc);
+    try {
+      cloudSolrClient.request(request);
+    } catch (Exception e) {
+      throw new IOException(e);
+    }
+  }
+
+  private void getPersistedCheckpoints() throws IOException {
+
+    ZkStateReader zkStateReader = cloudSolrClient.getZkStateReader();
+    ClusterState clusterState = zkStateReader.getClusterState();
+    Collection<Slice> slices = clusterState.getActiveSlices(checkpointCollection);
+    Set<String> liveNodes = clusterState.getLiveNodes();
+    OUTER:
+    for(Slice slice : slices) {
+      Collection<Replica> replicas = slice.getReplicas();
+      for(Replica replica : replicas) {
+        if(replica.getState() == Replica.State.ACTIVE && liveNodes.contains(replica.getNodeName())){
+
+
+          HttpSolrClient httpClient = cache.getHttpSolrClient(replica.getCoreUrl());
+          try {
+
+            SolrDocument doc = httpClient.getById(id);
+            if(doc != null) {
+              List<String> checkpoints = (List<String>)doc.getFieldValue("checkpoint_ss");
+              for (String checkpoint : checkpoints) {
+                String[] pair = checkpoint.split("~");
+                this.checkpoints.put(pair[0], Long.parseLong(pair[1]));
+              }
+            }
+          }catch (Exception e) {
+            throw new IOException(e);
+          }
+          break OUTER;
+        }
+      }
+    }
+  }
+
+  protected void constructStreams() throws IOException {
+
+    try {
+
+      ZkStateReader zkStateReader = cloudSolrClient.getZkStateReader();
+      ClusterState clusterState = zkStateReader.getClusterState();
+      Set<String> liveNodes = clusterState.getLiveNodes();
+      //System.out.println("Connected to zk an got cluster state.");
+
+      Collection<Slice> slices = clusterState.getActiveSlices(this.collection);
+
+      if(slices == null) {
+        //Try case insensitive match
+        for(String col : clusterState.getCollections()) {
+          if(col.equalsIgnoreCase(collection)) {
+            slices = clusterState.getActiveSlices(col);
+            break;
+          }
+        }
+
+        if(slices == null) {
+          throw new Exception("Collection not found:" + this.collection);
+        }
+      }
+
+      params.put("distrib", "false"); // We are the aggregator.
+      String fl = params.get("fl");
+      params.put("sort", "_version_ asc");
+      fl += ",_version_";
+      params.put("fl", fl);
+
+      Random random = new Random();
+
+      for(Slice slice : slices) {
+        Map localParams = new HashMap();
+        localParams.putAll(params);
+        long checkpoint = checkpoints.get(slice.getName());
+
+        Collection<Replica> replicas = slice.getReplicas();
+        List<Replica> shuffler = new ArrayList();
+        for(Replica replica : replicas) {
+          if(replica.getState() == Replica.State.ACTIVE && liveNodes.contains(replica.getNodeName()))
+            shuffler.add(replica);
+        }
+
+        Replica rep = shuffler.get(random.nextInt(shuffler.size()));
+        ZkCoreNodeProps zkProps = new ZkCoreNodeProps(rep);
+        String url = zkProps.getCoreUrl();
+        SolrStream solrStream = new SolrStream(url, localParams);
+        solrStream.setSlice(slice.getName());
+        solrStream.setCheckpoint(checkpoint);
+        solrStream.setTrace(true);
+        if(streamContext != null) {
+          solrStream.setStreamContext(streamContext);
+        }
+        solrStreams.add(solrStream);
+      }
+    } catch (Exception e) {
+      throw new IOException(e);
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b2475bf9/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-streaming.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-streaming.xml b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-streaming.xml
index 25a9bc0..7a7ee52 100644
--- a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-streaming.xml
+++ b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-streaming.xml
@@ -513,6 +513,7 @@
     <dynamicField name="*_i1"  type="int"    indexed="true" stored="true" multiValued="false"/>
 
     <dynamicField name="*_s"  type="string"  indexed="true"  stored="true"/>
+    <dynamicField name="*_ss" type="string"  indexed="true"  stored="true" multiValued="true"/>
     <dynamicField name="*_s1"  type="string"  indexed="true"  stored="true" multiValued="false"/>
     <dynamicField name="*_l"  type="long"   indexed="true"  stored="true"/>
     <dynamicField name="*_l1"  type="long"   indexed="true"  stored="true" multiValued="false"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b2475bf9/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index 6fa1a22..465369b 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -27,6 +27,7 @@ import java.util.Map;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.io.SolrClientCache;
 import org.apache.solr.client.solrj.io.Tuple;
 import org.apache.solr.client.solrj.io.ops.ConcatOperation;
 import org.apache.solr.client.solrj.io.ops.GroupOperation;
@@ -136,6 +137,7 @@ public class StreamExpressionTest extends AbstractFullDistribZkTestBase {
     testRollupStream();
     testStatsStream();
     testNulls();
+    testTopicStream();
     testDaemonStream();
     testParallelUniqueStream();
     testParallelReducerStream();
@@ -224,8 +226,8 @@ public class StreamExpressionTest extends AbstractFullDistribZkTestBase {
     tuples = getTuples(stream);
 
     assert(tuples.size() == 5);
-    assertOrder(tuples, 0,2,1,3,4);
-    assertLong(tuples.get(0),"a_i", 0);
+    assertOrder(tuples, 0, 2, 1, 3, 4);
+    assertLong(tuples.get(0), "a_i", 0);
 
     // Basic w/aliases
     expression = StreamExpressionParser.parse("search(collection1, q=*:*, fl=\"id,a_s,a_i,a_f\", sort=\"a_f asc, a_i asc\", aliases=\"a_i=alias.a_i, a_s=name\", zkHost=" + zkServer.getZkAddress() + ")");
@@ -233,8 +235,8 @@ public class StreamExpressionTest extends AbstractFullDistribZkTestBase {
     tuples = getTuples(stream);
 
     assert(tuples.size() == 5);
-    assertOrder(tuples, 0,2,1,3,4);
-    assertLong(tuples.get(0),"alias.a_i", 0);
+    assertOrder(tuples, 0, 2, 1, 3, 4);
+    assertLong(tuples.get(0), "alias.a_i", 0);
     assertString(tuples.get(0), "name", "hello0");
 
     // Basic filtered test
@@ -243,7 +245,7 @@ public class StreamExpressionTest extends AbstractFullDistribZkTestBase {
     tuples = getTuples(stream);
 
     assert(tuples.size() == 3);
-    assertOrder(tuples, 0,3,4);
+    assertOrder(tuples, 0, 3, 4);
     assertLong(tuples.get(1), "a_i", 3);
     
     del("*:*");
@@ -394,7 +396,7 @@ public class StreamExpressionTest extends AbstractFullDistribZkTestBase {
     tuples = getTuples(stream);
     
     assert(tuples.size() == 4);
-    assertOrder(tuples, 0,1,3,4);
+    assertOrder(tuples, 0, 1, 3, 4);
 
     // Basic test desc
     expression = StreamExpressionParser.parse("merge("
@@ -405,7 +407,7 @@ public class StreamExpressionTest extends AbstractFullDistribZkTestBase {
     tuples = getTuples(stream);
     
     assert(tuples.size() == 4);
-    assertOrder(tuples, 4,3,1,0);
+    assertOrder(tuples, 4, 3, 1, 0);
     
     // Basic w/multi comp
     expression = StreamExpressionParser.parse("merge("
@@ -565,9 +567,9 @@ public class StreamExpressionTest extends AbstractFullDistribZkTestBase {
     
     // basic w/spaces
     expression = StreamExpressionParser.parse("reduce("
-                                              +       "search(collection1, q=*:*, fl=\"id,a_s,a_i,a_f\", sort=\"a_s asc, a_f       asc\"),"
-                                              +       "by=\"a_s\"," +
-                                                      "group(sort=\"a_i asc\", n=\"2\"))");
+        + "search(collection1, q=*:*, fl=\"id,a_s,a_i,a_f\", sort=\"a_s asc, a_f       asc\"),"
+        + "by=\"a_s\"," +
+        "group(sort=\"a_i asc\", n=\"2\"))");
     stream = factory.constructStream(expression);
     tuples = getTuples(stream);
 
@@ -2217,7 +2219,163 @@ public class StreamExpressionTest extends AbstractFullDistribZkTestBase {
     del("*:*");
     commit();
   }
-  
+
+  private void testTopicStream() throws Exception{
+    indexr(id, "0", "a_s", "hello", "a_i", "0", "a_f", "1");
+    indexr(id, "2", "a_s", "hello", "a_i", "2", "a_f", "2");
+    indexr(id, "3", "a_s", "hello", "a_i", "3", "a_f", "3");
+    indexr(id, "4", "a_s", "hello", "a_i", "4", "a_f", "4");
+    indexr(id, "1", "a_s", "hello", "a_i", "1", "a_f", "5");
+    indexr(id, "5", "a_s", "hello", "a_i", "10", "a_f", "6");
+    indexr(id, "6", "a_s", "hello", "a_i", "11", "a_f", "7");
+    indexr(id, "7", "a_s", "hello", "a_i", "12", "a_f", "8");
+    indexr(id, "8", "a_s", "hello", "a_i", "13", "a_f", "9");
+    indexr(id, "9", "a_s", "hello", "a_i", "14", "a_f", "10");
+
+    commit();
+
+    StreamFactory factory = new StreamFactory()
+        .withCollectionZkHost("collection1", zkServer.getZkAddress())
+        .withFunctionName("topic", TopicStream.class)
+        .withFunctionName("search", CloudSolrStream.class)
+        .withFunctionName("daemon", DaemonStream.class);
+
+    StreamExpression expression;
+    TupleStream stream;
+    List<Tuple> tuples;
+
+    SolrClientCache cache = new SolrClientCache();
+
+    try {
+      //Store checkpoints in the same index as the main documents. This perfectly valid
+      expression = StreamExpressionParser.parse("topic(collection1, collection1, q=\"a_s:hello\", fl=\"id\", id=\"1000000\", checkpointEvery=3)");
+
+      stream = factory.constructStream(expression);
+      StreamContext context = new StreamContext();
+      context.setSolrClientCache(cache);
+      stream.setStreamContext(context);
+      tuples = getTuples(stream);
+
+      //Should be zero because the checkpoints will be set to the highest vesion on the shards.
+      assertEquals(tuples.size(), 0);
+
+      commit();
+      //Now check to see if the checkpoints are present
+
+              expression = StreamExpressionParser.parse("search(collection1, q=\"id:1000000\", fl=\"id, checkpoint_ss, _version_\", sort=\"id asc\")");
+              stream = factory.constructStream(expression);
+              context = new StreamContext();
+              context.setSolrClientCache(cache);
+              stream.setStreamContext(context);
+              tuples = getTuples(stream);
+              assertEquals(tuples.size(), 1);
+              List<String> checkpoints = tuples.get(0).getStrings("checkpoint_ss");
+              assertEquals(checkpoints.size(), 2);
+              Long version1 = tuples.get(0).getLong("_version_");
+
+      //Index a few more documents
+      indexr(id, "10", "a_s", "hello", "a_i", "13", "a_f", "9");
+      indexr(id, "11", "a_s", "hello", "a_i", "14", "a_f", "10");
+
+      commit();
+
+      expression = StreamExpressionParser.parse("topic(collection1, collection1, fl=\"id\", q=\"a_s:hello\", id=\"1000000\", checkpointEvery=2)");
+
+      stream = factory.constructStream(expression);
+      context = new StreamContext();
+      context.setSolrClientCache(cache);
+      stream.setStreamContext(context);
+
+      try {
+        stream.open();
+        Tuple tuple1 = stream.read();
+        assertEquals((long) tuple1.getLong("id"), 10l);
+        commit();
+
+                // Checkpoint should not have changed.
+                expression = StreamExpressionParser.parse("search(collection1, q=\"id:1000000\", fl=\"id, checkpoint_ss, _version_\", sort=\"id asc\")");
+                TupleStream cstream = factory.constructStream(expression);
+                context = new StreamContext();
+                context.setSolrClientCache(cache);
+                cstream.setStreamContext(context);
+                tuples = getTuples(cstream);
+
+                assertEquals(tuples.size(), 1);
+                checkpoints = tuples.get(0).getStrings("checkpoint_ss");
+                assertEquals(checkpoints.size(), 2);
+                Long version2 = tuples.get(0).getLong("_version_");
+                assertEquals(version1, version2);
+
+        Tuple tuple2 = stream.read();
+        commit();
+        assertEquals((long) tuple2.getLong("id"), 11l);
+
+                //Checkpoint should have changed.
+                expression = StreamExpressionParser.parse("search(collection1, q=\"id:1000000\", fl=\"id, checkpoint_ss, _version_\", sort=\"id asc\")");
+                cstream = factory.constructStream(expression);
+                context = new StreamContext();
+                context.setSolrClientCache(cache);
+                cstream.setStreamContext(context);
+                tuples = getTuples(cstream);
+
+                assertEquals(tuples.size(), 1);
+                checkpoints = tuples.get(0).getStrings("checkpoint_ss");
+                assertEquals(checkpoints.size(), 2);
+                Long version3 = tuples.get(0).getLong("_version_");
+                assertTrue(version3 > version2);
+
+        Tuple tuple3 = stream.read();
+        assertTrue(tuple3.EOF);
+      } finally {
+        stream.close();
+      }
+
+      //Test with the DaemonStream
+
+      DaemonStream dstream = null;
+      try {
+        expression = StreamExpressionParser.parse("daemon(topic(collection1, collection1, fl=\"id\", q=\"a_s:hello\", id=\"1000000\", checkpointEvery=2), id=\"test\", runInterval=\"1000\", queueSize=\"9\")");
+        dstream = (DaemonStream) factory.constructStream(expression);
+        context = new StreamContext();
+        context.setSolrClientCache(cache);
+        dstream.setStreamContext(context);
+
+        //Index a few more documents
+        indexr(id, "12", "a_s", "hello", "a_i", "13", "a_f", "9");
+        indexr(id, "13", "a_s", "hello", "a_i", "14", "a_f", "10");
+        commit();
+
+        //Start reading from the DaemonStream
+        Tuple tuple = null;
+
+        dstream.open();
+        tuple = dstream.read();
+        assertEquals(12, (long) tuple.getLong(id));
+        tuple = dstream.read();
+        assertEquals(13, (long) tuple.getLong(id));
+        commit(); // We want to see if the version has been updated after reading two tuples
+
+        //Index a few more documents
+        indexr(id, "14", "a_s", "hello", "a_i", "13", "a_f", "9");
+        indexr(id, "15", "a_s", "hello", "a_i", "14", "a_f", "10");
+        commit();
+
+        //Read from the same DaemonStream stream
+
+        tuple = dstream.read();
+        assertEquals(14, (long) tuple.getLong(id));
+        tuple = dstream.read(); // This should trigger a checkpoint as it's the 4th read from the stream.
+        assertEquals(15, (long) tuple.getLong(id));
+      } finally {
+        dstream.close();
+      }
+    } finally {
+      cache.close();
+      del("*:*");
+      commit();
+    }
+  }
+
   private void testUpdateStream() throws Exception {
     CloudSolrClient destinationCollectionClient = createCloudClient("destinationCollection");
     createCollection("destinationCollection", destinationCollectionClient, 2, 2);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b2475bf9/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java
index 93f8a6a..63baa01 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java
@@ -61,6 +61,7 @@ public class StreamExpressionToExpessionTest extends LuceneTestCase {
                     .withFunctionName("max", MaxMetric.class)
                     .withFunctionName("avg", MeanMetric.class)
                     .withFunctionName("daemon", DaemonStream.class)
+                    .withFunctionName("topic", TopicStream.class)
                     ;
   }
     
@@ -120,7 +121,24 @@ public class StreamExpressionToExpessionTest extends LuceneTestCase {
     assertTrue(expressionString.contains("queueSize=100"));
     assertTrue(expressionString.contains("runInterval=1000"));
   }
-  
+
+  @Test
+  public void testTopicStream() throws Exception {
+
+    TopicStream stream;
+    String expressionString;
+
+    // Basic test
+    stream = new TopicStream(StreamExpressionParser.parse("topic(collection2, collection1, q=*:*, fl=\"id,a_s,a_i,a_f\", id=\"blah\", checkpointEvery=1000)"), factory);
+    expressionString = stream.toExpression(factory).toString();
+    assertTrue(expressionString.contains("topic(collection2,collection1"));
+    assertTrue(expressionString.contains("q=\"*:*\""));
+    assertTrue(expressionString.contains("fl=\"id,a_s,a_i,a_f\""));
+    assertTrue(expressionString.contains("id=blah"));
+    assertTrue(expressionString.contains("checkpointEvery=1000"));
+  }
+
+
   @Test
   public void testStatsStream() throws Exception {
 


[24/53] [abbrv] lucene-solr git commit: Prevent warning on empty try-with-resources

Posted by no...@apache.org.
Prevent warning on empty try-with-resources


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/3d34728c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3d34728c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3d34728c

Branch: refs/heads/apiv2
Commit: 3d34728c4bc0936bec0411af98e08f53317d0061
Parents: 5c024e6
Author: Uwe Schindler <us...@apache.org>
Authored: Sun Feb 21 16:39:13 2016 +0100
Committer: Uwe Schindler <us...@apache.org>
Committed: Sun Feb 21 16:40:32 2016 +0100

----------------------------------------------------------------------
 .../src/java/org/apache/lucene/store/BaseDirectoryTestCase.java  | 3 +++
 .../src/java/org/apache/lucene/store/MockDirectoryWrapper.java   | 4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3d34728c/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
index 5f66074..44c03ea 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
@@ -1213,6 +1213,7 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
           continue;
         }
         try (IndexOutput out = dir.createOutput(candidate, IOContext.DEFAULT)) {
+          out.getFilePointer(); // just fake access to prevent compiler warning
         }
         fsDir.deleteFile(candidate);
         if (fsDir.checkPendingDeletions()) {
@@ -1246,12 +1247,14 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
 
       if (random().nextBoolean()) {
         try (IndexOutput out = fsDir.createOutput(fileName + "z", IOContext.DEFAULT)) {
+          out.getFilePointer(); // just fake access to prevent compiler warning
         }
         // Make sure we can rename onto the deleted file:
         fsDir.renameFile(fileName + "z", fileName);
       } else {
         // write the file again
         try (IndexOutput out = dir.createOutput(fileName, IOContext.DEFAULT)) {
+          out.getFilePointer(); // just fake access to prevent compiler warning
         }
       }
       assertEquals(0, fsDir.fileLength(fileName));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3d34728c/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
index ef4397f..962062e 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
@@ -19,7 +19,6 @@ package org.apache.lucene.store;
 import java.io.Closeable;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.nio.file.FileSystem;
 import java.nio.file.NoSuchFileException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -46,8 +45,6 @@ import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.NoDeletionPolicy;
 import org.apache.lucene.index.SegmentInfos;
-import org.apache.lucene.mockfile.FilterFileSystem;
-import org.apache.lucene.mockfile.VirusCheckingFS;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
@@ -423,6 +420,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
         deleteFile(name);
 
         try (IndexOutput out = in.createOutput(name, LuceneTestCase.newIOContext(randomState))) {
+          out.getFilePointer(); // just fake access to prevent compiler warning
         } catch (IOException ioe) {
           // ignore
         }


[30/53] [abbrv] lucene-solr git commit: more test verbosity for exotic OS X only test failure

Posted by no...@apache.org.
more test verbosity for exotic OS X only test failure


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/fa602bf6
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/fa602bf6
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/fa602bf6

Branch: refs/heads/apiv2
Commit: fa602bf635d4710be2ffe891e252f7d4c2baf302
Parents: 16cce9f
Author: Mike McCandless <mi...@apache.org>
Authored: Mon Feb 22 05:07:12 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Mon Feb 22 05:08:05 2016 -0500

----------------------------------------------------------------------
 .../java/org/apache/lucene/index/ConcurrentMergeScheduler.java | 6 ++++++
 .../src/test/org/apache/lucene/TestMergeSchedulerExternal.java | 3 +++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/fa602bf6/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
index dc9a5e9..0dd0a4d 100644
--- a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
+++ b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
@@ -672,11 +672,17 @@ public class ConcurrentMergeScheduler extends MergeScheduler {
 
   /** Used for testing */
   void setSuppressExceptions() {
+    if (verbose()) {
+      message("will suppress merge exceptions");
+    }
     suppressExceptions = true;
   }
 
   /** Used for testing */
   void clearSuppressExceptions() {
+    if (verbose()) {
+      message("will not suppress merge exceptions");
+    }
     suppressExceptions = false;
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/fa602bf6/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java b/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java
index 6abf2fa..307a1a7 100644
--- a/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java
+++ b/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java
@@ -74,6 +74,9 @@ public class TestMergeSchedulerExternal extends LuceneTestCase {
     @Override
     protected void handleMergeException(Directory dir, Throwable t) {
       excCalled = true;
+      if (infoStream.isEnabled("IW")) {
+        infoStream.message("IW", "TEST: now handleMergeException");
+      }
     }
 
     @Override


[15/53] [abbrv] lucene-solr git commit: SOLR-8693: Improve ZkStateReader logging.

Posted by no...@apache.org.
SOLR-8693: Improve ZkStateReader logging.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/3124a4de
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3124a4de
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3124a4de

Branch: refs/heads/apiv2
Commit: 3124a4debdeae794cd64b4d0e8b78d23aad73c5e
Parents: 0f29b3e
Author: markrmiller <ma...@apache.org>
Authored: Fri Feb 19 19:08:11 2016 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Fri Feb 19 19:09:58 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  2 ++
 .../apache/solr/common/cloud/ZkStateReader.java | 28 +++++++++++++++-----
 2 files changed, 24 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3124a4de/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 42c57c1..a57f8e5 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -286,6 +286,8 @@ Other Changes
 * SOLR-8677: Prevent shards containing invalid characters from being created.  Checks added server-side
   and in SolrJ.  (Shai Erera, Jason Gerlowski, Anshum Gupta)
 
+* SOLR-8693: Improve ZkStateReader logging. (Scott Blum via Mark Miller)
+
 ======================= 5.5.0 =======================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3124a4de/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
index 910b47e..a904f3e 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
@@ -29,6 +29,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.TreeSet;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
 
@@ -420,11 +421,21 @@ public class ZkStateReader implements Closeable {
     this.clusterState = new ClusterState(liveNodes, result, legacyClusterStateVersion);
     LOG.debug("clusterStateSet: version [{}] legacy [{}] interesting [{}] watched [{}] lazy [{}] total [{}]",
         clusterState.getZkClusterStateVersion(),
-        legacyCollectionStates.keySet(),
-        interestingCollections,
-        watchedCollectionStates.keySet(),
-        lazyCollectionStates.keySet(),
-        clusterState.getCollections());
+        legacyCollectionStates.keySet().size(),
+        interestingCollections.size(),
+        watchedCollectionStates.keySet().size(),
+        lazyCollectionStates.keySet().size(),
+        clusterState.getCollectionStates().size());
+
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("clusterStateSet: version [{}] legacy [{}] interesting [{}] watched [{}] lazy [{}] total [{}]",
+          clusterState.getZkClusterStateVersion(),
+          legacyCollectionStates.keySet(),
+          interestingCollections,
+          watchedCollectionStates.keySet(),
+          lazyCollectionStates.keySet(),
+          clusterState.getCollectionStates());
+    }
   }
 
   /**
@@ -533,17 +544,22 @@ public class ZkStateReader implements Closeable {
     Set<String> newLiveNodes;
     try {
       List<String> nodeList = zkClient.getChildren(LIVE_NODES_ZKNODE, watcher, true);
-      LOG.debug("Updating live nodes from ZooKeeper... [{}]", nodeList.size());
       newLiveNodes = new HashSet<>(nodeList);
     } catch (KeeperException.NoNodeException e) {
       newLiveNodes = emptySet();
     }
+    Set<String> oldLiveNodes;
     synchronized (getUpdateLock()) {
+      oldLiveNodes = this.liveNodes;
       this.liveNodes = newLiveNodes;
       if (clusterState != null) {
         clusterState.setLiveNodes(newLiveNodes);
       }
     }
+    LOG.info("Updated live nodes from ZooKeeper... ({}) -> ({})", oldLiveNodes.size(), newLiveNodes.size());
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("Updated live nodes from ZooKeeper... {} -> {}", new TreeSet<>(oldLiveNodes), new TreeSet<>(newLiveNodes));
+    }
   }
 
   /**


[18/53] [abbrv] lucene-solr git commit: clean up javadocs/typos

Posted by no...@apache.org.
clean up javadocs/typos


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/206a2b8b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/206a2b8b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/206a2b8b

Branch: refs/heads/apiv2
Commit: 206a2b8b7342820f61e57cd41f2e0e37448259fc
Parents: f9127a9
Author: Robert Muir <rm...@apache.org>
Authored: Sat Feb 20 10:10:09 2016 -0500
Committer: Robert Muir <rm...@apache.org>
Committed: Sat Feb 20 10:10:09 2016 -0500

----------------------------------------------------------------------
 .../org/apache/lucene/index/PointValues.java    | 22 ++++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/206a2b8b/lucene/core/src/java/org/apache/lucene/index/PointValues.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/PointValues.java b/lucene/core/src/java/org/apache/lucene/index/PointValues.java
index 0392b5c..108dde3 100644
--- a/lucene/core/src/java/org/apache/lucene/index/PointValues.java
+++ b/lucene/core/src/java/org/apache/lucene/index/PointValues.java
@@ -16,14 +16,18 @@
  */
 package org.apache.lucene.index;
 
-
 import java.io.IOException;
 
+import org.apache.lucene.document.BinaryPoint;
+import org.apache.lucene.document.DoublePoint;
+import org.apache.lucene.document.FloatPoint;
+import org.apache.lucene.document.IntPoint;
+import org.apache.lucene.document.LongPoint;
 import org.apache.lucene.util.bkd.BKDWriter;
 
-/** Allows recursively visiting point values indexed with {@link org.apache.lucene.document.IntPoint},
- *  {@link org.apache.lucene.document.FloatPoint}, {@link org.apache.lucene.document.LongPoint}, {@link org.apache.lucene.document.DoublePoint}
- *  or {@link org.apache.lucene.document.BinaryPoint}.
+/** Allows recursively visiting point values indexed with {@link IntPoint},
+ *  {@link FloatPoint}, {@link LongPoint}, {@link DoublePoint}
+ *  or {@link BinaryPoint}.
  *
  *  @lucene.experimental */
 public abstract class PointValues {
@@ -44,7 +48,7 @@ public abstract class PointValues {
     CELL_INSIDE_QUERY,
     /** Return this if the cell and query do not overlap */
     CELL_OUTSIDE_QUERY,
-    /** Return this if the cell partially overlapps the query */
+    /** Return this if the cell partially overlaps the query */
     CELL_CROSSES_QUERY
   };
 
@@ -52,16 +56,16 @@ public abstract class PointValues {
    *
    * @lucene.experimental */
   public interface IntersectVisitor {
-    /** Called for all docs in a leaf cell that's fully contained by the query.  The
+    /** Called for all documents in a leaf cell that's fully contained by the query.  The
      *  consumer should blindly accept the docID. */
     void visit(int docID) throws IOException;
 
-    /** Called for all docs in a leaf cell that crosses the query.  The consumer
+    /** Called for all documents in a leaf cell that crosses the query.  The consumer
      *  should scrutinize the packedValue to decide whether to accept it. */
     void visit(int docID, byte[] packedValue) throws IOException;
 
     /** Called for non-leaf cells to test how the cell relates to the query, to
-     *  determine how to further recurse down the treer. */
+     *  determine how to further recurse down the tree. */
     Relation compare(byte[] minPackedValue, byte[] maxPackedValue);
 
     /** Notifies the caller that this many documents (from one block) are about
@@ -70,7 +74,7 @@ public abstract class PointValues {
   }
 
   /** Finds all documents and points matching the provided visitor.
-   *  This method does not enforce live docs, so it's up to the caller
+   *  This method does not enforce live documents, so it's up to the caller
    *  to test whether each document is deleted, if necessary. */
   public abstract void intersect(String fieldName, IntersectVisitor visitor) throws IOException;
 


[20/53] [abbrv] lucene-solr git commit: SOLR-8708: DaemonStream should catch InterruptedException when reading underlying stream.

Posted by no...@apache.org.
SOLR-8708: DaemonStream should catch InterruptedException when reading underlying stream.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/2b3529c3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/2b3529c3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/2b3529c3

Branch: refs/heads/apiv2
Commit: 2b3529c3b8b8ea923b6e86a71b22db0d425ca5e7
Parents: 2fd90cd
Author: jbernste <jb...@apache.org>
Authored: Sat Feb 20 22:33:13 2016 -0500
Committer: jbernste <jb...@apache.org>
Committed: Sat Feb 20 22:35:10 2016 -0500

----------------------------------------------------------------------
 .../client/solrj/io/stream/DaemonStream.java    | 24 +++++++++++++++-----
 1 file changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2b3529c3/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java
index 358eea4..2f65394 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java
@@ -151,7 +151,7 @@ public class DaemonStream extends TupleStream implements Expressible {
   }
 
   public void open() {
-    this.streamRunner = new StreamRunner(runInterval);
+    this.streamRunner = new StreamRunner(runInterval, id);
     this.streamRunner.start();
   }
 
@@ -215,11 +215,13 @@ public class DaemonStream extends TupleStream implements Expressible {
     private long sleepMillis = 1000;
     private long runInterval;
     private long lastRun;
+    private String id;
 
     private boolean shutdown;
 
-    public StreamRunner(long runInterval) {
+    public StreamRunner(long runInterval, String id) {
       this.runInterval = runInterval;
+      this.id = id;
     }
 
     public synchronized void setShutdown(boolean shutdown) {
@@ -232,6 +234,7 @@ public class DaemonStream extends TupleStream implements Expressible {
     }
 
     public void run() {
+      int errors = 0;
       setStartTime(new Date().getTime());
       OUTER:
       while (!getShutdown()) {
@@ -244,6 +247,7 @@ public class DaemonStream extends TupleStream implements Expressible {
             while (true) {
               Tuple tuple = tupleStream.read();
               if (tuple.EOF) {
+                errors = 0; // Reset errors on successful run.
                 break INNER;
               } else if (!eatTuples) {
                 try {
@@ -255,7 +259,15 @@ public class DaemonStream extends TupleStream implements Expressible {
             }
           } catch (IOException e) {
             exception = e;
-            logger.error("Error in DaemonStream", e);
+            logger.error("Error in DaemonStream:"+id, e);
+            ++errors;
+            if(errors > 100) {
+              logger.error("Too many consectutive errors. Stopping DaemonStream:"+id);
+              break OUTER;
+            }
+          } catch (Throwable t) {
+            logger.error("Fatal Error in DaemonStream:"+id, t);
+            //For anything other then IOException break out of the loop and shutdown the thread.
             break OUTER;
           } finally {
             try {
@@ -263,7 +275,7 @@ public class DaemonStream extends TupleStream implements Expressible {
             } catch (IOException e1) {
               if (exception == null) {
                 exception = e1;
-                logger.error("Error in DaemonStream", e1);
+                logger.error("Error in DaemonStream:"+id, e1);
                 break OUTER;
               }
             }
@@ -273,7 +285,7 @@ public class DaemonStream extends TupleStream implements Expressible {
         try {
           Thread.sleep(sleepMillis);
         } catch (InterruptedException e) {
-          logger.error("Error in DaemonStream", e);
+          logger.error("Error in DaemonStream:"+id, e);
           break OUTER;
         }
       }
@@ -285,7 +297,7 @@ public class DaemonStream extends TupleStream implements Expressible {
         try {
           queue.put(tuple);
         } catch (InterruptedException e) {
-          logger.error("Error in DaemonStream", e);
+          logger.error("Error in DaemonStream:"+id, e);
         }
       }
       setStopTime(new Date().getTime());


[02/53] [abbrv] lucene-solr git commit: LUCENE-7037: Switch all exceptions tests to expectThrows()

Posted by no...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinValidation.java
----------------------------------------------------------------------
diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinValidation.java b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinValidation.java
index 423188d..565578c 100644
--- a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinValidation.java
+++ b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinValidation.java
@@ -81,12 +81,10 @@ public class TestBlockJoinValidation extends LuceneTestCase {
   public void testNextDocValidationForToParentBjq() throws Exception {
     Query parentQueryWithRandomChild = createChildrenQueryWithOneParent(getRandomChildNumber(0));
     ToParentBlockJoinQuery blockJoinQuery = new ToParentBlockJoinQuery(parentQueryWithRandomChild, parentsFilter, ScoreMode.None);
-    try {
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
       indexSearcher.search(blockJoinQuery, 1);
-      fail("didn't get expected exception");
-    } catch (IllegalStateException expected) {
-      assertTrue(expected.getMessage() != null && expected.getMessage().contains("child query must only match non-parent docs"));
-    }
+    });
+    assertTrue(expected.getMessage() != null && expected.getMessage().contains("child query must only match non-parent docs"));
   }
 
   public void testAdvanceValidationForToParentBjq() throws Exception {
@@ -102,12 +100,10 @@ public class TestBlockJoinValidation extends LuceneTestCase {
     conjunctionQuery.add(new BooleanClause(childQuery, BooleanClause.Occur.MUST));
     conjunctionQuery.add(new BooleanClause(blockJoinQuery, BooleanClause.Occur.MUST));
     
-    try {
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
       indexSearcher.search(conjunctionQuery.build(), 1);
-      fail("didn't get expected exception");
-    } catch (IllegalStateException expected) {
-      assertTrue(expected.getMessage() != null && expected.getMessage().contains("child query must only match non-parent docs"));
-    }
+    });
+    assertTrue(expected.getMessage() != null && expected.getMessage().contains("child query must only match non-parent docs"));
   }
 
   public void testNextDocValidationForToChildBjq() throws Exception {
@@ -115,12 +111,10 @@ public class TestBlockJoinValidation extends LuceneTestCase {
 
     ToChildBlockJoinQuery blockJoinQuery = new ToChildBlockJoinQuery(parentQueryWithRandomChild, parentsFilter);
     
-    try {
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
       indexSearcher.search(blockJoinQuery, 1);
-      fail("didn't get expected exception");
-    } catch (IllegalStateException expected) {
-      assertTrue(expected.getMessage() != null && expected.getMessage().contains(ToChildBlockJoinQuery.INVALID_QUERY_MESSAGE));
-    }
+    });
+    assertTrue(expected.getMessage() != null && expected.getMessage().contains(ToChildBlockJoinQuery.INVALID_QUERY_MESSAGE));
   }
 
   public void testAdvanceValidationForToChildBjq() throws Exception {
@@ -138,12 +132,11 @@ public class TestBlockJoinValidation extends LuceneTestCase {
       target = TestUtil.nextInt(random(), 0, context.reader().maxDoc() - 2);
     } while (parentDocs.get(target + 1));
 
-    try {
-      scorer.iterator().advance(target);
-      fail();
-    } catch (IllegalStateException expected) {
-      assertTrue(expected.getMessage() != null && expected.getMessage().contains(ToChildBlockJoinQuery.INVALID_QUERY_MESSAGE));
-    }
+    final int illegalTarget = target;
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
+      scorer.iterator().advance(illegalTarget);
+    });
+    assertTrue(expected.getMessage() != null && expected.getMessage().contains(ToChildBlockJoinQuery.INVALID_QUERY_MESSAGE));
   }
 
   private static List<Document> createDocsForSegment(int segmentNumber) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java
----------------------------------------------------------------------
diff --git a/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java b/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java
index c8b352a..b150ea3 100644
--- a/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java
+++ b/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java
@@ -70,21 +70,15 @@ public class TestMemoryIndex extends LuceneTestCase {
     // freeze!
     mi.freeze();
 
-    try {
+    RuntimeException expected = expectThrows(RuntimeException.class, () -> {
       mi.addField("f3", "and yet more", analyzer);
-      fail("Expected an IllegalArgumentException when adding a field after calling freeze()");
-    }
-    catch (RuntimeException e) {
-      assertThat(e.getMessage(), containsString("frozen"));
-    }
+    });
+    assertThat(expected.getMessage(), containsString("frozen"));
 
-    try {
+    expected = expectThrows(RuntimeException.class, () -> {
       mi.setSimilarity(new BM25Similarity(1, 1));
-      fail("Expected an IllegalArgumentException when setting the Similarity after calling freeze()");
-    }
-    catch (RuntimeException e) {
-      assertThat(e.getMessage(), containsString("frozen"));
-    }
+    });
+    assertThat(expected.getMessage(), containsString("frozen"));
 
     assertThat(mi.search(new TermQuery(new Term("f1", "some"))), not(is(0.0f)));
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/misc/src/test/org/apache/lucene/index/SortingLeafReaderTest.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/test/org/apache/lucene/index/SortingLeafReaderTest.java b/lucene/misc/src/test/org/apache/lucene/index/SortingLeafReaderTest.java
index 6052ab5..3e8cb99 100644
--- a/lucene/misc/src/test/org/apache/lucene/index/SortingLeafReaderTest.java
+++ b/lucene/misc/src/test/org/apache/lucene/index/SortingLeafReaderTest.java
@@ -64,12 +64,10 @@ public class SortingLeafReaderTest extends SorterTestBase {
   }
   
   public void testBadSort() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       SortingLeafReader.wrap(sortedReader, Sort.RELEVANCE);
-      fail("Didn't get expected exception");
-    } catch (IllegalArgumentException e) {
-      assertEquals("Cannot sort an index with a Sort that refers to the relevance score", e.getMessage());
-    }
+    });
+    assertEquals("Cannot sort an index with a Sort that refers to the relevance score", expected.getMessage());
   }
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java b/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
index a0c3fb1..a5486f4 100644
--- a/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
+++ b/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
@@ -192,12 +192,10 @@ public class TestSortingMergePolicy extends BaseMergePolicyTestCase {
   }
   
   public void testBadSort() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new SortingMergePolicy(newMergePolicy(), Sort.RELEVANCE);
-      fail("Didn't get expected exception");
-    } catch (IllegalArgumentException e) {
-      assertEquals("Cannot sort an index with a Sort that refers to the relevance score", e.getMessage());
-    }
+    });
+    assertEquals("Cannot sort an index with a Sort that refers to the relevance score", expected.getMessage());
   }
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCache.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCache.java b/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCache.java
index 215e9a3..fb05875 100644
--- a/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCache.java
+++ b/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCache.java
@@ -440,43 +440,37 @@ public class TestFieldCache extends LuceneTestCase {
     LeafReader ar = getOnlySegmentReader(ir);
     
     // Binary type: can be retrieved via getTerms()
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       FieldCache.DEFAULT.getNumerics(ar, "binary", FieldCache.NUMERIC_UTILS_INT_PARSER, false);
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
     BinaryDocValues binary = FieldCache.DEFAULT.getTerms(ar, "binary", true);
     final BytesRef term = binary.get(0);
     assertEquals("binary value", term.utf8ToString());
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       FieldCache.DEFAULT.getTermsIndex(ar, "binary");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       FieldCache.DEFAULT.getDocTermOrds(ar, "binary", null);
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       new DocTermOrds(ar, null, "binary");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
     Bits bits = FieldCache.DEFAULT.getDocsWithField(ar, "binary");
     assertTrue(bits.get(0));
     
     // Sorted type: can be retrieved via getTerms(), getTermsIndex(), getDocTermOrds()
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       FieldCache.DEFAULT.getNumerics(ar, "sorted", FieldCache.NUMERIC_UTILS_INT_PARSER, false);
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       new DocTermOrds(ar, null, "sorted");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
     binary = FieldCache.DEFAULT.getTerms(ar, "sorted", true);
     BytesRef scratch = binary.get(0);
@@ -501,49 +495,41 @@ public class TestFieldCache extends LuceneTestCase {
     NumericDocValues numeric = FieldCache.DEFAULT.getNumerics(ar, "numeric", FieldCache.NUMERIC_UTILS_INT_PARSER, false);
     assertEquals(42, numeric.get(0));
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       FieldCache.DEFAULT.getTerms(ar, "numeric", true);
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       FieldCache.DEFAULT.getTermsIndex(ar, "numeric");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       FieldCache.DEFAULT.getDocTermOrds(ar, "numeric", null);
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       new DocTermOrds(ar, null, "numeric");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
     bits = FieldCache.DEFAULT.getDocsWithField(ar, "numeric");
     assertTrue(bits.get(0));
     
     // SortedSet type: can be retrieved via getDocTermOrds() 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       FieldCache.DEFAULT.getNumerics(ar, "sortedset", FieldCache.NUMERIC_UTILS_INT_PARSER, false);
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       FieldCache.DEFAULT.getTerms(ar, "sortedset", true);
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       FieldCache.DEFAULT.getTermsIndex(ar, "sortedset");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       new DocTermOrds(ar, null, "sortedset");
-      fail();
-    } catch (IllegalStateException expected) {}
+    });
     
     sortedSet = FieldCache.DEFAULT.getDocTermOrds(ar, "sortedset", null);
     sortedSet.setDocument(0);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java b/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java
index 55d6714..717d364 100644
--- a/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java
+++ b/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java
@@ -1033,10 +1033,9 @@ public class TestFieldCacheSort extends LuceneTestCase {
     IndexReader reader = UninvertingReader.wrap(DirectoryReader.open(indexStore),
                          Collections.singletonMap("string", Type.SORTED));
     IndexSearcher searcher = new IndexSearcher(reader);
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       searcher.search(new MatchAllDocsQuery(), 500, sort);
-      fail("didn't get expected exception");
-    } catch (IllegalStateException expected) {}
+    });
     reader.close();
     indexStore.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queries/src/test/org/apache/lucene/queries/CommonTermsQueryTest.java
----------------------------------------------------------------------
diff --git a/lucene/queries/src/test/org/apache/lucene/queries/CommonTermsQueryTest.java b/lucene/queries/src/test/org/apache/lucene/queries/CommonTermsQueryTest.java
index 640089a..a7bfffd 100644
--- a/lucene/queries/src/test/org/apache/lucene/queries/CommonTermsQueryTest.java
+++ b/lucene/queries/src/test/org/apache/lucene/queries/CommonTermsQueryTest.java
@@ -179,12 +179,10 @@ public class CommonTermsQueryTest extends LuceneTestCase {
     Random random = random();
     CommonTermsQuery query = new CommonTermsQuery(randomOccur(random),
         randomOccur(random), random().nextFloat());
-    try {
+    // null values are not supported
+    expectThrows(IllegalArgumentException.class, () -> {
       query.add(null);
-      fail("null values are not supported");
-    } catch (IllegalArgumentException ex) {
-      
-    }
+    });
   }
   
   public void testMinShouldMatch() throws IOException {
@@ -324,23 +322,19 @@ public class CommonTermsQueryTest extends LuceneTestCase {
     IOUtils.close(r, w, dir, analyzer);
   }
   
+  /** MUST_NOT is not supported */
   public void testIllegalOccur() {
     Random random = random();
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new CommonTermsQuery(Occur.MUST_NOT, randomOccur(random), random()
           .nextFloat());
-      fail("MUST_NOT is not supproted");
-    } catch (IllegalArgumentException ex) {
+    });
       
-    }
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new CommonTermsQuery(randomOccur(random), Occur.MUST_NOT, random()
           .nextFloat());
-      fail("MUST_NOT is not supproted");
-    } catch (IllegalArgumentException ex) {
-      
-    }
+    });
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java
index 2f72e07..bf5f69f 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java
@@ -102,52 +102,31 @@ public class TestAnalyzingQueryParser extends LuceneTestCase {
   }
 
   public void testSingleChunkExceptions() {
-    boolean ex = false;
     String termStr = "the*tre";
       
     Analyzer stopsAnalyzer = new MockAnalyzer
         (random(), MockTokenizer.WHITESPACE, true, MockTokenFilter.ENGLISH_STOPSET);
-    try {
-      String q = parseWithAnalyzingQueryParser(termStr, stopsAnalyzer, true);     
-    } catch (ParseException e){
-      if (e.getMessage().contains("returned nothing")){
-        ex = true;
-      }
-    }
-    assertEquals("Should have returned nothing", true, ex);
-    ex = false;
+
+    ParseException expected = expectThrows(ParseException.class, () -> {
+      parseWithAnalyzingQueryParser(termStr, stopsAnalyzer, true);
+    });
+    assertTrue(expected.getMessage().contains("returned nothing"));
      
     AnalyzingQueryParser qp = new AnalyzingQueryParser(FIELD, a);
-    try{
+    expected = expectThrows(ParseException.class, () -> {
       qp.analyzeSingleChunk(FIELD, "", "not a single chunk");
-    } catch (ParseException e){
-      if (e.getMessage().contains("multiple terms")){
-        ex = true;
-      }
-    }
-    assertEquals("Should have produced multiple terms", true, ex);
+    });
+    assertTrue(expected.getMessage().contains("multiple terms"));
   }
    
   public void testWildcardAlone() throws ParseException {
     //seems like crazy edge case, but can be useful in concordance 
-    boolean pex = false;
-    try{
-      Query q = getAnalyzedQuery("*", a, false);
-    } catch (ParseException e){
-      pex = true;
-    }
-    assertEquals("Wildcard alone with allowWildcard=false", true, pex);
+    expectThrows(ParseException.class, () -> {
+      getAnalyzedQuery("*", a, false);
+    });
       
-    pex = false;
-    try {
-      String qString = parseWithAnalyzingQueryParser("*", a, true);
-      assertEquals("Every word", "*", qString);
-    } catch (ParseException e){
-      pex = true;
-    }
-      
-    assertEquals("Wildcard alone with allowWildcard=true", false, pex);
-
+    String qString = parseWithAnalyzingQueryParser("*", a, true);
+    assertEquals("Every word", "*", qString);
   }
   public void testWildCardEscapes() throws ParseException, IOException {
 
@@ -162,15 +141,9 @@ public class TestAnalyzingQueryParser extends LuceneTestCase {
 
   }
   public void testWildCardQueryNoLeadingAllowed() {
-    boolean ex = false;
-    try{
-      String q = parseWithAnalyzingQueryParser(wildcardInput[0], a, false);
-
-    } catch (ParseException e){
-      ex = true;
-    }
-    assertEquals("Testing initial wildcard not allowed",
-        true, ex);
+    expectThrows(ParseException.class, () -> {
+      parseWithAnalyzingQueryParser(wildcardInput[0], a, false);
+    });
   }
 
   public void testWildCardQuery() throws ParseException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java
index 4e7cb54..d4d8b93 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java
@@ -177,12 +177,10 @@ public class TestMultiFieldQueryParser extends LuceneTestCase {
     assertEquals("(b:one +b:more) (+t:two)", q.toString());
 
     String[] queries5 = {"blah"};
-    try {
-      q = MultiFieldQueryParser.parse(queries5, fields, new MockAnalyzer(random()));
-      fail();
-    } catch(IllegalArgumentException e) {
-      // expected exception, array length differs
-    }
+    // expected exception, array length differs
+    expectThrows(IllegalArgumentException.class, () -> {
+      MultiFieldQueryParser.parse(queries5, fields, new MockAnalyzer(random()));
+    });
     
     // check also with stop words for this static form (qtxts[], fields[]).
     TestQueryParser.QPTestAnalyzer stopA = new TestQueryParser.QPTestAnalyzer();
@@ -206,13 +204,11 @@ public class TestMultiFieldQueryParser extends LuceneTestCase {
     q = MultiFieldQueryParser.parse("one two", fields, flags, new MockAnalyzer(random()));
     assertEquals("+(b:one b:two) -(t:one t:two)", q.toString());
 
-    try {
+    // expected exception, array length differs
+    expectThrows(IllegalArgumentException.class, () -> {
       BooleanClause.Occur[] flags2 = {BooleanClause.Occur.MUST};
-      q = MultiFieldQueryParser.parse("blah", fields, flags2, new MockAnalyzer(random()));
-      fail();
-    } catch(IllegalArgumentException e) {
-      // expected exception, array length differs
-    }
+      MultiFieldQueryParser.parse("blah", fields, flags2, new MockAnalyzer(random()));
+    });
   }
 
   public void testStaticMethod2Old() throws ParseException {
@@ -226,13 +222,11 @@ public class TestMultiFieldQueryParser extends LuceneTestCase {
     q = MultiFieldQueryParser.parse("one two", fields, flags, new MockAnalyzer(random()));
     assertEquals("+(b:one b:two) -(t:one t:two)", q.toString());
 
-    try {
+    // expected exception, array length differs
+    expectThrows(IllegalArgumentException.class, () -> {
       BooleanClause.Occur[] flags2 = {BooleanClause.Occur.MUST};
-      q = MultiFieldQueryParser.parse("blah", fields, flags2, new MockAnalyzer(random()));
-      fail();
-    } catch(IllegalArgumentException e) {
-      // expected exception, array length differs
-    }
+      MultiFieldQueryParser.parse("blah", fields, flags2, new MockAnalyzer(random()));
+    });
   }
 
   public void testStaticMethod3() throws ParseException {
@@ -243,13 +237,11 @@ public class TestMultiFieldQueryParser extends LuceneTestCase {
     Query q = MultiFieldQueryParser.parse(queries, fields, flags, new MockAnalyzer(random()));
     assertEquals("+f1:one -f2:two f3:three", q.toString());
 
-    try {
+    // expected exception, array length differs
+    expectThrows(IllegalArgumentException.class, () -> {
       BooleanClause.Occur[] flags2 = {BooleanClause.Occur.MUST};
-      q = MultiFieldQueryParser.parse(queries, fields, flags2, new MockAnalyzer(random()));
-      fail();
-    } catch(IllegalArgumentException e) {
-      // expected exception, array length differs
-    }
+      MultiFieldQueryParser.parse(queries, fields, flags2, new MockAnalyzer(random()));
+    });
   }
 
   public void testStaticMethod3Old() throws ParseException {
@@ -259,13 +251,11 @@ public class TestMultiFieldQueryParser extends LuceneTestCase {
     Query q = MultiFieldQueryParser.parse(queries, fields, flags, new MockAnalyzer(random()));
     assertEquals("+b:one -t:two", q.toString());
 
-    try {
+    // expected exception, array length differs
+    expectThrows(IllegalArgumentException.class, () -> {
       BooleanClause.Occur[] flags2 = {BooleanClause.Occur.MUST};
-      q = MultiFieldQueryParser.parse(queries, fields, flags2, new MockAnalyzer(random()));
-      fail();
-    } catch(IllegalArgumentException e) {
-      // expected exception, array length differs
-    }
+      MultiFieldQueryParser.parse(queries, fields, flags2, new MockAnalyzer(random()));
+    });
   }
 
   public void testAnalyzerReturningNull() throws ParseException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java
index 5d3b7ec..2457d3c 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java
@@ -259,24 +259,20 @@ public class TestQueryParser extends QueryParserTestBase {
     
   }
   
+  // Wildcard queries should not be allowed
   public void testCustomQueryParserWildcard() {
-    try {
+    expectThrows(ParseException.class, () -> {
       new QPTestParser("contents", new MockAnalyzer(random(),
           MockTokenizer.WHITESPACE, false)).parse("a?t");
-      fail("Wildcard queries should not be allowed");
-    } catch (ParseException expected) {
-      // expected exception
-    }
+    });
   }
   
+  // Fuzzy queries should not be allowed
   public void testCustomQueryParserFuzzy() throws Exception {
-    try {
+    expectThrows(ParseException.class, () -> {
       new QPTestParser("contents", new MockAnalyzer(random(),
           MockTokenizer.WHITESPACE, false)).parse("xunit~");
-      fail("Fuzzy queries should not be allowed");
-    } catch (ParseException expected) {
-      // expected exception
-    }
+    });
   }
   
   /** query parser that doesn't expand synonyms when users use double quotes */
@@ -481,11 +477,8 @@ public class TestQueryParser extends QueryParserTestBase {
   public void testWildcardMaxDeterminizedStates() throws Exception {
     QueryParser qp = new QueryParser("field", new MockAnalyzer(random()));
     qp.setMaxDeterminizedStates(10);
-    try {
+    expectThrows(TooComplexToDeterminizeException.class, () -> {
       qp.parse("a*aaaaaaa");
-      fail("should have hit exception");
-    } catch (TooComplexToDeterminizeException tctde) {
-      // expected
-    }
+    });
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java
index 45d13de..66078b0 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java
@@ -86,14 +86,9 @@ public class TestComplexPhraseQuery extends LuceneTestCase {
   private void checkBadQuery(String qString) {
     ComplexPhraseQueryParser qp = new ComplexPhraseQueryParser(defaultFieldName, analyzer);
     qp.setInOrder(inOrder);
-    Throwable expected = null;
-    try {
+    expectThrows(Throwable.class, () -> {
       qp.parse(qString);
-    } catch (Throwable e) {
-      expected = e;
-    }
-    assertNotNull("Expected parse error in " + qString, expected);
-
+    });
   }
 
   private void checkMatches(String qString, String expectedVals)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtendableQueryParser.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtendableQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtendableQueryParser.java
index ac46930..785dd1c 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtendableQueryParser.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtendableQueryParser.java
@@ -57,11 +57,9 @@ public class TestExtendableQueryParser extends TestQueryParser {
     Extensions ext = newExtensions(':');
     ext.add("testExt", new ExtensionStub());
     ExtendableQueryParser parser = (ExtendableQueryParser) getParser(null, ext);
-    try {
+    expectThrows(ParseException.class, () -> {
       parser.parse("aField:testExt:\"foo \\& bar\"");
-      fail("extension field delimiter is not escaped");
-    } catch (ParseException e) {
-    }
+    });
   }
 
   public void testExtFieldUnqoted() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtensions.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtensions.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtensions.java
index fde11bb..7899d50 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtensions.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtensions.java
@@ -68,11 +68,9 @@ public class TestExtensions extends LuceneTestCase {
   public void testEscapeExtension() {
     assertEquals("abc\\:\\?\\{\\}\\[\\]\\\\\\(\\)\\+\\-\\!\\~", ext
         .escapeExtensionField("abc:?{}[]\\()+-!~"));
-    try {
+    // should throw NPE - escape string is null
+    expectThrows(NullPointerException.class, () -> {
       ext.escapeExtensionField(null);
-      fail("should throw NPE - escape string is null");
-    } catch (NullPointerException e) {
-      // 
-    }
+    });
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java
index 4dbe3f9..b58cede 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java
@@ -314,12 +314,9 @@ public class TestPrecedenceQueryParser extends LuceneTestCase {
     fq = (FuzzyQuery) getQuery("term~", null);
     assertEquals(2, fq.getMaxEdits());
     assertEquals(FuzzyQuery.defaultPrefixLength, fq.getPrefixLength());
-    try {
+    expectThrows(ParseException.class, () -> {
       getQuery("term~1.1", null); // value > 1, throws exception
-      fail();
-    } catch (ParseException pe) {
-      // expected exception
-    }
+    });
     assertTrue(getQuery("term*germ", null) instanceof WildcardQuery);
 
     /*
@@ -580,21 +577,17 @@ public class TestPrecedenceQueryParser extends LuceneTestCase {
   }
 
   public void testException() throws Exception {
-    try {
+    expectThrows(QueryNodeParseException.class, () -> {
       assertQueryEquals("\"some phrase", null, "abc");
-      fail("ParseException expected, not thrown");
-    } catch (QueryNodeParseException expected) {
-    }
+    });
   }
 
+  // ParseException expected due to too many boolean clauses
   public void testBooleanQuery() throws Exception {
     BooleanQuery.setMaxClauseCount(2);
-    try {
+    expectThrows(QueryNodeException.class, () -> {
       getParser(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)).parse("one two three", "field");
-      fail("ParseException expected due to too many boolean clauses");
-    } catch (QueryNodeException expected) {
-      // too many boolean clauses, so ParseException is expected
-    }
+    });
   }
   
   // LUCENE-792

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParser.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParser.java
index 192cd3b..0bcfedf 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParser.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParser.java
@@ -168,62 +168,33 @@ public class TestSpanQueryParser extends LuceneTestCase {
 
   public void testQueryValidator() throws QueryNodeException {
 
-    try {
-      getSpanQuery("term*");
-      fail("QueryNodeException was expected, wildcard queries should not be supported");
+    expectThrows(QueryNodeException.class, () -> {
+      getSpanQuery("term*"); // wildcard queries should not be supported
+    });
 
-    } catch (QueryNodeException ex) {
-      // expected exception
-    }
+    expectThrows(QueryNodeException.class, () -> {
+      getSpanQuery("[a TO z]"); // range queries should not be supported
+    });
 
-    try {
-      getSpanQuery("[a TO z]");
-      fail("QueryNodeException was expected, range queries should not be supported");
+    expectThrows(QueryNodeException.class, () -> {
+      getSpanQuery("a~0.5"); // boost queries should not be supported
+    });
 
-    } catch (QueryNodeException ex) {
-      // expected exception
-    }
+    expectThrows(QueryNodeException.class, () -> {
+      getSpanQuery("a^0.5"); // fuzzy queries should not be supported
+    });
 
-    try {
-      getSpanQuery("a~0.5");
-      fail("QueryNodeException was expected, boost queries should not be supported");
+    expectThrows(QueryNodeException.class, () -> {
+      getSpanQuery("\"a b\""); // quoted queries should not be supported
+    });
 
-    } catch (QueryNodeException ex) {
-      // expected exception
-    }
-
-    try {
-      getSpanQuery("a^0.5");
-      fail("QueryNodeException was expected, fuzzy queries should not be supported");
-
-    } catch (QueryNodeException ex) {
-      // expected exception
-    }
-
-    try {
-      getSpanQuery("\"a b\"");
-      fail("QueryNodeException was expected, quoted queries should not be supported");
-
-    } catch (QueryNodeException ex) {
-      // expected exception
-    }
-
-    try {
-      getSpanQuery("(a b)");
-      fail("QueryNodeException was expected, parenthesized queries should not be supported");
-
-    } catch (QueryNodeException ex) {
-      // expected exception
-    }
-
-    try {
-      getSpanQuery("a AND b");
-      fail("QueryNodeException was expected, and queries should not be supported");
-
-    } catch (QueryNodeException ex) {
-      // expected exception
-    }
+    expectThrows(QueryNodeException.class, () -> {
+      getSpanQuery("(a b)"); // parenthesized queries should not be supported
+    });
 
+    expectThrows(QueryNodeException.class, () -> {
+      getSpanQuery("a AND b"); // AND queries should not be supported
+    });
   }
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java
index 0988e56..28e815d 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java
@@ -195,12 +195,10 @@ public class TestMultiFieldQPHelper extends LuceneTestCase {
     assertEquals("(b:one +b:more) t:two", q.toString());
 
     String[] queries5 = { "blah" };
-    try {
-      q = QueryParserUtil.parse(queries5, fields, new MockAnalyzer(random()));
-      fail();
-    } catch (IllegalArgumentException e) {
-      // expected exception, array length differs
-    }
+    // expected exception, array length differs
+    expectThrows(IllegalArgumentException.class, () -> {
+      QueryParserUtil.parse(queries5, fields, new MockAnalyzer(random()));
+    });
 
     // check also with stop words for this static form (qtxts[], fields[]).
     TestQPHelper.QPTestAnalyzer stopA = new TestQPHelper.QPTestAnalyzer();
@@ -226,13 +224,11 @@ public class TestMultiFieldQPHelper extends LuceneTestCase {
     q = QueryParserUtil.parse("one two", fields, flags, new MockAnalyzer(random()));
     assertEquals("+(b:one b:two) -(t:one t:two)", q.toString());
 
-    try {
+    // expected exception, array length differs
+    expectThrows(IllegalArgumentException.class, () -> {
       BooleanClause.Occur[] flags2 = { BooleanClause.Occur.MUST };
-      q = QueryParserUtil.parse("blah", fields, flags2, new MockAnalyzer(random()));
-      fail();
-    } catch (IllegalArgumentException e) {
-      // expected exception, array length differs
-    }
+      QueryParserUtil.parse("blah", fields, flags2, new MockAnalyzer(random()));
+    });
   }
 
   public void testStaticMethod2Old() throws QueryNodeException {
@@ -251,13 +247,11 @@ public class TestMultiFieldQPHelper extends LuceneTestCase {
     q = QueryParserUtil.parse("one two", fields, flags, new MockAnalyzer(random()));
     assertEquals("+(b:one b:two) -(t:one t:two)", q.toString());
 
-    try {
+    // expected exception, array length differs
+    expectThrows(IllegalArgumentException.class, () -> {
       BooleanClause.Occur[] flags2 = { BooleanClause.Occur.MUST };
-      q = QueryParserUtil.parse("blah", fields, flags2, new MockAnalyzer(random()));
-      fail();
-    } catch (IllegalArgumentException e) {
-      // expected exception, array length differs
-    }
+      QueryParserUtil.parse("blah", fields, flags2, new MockAnalyzer(random()));
+    });
   }
 
   public void testStaticMethod3() throws QueryNodeException {
@@ -269,14 +263,12 @@ public class TestMultiFieldQPHelper extends LuceneTestCase {
         new MockAnalyzer(random()));
     assertEquals("+f1:one -f2:two f3:three", q.toString());
 
-    try {
+    // expected exception, array length differs
+    expectThrows(IllegalArgumentException.class, () -> {
       BooleanClause.Occur[] flags2 = { BooleanClause.Occur.MUST };
-      q = QueryParserUtil
+      QueryParserUtil
           .parse(queries, fields, flags2, new MockAnalyzer(random()));
-      fail();
-    } catch (IllegalArgumentException e) {
-      // expected exception, array length differs
-    }
+    });
   }
 
   public void testStaticMethod3Old() throws QueryNodeException {
@@ -288,14 +280,12 @@ public class TestMultiFieldQPHelper extends LuceneTestCase {
         new MockAnalyzer(random()));
     assertEquals("+b:one -t:two", q.toString());
 
-    try {
+    // expected exception, array length differs
+    expectThrows(IllegalArgumentException.class, () -> {
       BooleanClause.Occur[] flags2 = { BooleanClause.Occur.MUST };
-      q = QueryParserUtil
+      QueryParserUtil
           .parse(queries, fields, flags2, new MockAnalyzer(random()));
-      fail();
-    } catch (IllegalArgumentException e) {
-      // expected exception, array length differs
-    }
+    });
   }
 
   public void testAnalyzerReturningNull() throws QueryNodeException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java
index 1c53726..e7d0c89 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java
@@ -619,18 +619,14 @@ public class TestQPHelper extends LuceneTestCase {
     assertWildcardQueryEquals("[A TO C]", true, "[a TO c]");
     assertWildcardQueryEquals("[A TO C]", false, "[A TO C]");
     // Test suffix queries: first disallow
-    try {
+    expectThrows(QueryNodeException.class, () -> {
       assertWildcardQueryEquals("*Term", true, "*term");
-      fail();
-    } catch (QueryNodeException pe) {
-      // expected exception
-    }
-    try {
+    });
+
+    expectThrows(QueryNodeException.class, () -> {
       assertWildcardQueryEquals("?Term", true, "?term");
-      fail();
-    } catch (QueryNodeException pe) {
-      // expected exception
-    }
+    });
+
     // Test suffix queries: then allow
     assertWildcardQueryEquals("*Term", true, "*term", true);
     assertWildcardQueryEquals("?Term", true, "?term", true);
@@ -1001,12 +997,9 @@ public class TestQPHelper extends LuceneTestCase {
   }
 
   public void assertQueryNodeException(String queryString) throws Exception {
-    try {
+    expectThrows(QueryNodeException.class, () -> {
       getQuery(queryString, null);
-    } catch (QueryNodeException expected) {
-      return;
-    }
-    fail("ParseException expected, not thrown");
+    });
   }
 
   public void testException() throws Exception {
@@ -1019,35 +1012,29 @@ public class TestQPHelper extends LuceneTestCase {
     assertQueryNodeException("secret AND illegal) AND access:confidential");    
   }
 
+  // Wildcard queries should not be allowed
   public void testCustomQueryParserWildcard() {
-    try {
+    expectThrows(QueryNodeException.class, () -> {
       new QPTestParser(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)).parse("a?t", "contents");
-      fail("Wildcard queries should not be allowed");
-    } catch (QueryNodeException expected) {
-      // expected exception
-    }
+    });
   }
 
+  // Fuzzy queries should not be allowed"
   public void testCustomQueryParserFuzzy() throws Exception {
-    try {
+    expectThrows(QueryNodeException.class, () -> {
       new QPTestParser(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)).parse("xunit~", "contents");
-      fail("Fuzzy queries should not be allowed");
-    } catch (QueryNodeException expected) {
-      // expected exception
-    }
+    });
   }
 
+  // too many boolean clauses, so ParseException is expected
   public void testBooleanQuery() throws Exception {
     BooleanQuery.setMaxClauseCount(2);
-    try {
+    expectThrows(QueryNodeException.class, () -> {
       StandardQueryParser qp = new StandardQueryParser();
       qp.setAnalyzer(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false));
 
       qp.parse("one two three", "field");
-      fail("ParseException expected due to too many boolean clauses");
-    } catch (QueryNodeException expected) {
-      // too many boolean clauses, so ParseException is expected
-    }
+    });
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQP.java
----------------------------------------------------------------------
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQP.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQP.java
index 1bbdb53..cc2ac12 100644
--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQP.java
+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQP.java
@@ -155,22 +155,18 @@ public class TestStandardQP extends QueryParserTestBase {
   
   @Override
   public void testCollatedRange() throws Exception {
-    try {
+    expectThrows(UnsupportedOperationException.class, () -> {
       setAnalyzeRangeTerms(getParser(null), true);
       super.testCollatedRange();
-    } catch (UnsupportedOperationException e) {
-      // expected
-    }
+    });
   }
   
   @Override
   public void testAutoGeneratePhraseQueriesOn() throws Exception {
-    try {
+    expectThrows(UnsupportedOperationException.class, () -> {
       setAutoGeneratePhraseQueries(getParser(null), true);
       super.testAutoGeneratePhraseQueriesOn();
-    } catch (UnsupportedOperationException e) {
-      // expected
-    }
+    });
   }
   
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java
index 8804004..022298b 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java
@@ -56,15 +56,13 @@ public class IndexAndTaxonomyRevisionTest extends ReplicatorTestCase {
     
     Directory taxoDir = newDirectory();
     SnapshotDirectoryTaxonomyWriter taxoWriter = new SnapshotDirectoryTaxonomyWriter(taxoDir);
-    try {
-      assertNotNull(new IndexAndTaxonomyRevision(indexWriter, taxoWriter));
-      fail("should have failed when there are no commits to snapshot");
-    } catch (IllegalStateException e) {
-      // expected
-    } finally {
-      indexWriter.close();
-      IOUtils.close(taxoWriter, taxoDir, indexDir);
-    }
+    // should fail when there are no commits to snapshot
+    expectThrows(IllegalStateException.class, () -> {
+      new IndexAndTaxonomyRevision(indexWriter, taxoWriter);
+    });
+
+    indexWriter.close();
+    IOUtils.close(taxoWriter, taxoDir, indexDir);
   }
   
   @Test

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java
index d5f3588..77f323d 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java
@@ -41,15 +41,13 @@ public class IndexRevisionTest extends ReplicatorTestCase {
     IndexWriterConfig conf = new IndexWriterConfig(null);
     conf.setIndexDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy());
     IndexWriter writer = new IndexWriter(dir, conf);
-    try {
-      assertNotNull(new IndexRevision(writer));
-      fail("should have failed when IndexDeletionPolicy is not Snapshot");
-    } catch (IllegalArgumentException e) {
-      // expected
-    } finally {
-      writer.close();
-      IOUtils.close(dir);
-    }
+    // should fail when IndexDeletionPolicy is not Snapshot
+    expectThrows(IllegalArgumentException.class, () -> {
+      new IndexRevision(writer);
+    });
+
+    writer.close();
+    IOUtils.close(dir);
   }
   
   @Test
@@ -58,15 +56,13 @@ public class IndexRevisionTest extends ReplicatorTestCase {
     IndexWriterConfig conf = new IndexWriterConfig(null);
     conf.setIndexDeletionPolicy(new SnapshotDeletionPolicy(conf.getIndexDeletionPolicy()));
     IndexWriter writer = new IndexWriter(dir, conf);
-    try {
-      assertNotNull(new IndexRevision(writer));
-      fail("should have failed when there are no commits to snapshot");
-    } catch (IllegalStateException e) {
-      // expected
-    } finally {
-      writer.close();
-      IOUtils.close(dir);
-    }
+    // should fail when there are no commits to snapshot"
+    expectThrows(IllegalStateException.class, () -> {
+      new IndexRevision(writer);
+    });
+
+    writer.close();
+    IOUtils.close(dir);
   }
   
   @Test

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java
index 2d32878..af23da1 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java
@@ -86,34 +86,25 @@ public class LocalReplicatorTest extends ReplicatorTestCase {
     assertEquals(1, res.sourceFiles.size());
     Entry<String,List<RevisionFile>> entry = res.sourceFiles.entrySet().iterator().next();
     replicator.close();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       replicator.obtainFile(res.id, entry.getKey(), entry.getValue().get(0).fileName);
-      fail("should have failed on AlreadyClosedException");
-    } catch (AlreadyClosedException e) {
-      // expected
-    }
+    });
   }
   
   @Test
   public void testPublishAlreadyClosed() throws IOException {
     replicator.close();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       replicator.publish(createRevision(2));
-      fail("should have failed on AlreadyClosedException");
-    } catch (AlreadyClosedException e) {
-      // expected
-    }
+    });
   }
   
   @Test
   public void testUpdateAlreadyClosed() throws IOException {
     replicator.close();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       replicator.checkForUpdate(null);
-      fail("should have failed on AlreadyClosedException");
-    } catch (AlreadyClosedException e) {
-      // expected
-    }
+    });
   }
   
   @Test
@@ -140,12 +131,10 @@ public class LocalReplicatorTest extends ReplicatorTestCase {
     replicator.publish(createRevision(1));
     Revision old = new IndexRevision(sourceWriter);
     replicator.publish(createRevision(2));
-    try {
+    // should fail to publish an older revision
+    expectThrows(IllegalArgumentException.class, () -> {
       replicator.publish(old);
-      fail("should have failed to publish an older revision");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
+    });
     assertEquals(1, DirectoryReader.listCommits(sourceDir).size());
   }
   
@@ -167,12 +156,10 @@ public class LocalReplicatorTest extends ReplicatorTestCase {
     SessionToken session = replicator.checkForUpdate(null);
     replicator.setExpirationThreshold(5); // expire quickly
     Thread.sleep(50); // sufficient for expiration
-    try {
+    // should fail to obtain a file for an expired session
+    expectThrows(SessionExpiredException.class, () -> {
       replicator.obtainFile(session.id, session.sourceFiles.keySet().iterator().next(), session.sourceFiles.values().iterator().next().get(0).fileName);
-      fail("should have failed to obtain a file for an expired session");
-    } catch (SessionExpiredException e) {
-      // expected
-    }
+    });
   }
   
   @Test

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/TestIDVersionPostingsFormat.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/TestIDVersionPostingsFormat.java b/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/TestIDVersionPostingsFormat.java
index efbd6ad..d173762 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/TestIDVersionPostingsFormat.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/TestIDVersionPostingsFormat.java
@@ -363,15 +363,14 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase {
     Document doc = new Document();
     doc.add(makeIDField("id", 17));
     w.addDocument(doc);
-    doc = new Document();
-    doc.add(makeIDField("id", 17));
-    try {
-      w.addDocument(doc);
+
+    Document duplicate = new Document();
+    duplicate.add(makeIDField("id", 17));
+    expectThrows(IllegalArgumentException.class, () -> {
+      w.addDocument(duplicate);
       w.commit();
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     w.close();
     dir.close();
   }
@@ -464,13 +463,10 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase {
     RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
     Document doc = new Document();
     doc.add(newTextField("id", "id", Field.Store.NO));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
       w.commit();
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
              
     w.close();
     dir.close();
@@ -483,13 +479,11 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase {
     RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
     Document doc = new Document();
     doc.add(newStringField("id", "id", Field.Store.NO));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
       w.commit();
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
              
     w.close();
     dir.close();
@@ -502,13 +496,10 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase {
     RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
     Document doc = new Document();
     doc.add(new StringAndPayloadField("id", "id", new BytesRef("foo")));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
       w.commit();
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
              
     w.close();
     dir.close();
@@ -550,14 +541,12 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase {
     ts.setValue("foo", payload);
     Field field = new Field("id", ts, ft);
     doc.add(new Field("id", ts, ft));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
       w.commit();
       fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-      // iae.printStackTrace(System.out);
-    }
+    });
+
     w.close();
     dir.close();
   }
@@ -570,13 +559,11 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase {
     Document doc = new Document();
     doc.add(makeIDField("id", 17));
     doc.add(makeIDField("id", 17));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
       w.commit();
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     w.close();
     dir.close();
   }
@@ -589,19 +576,13 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase {
     Document doc = new Document();
     // -1
     doc.add(new StringAndPayloadField("id", "id", new BytesRef(new byte[] {(byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff})));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
       w.commit();
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(AlreadyClosedException.class, () -> {
       w.addDocument(doc);
-      fail("should have hit exc");
-    } catch (AlreadyClosedException ace) {
-      // expected
-    }
+    });
     dir.close();
   }
 
@@ -613,19 +594,14 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase {
     Document doc = new Document();
     // Long.MAX_VALUE:
     doc.add(new StringAndPayloadField("id", "id", new BytesRef(new byte[] {(byte)0x7f, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff})));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
       w.commit();
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(AlreadyClosedException.class, () -> {
       w.addDocument(doc);
-      fail("should have hit exc");
-    } catch (AlreadyClosedException ace) {
-      // expected
-    }
+    });
+
     dir.close();
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java
index 4b4aa38..922213f 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java
@@ -291,18 +291,13 @@ public class TestSlowFuzzyQuery extends LuceneTestCase {
     hits = searcher.search(query, 1000).scoreDocs;
     assertEquals(0, hits.length);
 
-    try {
-      query = new SlowFuzzyQuery(new Term("field", "student"), 1.1f);
-      fail("Expected IllegalArgumentException");
-    } catch (IllegalArgumentException e) {
-      // expecting exception
-    }
-    try {
-      query = new SlowFuzzyQuery(new Term("field", "student"), -0.1f);
-      fail("Expected IllegalArgumentException");
-    } catch (IllegalArgumentException e) {
-      // expecting exception
-    }
+    expectThrows(IllegalArgumentException.class, () -> {
+      new SlowFuzzyQuery(new Term("field", "student"), 1.1f);
+    });
+
+    expectThrows(IllegalArgumentException.class, () -> {
+      new SlowFuzzyQuery(new Term("field", "student"), -0.1f);
+    });
 
     reader.close();
     directory.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/sandbox/src/test/org/apache/lucene/search/TestTermAutomatonQuery.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/test/org/apache/lucene/search/TestTermAutomatonQuery.java b/lucene/sandbox/src/test/org/apache/lucene/search/TestTermAutomatonQuery.java
index b5e784e..392941d 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/search/TestTermAutomatonQuery.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/search/TestTermAutomatonQuery.java
@@ -357,12 +357,9 @@ public class TestTermAutomatonQuery extends LuceneTestCase {
     q.setAccept(s2, true);
     q.addAnyTransition(s0, s1);
     q.addTransition(s1, s2, "b");
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       q.finish();
-      fail("did not hit expected exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
   }
 
   public void testInvalidTrailWithAny() throws Exception {
@@ -373,12 +370,9 @@ public class TestTermAutomatonQuery extends LuceneTestCase {
     q.setAccept(s2, true);
     q.addTransition(s0, s1, "b");
     q.addAnyTransition(s1, s2);
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       q.finish();
-      fail("did not hit expected exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
   }
   
   public void testAnyFromTokenStream() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/spatial/src/test/org/apache/lucene/spatial/geopoint/search/TestGeoPointQuery.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/test/org/apache/lucene/spatial/geopoint/search/TestGeoPointQuery.java b/lucene/spatial/src/test/org/apache/lucene/spatial/geopoint/search/TestGeoPointQuery.java
index bdc4d86..13ce235 100644
--- a/lucene/spatial/src/test/org/apache/lucene/spatial/geopoint/search/TestGeoPointQuery.java
+++ b/lucene/spatial/src/test/org/apache/lucene/spatial/geopoint/search/TestGeoPointQuery.java
@@ -300,13 +300,11 @@ public class TestGeoPointQuery extends BaseGeoPointTestCase {
     assertEquals("smallTest failed", 2, td.totalHits);
   }
 
+  // GeoBoundingBox should not accept invalid lat/lon
   public void testInvalidBBox() throws Exception {
-    try {
+    expectThrows(Exception.class, () -> {
       bboxQuery(179.0, -92.0, 181.0, -91.0, 20);
-    } catch(Exception e) {
-      return;
-    }
-    throw new Exception("GeoBoundingBox should not accept invalid lat/lon");
+    });
   }
 
   public void testGeoDistanceQuery() throws Exception {
@@ -327,11 +325,10 @@ public class TestGeoPointQuery extends BaseGeoPointTestCase {
   }
 
   public void testTooBigRadius() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       geoDistanceQuery(0.0, 85.0, 4000000, 20);
-    } catch (IllegalArgumentException e) {
-      e.getMessage().contains("exceeds maxRadius");
-    }
+    });
+    assertTrue(expected.getMessage().contains("exceeds maxRadius"));
   }
 
   /**
@@ -347,13 +344,11 @@ public class TestGeoPointQuery extends BaseGeoPointTestCase {
     assertEquals("GeoDistanceQuery failed", 3, td.totalHits);
   }
 
+  // GeoDistanceQuery should not accept invalid lat/lon as origin
   public void testInvalidGeoDistanceQuery() throws Exception {
-    try {
+    expectThrows(Exception.class, () -> {
       geoDistanceQuery(181.0, 92.0, 120000, 20);
-    } catch (Exception e) {
-      return;
-    }
-    throw new Exception("GeoDistanceQuery should not accept invalid lat/lon as origin");
+    });
   }
 
   public void testMaxDistanceRangeQuery() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/spatial/src/test/org/apache/lucene/spatial/query/SpatialArgsParserTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/test/org/apache/lucene/spatial/query/SpatialArgsParserTest.java b/lucene/spatial/src/test/org/apache/lucene/spatial/query/SpatialArgsParserTest.java
index b7bd50d..93b95f3 100644
--- a/lucene/spatial/src/test/org/apache/lucene/spatial/query/SpatialArgsParserTest.java
+++ b/lucene/spatial/src/test/org/apache/lucene/spatial/query/SpatialArgsParserTest.java
@@ -47,19 +47,15 @@ public class SpatialArgsParserTest extends LuceneTestCase {
     out = parser.parse(arg, ctx);
     assertEquals(SpatialOperation.IsDisjointTo, out.getOperation());
 
-    try {
+    // spatial operations need args
+    expectThrows(Exception.class, () -> {
       parser.parse(SpatialOperation.IsDisjointTo + "[ ]", ctx);
-      fail("spatial operations need args");
-    }
-    catch (Exception ex) {//expected
-    }
+    });
 
-    try {
+    // unknown operation
+    expectThrows(Exception.class, () -> {
       parser.parse("XXXX(Envelope(-10, 10, 20, -20))", ctx);
-      fail("unknown operation!");
-    }
-    catch (Exception ex) {//expected
-    }
+    });
 
     assertAlias(SpatialOperation.IsWithin, "CoveredBy");
     assertAlias(SpatialOperation.IsWithin, "COVEREDBY");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java
index 02484ad..8428d84 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java
@@ -310,12 +310,8 @@ public class TestSpellChecker extends LuceneTestCase {
     assertEquals(2, similar.length);
     assertEquals(similar[0], "ninety");
     assertEquals(similar[1], "one");
-    try {
-      similar = spellChecker.suggestSimilar("tousand", 10, r, null,
-          SuggestMode.SUGGEST_WHEN_NOT_IN_INDEX);
-    } catch (NullPointerException e) {
-      assertTrue("threw an NPE, and it shouldn't have", false);
-    }
+    // should not throw exception
+    spellChecker.suggestSimilar("tousand", 10, r, null, SuggestMode.SUGGEST_WHEN_NOT_IN_INDEX);
   }
 
   private void checkJaroWinklerSuggestions() throws IOException {
@@ -361,39 +357,27 @@ public class TestSpellChecker extends LuceneTestCase {
     assertLastSearcherOpen(4);
     spellChecker.close();
     assertSearchersClosed();
-    try {
+
+    expectThrows(AlreadyClosedException.class, () -> {
       spellChecker.close();
-      fail("spellchecker was already closed");
-    } catch (AlreadyClosedException e) {
-      // expected
-    }
-    try {
+    });
+
+    expectThrows(AlreadyClosedException.class, () -> {
       checkCommonSuggestions(r);
-      fail("spellchecker was already closed");
-    } catch (AlreadyClosedException e) {
-      // expected
-    }
+    });
     
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       spellChecker.clearIndex();
-      fail("spellchecker was already closed");
-    } catch (AlreadyClosedException e) {
-      // expected
-    }
+    });
     
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       spellChecker.indexDictionary(new LuceneDictionary(r, field), newIndexWriterConfig(null), false);
-      fail("spellchecker was already closed");
-    } catch (AlreadyClosedException e) {
-      // expected
-    }
+    });
     
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       spellChecker.setSpellIndex(spellindex);
-      fail("spellchecker was already closed");
-    } catch (AlreadyClosedException e) {
-      // expected
-    }
+    });
+
     assertEquals(4, searchers.size());
     assertSearchersClosed();
     r.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
index 092eb95..44ecf88 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
@@ -41,6 +41,7 @@ import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.suggest.Input;
 import org.apache.lucene.search.suggest.InputArrayIterator;
 import org.apache.lucene.search.suggest.Lookup.LookupResult;
+import org.apache.lucene.store.AlreadyClosedException;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.IOUtils;
@@ -877,12 +878,11 @@ public class AnalyzingInfixSuggesterTest extends LuceneTestCase {
     Path tempDir = createTempDir("AIS_NRT_PERSIST_TEST");
     AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(newFSDirectory(tempDir), a, a, 3, false);
     Thread[] multiAddThreads = new Thread[10];
-    try {
+    // Cannot call refresh on an suggester when no docs are added to the index
+    expectThrows(IllegalStateException.class, () -> {
       suggester.refresh();
-      fail("Cannot call refresh on an suggester when no docs are added to the index");
-    } catch(IllegalStateException e) {
-      //Expected
-    }
+    });
+
     for(int i=0; i<10; i++) {
       multiAddThreads[i] = new Thread(new IndexDocument(suggester, keys[i]));
     }
@@ -903,12 +903,12 @@ public class AnalyzingInfixSuggesterTest extends LuceneTestCase {
     suggester.commit();
     suggester.close();
 
-    suggester = new AnalyzingInfixSuggester(newFSDirectory(tempDir), a, a, 3, false);
-    results = suggester.lookup(TestUtil.stringToCharSequence("python", random()), 10, true, false);
+    AnalyzingInfixSuggester suggester2 = new AnalyzingInfixSuggester(newFSDirectory(tempDir), a, a, 3, false);
+    results = suggester2.lookup(TestUtil.stringToCharSequence("python", random()), 10, true, false);
     assertEquals(1, results.size());
     assertEquals("python", results.get(0).key);
 
-    suggester.close();
+    suggester2.close();
     a.close();
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java
index 8890a82..7baa73c 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java
@@ -1224,18 +1224,13 @@ public class AnalyzingSuggesterTest extends LuceneTestCase {
     suggester.build(new InputArrayIterator(new Input[] {
         new Input("а где Люси?", 7),
     }));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       suggester.lookup("а\u001E", false, 3);
-      fail("should throw IllegalArgumentException");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalArgumentException.class, () -> {
       suggester.lookup("а\u001F", false, 3);
-      fail("should throw IllegalArgumentException");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
+    });
+
     IOUtils.close(a, tempDir);
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFreeTextSuggester.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFreeTextSuggester.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFreeTextSuggester.java
index 45a6855..4fd7773 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFreeTextSuggester.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFreeTextSuggester.java
@@ -105,12 +105,10 @@ public class TestFreeTextSuggester extends LuceneTestCase {
     );
     Analyzer analyzer = new MockAnalyzer(random());
     FreeTextSuggester sug = new FreeTextSuggester(analyzer);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       sug.build(new InputArrayIterator(keys));
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     analyzer.close();
   }
 
@@ -124,12 +122,10 @@ public class TestFreeTextSuggester extends LuceneTestCase {
     FreeTextSuggester sug = new FreeTextSuggester(analyzer);
     sug.build(new InputArrayIterator(keys));
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       sug.lookup("foo\u001eb", 10);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     analyzer.close();
   }
 
@@ -234,12 +230,10 @@ public class TestFreeTextSuggester extends LuceneTestCase {
     Analyzer a = new MockAnalyzer(random());
     FreeTextSuggester sug = new FreeTextSuggester(a, a, 2, (byte) 0x20);
     sug.build(new InputArrayIterator(keys));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       sug.lookup("", 10);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     a.close();
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilterFactory.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilterFactory.java
index b901c21..58b1892 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilterFactory.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilterFactory.java
@@ -69,37 +69,33 @@ public class TestSuggestStopFilterFactory extends BaseTokenStreamTestCase {
 
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       createFactory("bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 
   /** Test that bogus arguments result in exception */
   public void testBogusFormats() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       createFactory("words", "stop-snowball.txt",
           "format", "bogus");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      String msg = expected.getMessage();
-      assertTrue(msg, msg.contains("Unknown"));
-      assertTrue(msg, msg.contains("format"));
-      assertTrue(msg, msg.contains("bogus"));
-    }
-    try {
+    });
+
+    String msg = expected.getMessage();
+    assertTrue(msg, msg.contains("Unknown"));
+    assertTrue(msg, msg.contains("format"));
+    assertTrue(msg, msg.contains("bogus"));
+    
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       createFactory(
           // implicit default words file
           "format", "bogus");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      String msg = expected.getMessage();
-      assertTrue(msg, msg.contains("can not be specified"));
-      assertTrue(msg, msg.contains("format"));
-      assertTrue(msg, msg.contains("bogus"));
-    }
+    });
+    msg = expected.getMessage();
+    assertTrue(msg, msg.contains("can not be specified"));
+    assertTrue(msg, msg.contains("format"));
+    assertTrue(msg, msg.contains("bogus"));
   }                                             
 
   private SuggestStopFilterFactory createFactory(String ... params) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextQuery.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextQuery.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextQuery.java
index 1be3f37..35661ee 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextQuery.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextQuery.java
@@ -56,13 +56,11 @@ public class TestContextQuery extends LuceneTestCase {
 
   @Test
   public void testIllegalInnerQuery() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new ContextQuery(new ContextQuery(
           new PrefixCompletionQuery(new MockAnalyzer(random()), new Term("suggest_field", "sugg"))));
-      fail("should error out trying to nest a Context query within another Context query");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains(ContextQuery.class.getSimpleName()));
-    }
+    });
+    assertTrue(expected.getMessage().contains(ContextQuery.class.getSimpleName()));
   }
 
   @Test
@@ -125,11 +123,11 @@ public class TestContextQuery extends LuceneTestCase {
     DirectoryReader reader = iw.getReader();
     SuggestIndexSearcher suggestIndexSearcher = new SuggestIndexSearcher(reader);
     ContextQuery query = new ContextQuery(new PrefixCompletionQuery(analyzer, new Term("suggest_field", "ab")));
-    try {
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
       suggestIndexSearcher.suggest(query, 4);
-    } catch (IllegalStateException expected) {
-      assertTrue(expected.getMessage().contains("SuggestField"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("SuggestField"));
+
     reader.close();
     iw.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextSuggestField.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextSuggestField.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextSuggestField.java
index 4f23679..9f207f8 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextSuggestField.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextSuggestField.java
@@ -56,12 +56,10 @@ public class TestContextSuggestField extends LuceneTestCase {
 
   @Test
   public void testEmptySuggestion() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new ContextSuggestField("suggest_field", "", 1, "type1");
-      fail("no exception thrown when indexing zero length suggestion");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("value"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("value"));
   }
 
   @Test
@@ -73,22 +71,24 @@ public class TestContextSuggestField extends LuceneTestCase {
     Analyzer analyzer = new MockAnalyzer(random());
     Document document = new Document();
     try (RandomIndexWriter iw = new RandomIndexWriter(random(), dir, iwcWithSuggestField(analyzer, "name"))) {
-      document.add(new ContextSuggestField("name", "sugg", 1, charsRefBuilder.toString()));
-      iw.addDocument(document);
-      iw.commit();
-      fail("no exception thrown for context value containing CONTEXT_SEPARATOR:" + ContextSuggestField.CONTEXT_SEPARATOR);
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("[0x1d]"));
+      // exception should be thrown for context value containing CONTEXT_SEPARATOR
+      IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+        document.add(new ContextSuggestField("name", "sugg", 1, charsRefBuilder.toString()));
+        iw.addDocument(document);
+        iw.commit();
+      });
+      assertTrue(expected.getMessage().contains("[0x1d]"));
     }
     document.clear();
 
     try (RandomIndexWriter iw = new RandomIndexWriter(random(), dir, iwcWithSuggestField(analyzer, "name"))) {
-      document.add(new ContextSuggestField("name", charsRefBuilder.toString(), 1, "sugg"));
-      iw.addDocument(document);
-      iw.commit();
-      fail("no exception thrown for value containing CONTEXT_SEPARATOR:" + ContextSuggestField.CONTEXT_SEPARATOR);
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("[0x1d]"));
+      // exception should be thrown for context value containing CONTEXT_SEPARATOR
+      IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+        document.add(new ContextSuggestField("name", charsRefBuilder.toString(), 1, "sugg"));
+        iw.addDocument(document);
+        iw.commit();
+      });
+      assertTrue(expected.getMessage().contains("[0x1d]"));
     }
   }
 
@@ -135,10 +135,11 @@ public class TestContextSuggestField extends LuceneTestCase {
 
     try (RandomIndexWriter iw = new RandomIndexWriter(random(), dir,
         iwcWithSuggestField(analyzer, "suggest_field"))) {
-      iw.addDocument(document);
-      iw.commit();
-      fail("mixing suggest field types for same field name should error out");
-    } catch (IllegalArgumentException expected) {
+      // mixing suggest field types for same field name should error out
+      IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+        iw.addDocument(document);
+        iw.commit();
+      });
       assertTrue(expected.getMessage().contains("mixed types"));
     }
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
index 1e2b946..3d2759d 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
@@ -79,22 +79,18 @@ public class TestSuggestField extends LuceneTestCase {
 
   @Test
   public void testEmptySuggestion() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new SuggestField("suggest_field", "", 3);
-      fail("no exception thrown when indexing zero length suggestion");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("value"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("value"));
   }
 
   @Test
   public void testNegativeWeight() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new SuggestField("suggest_field", "sugg", -1);
-      fail("no exception thrown when indexing suggestion with negative weight");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("weight"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("weight"));
   }
 
   @Test
@@ -102,28 +98,22 @@ public class TestSuggestField extends LuceneTestCase {
     CharsRefBuilder charsRefBuilder = new CharsRefBuilder();
     charsRefBuilder.append("sugg");
     charsRefBuilder.setCharAt(2, (char) CompletionAnalyzer.SEP_LABEL);
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new SuggestField("name", charsRefBuilder.toString(), 1);
-      fail("no exception thrown for suggestion value containing SEP_LABEL:" + CompletionAnalyzer.SEP_LABEL);
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("[0x1f]"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("[0x1f]"));
 
     charsRefBuilder.setCharAt(2, (char) CompletionAnalyzer.HOLE_CHARACTER);
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       new SuggestField("name", charsRefBuilder.toString(), 1);
-      fail("no exception thrown for suggestion value containing HOLE_CHARACTER:" + CompletionAnalyzer.HOLE_CHARACTER);
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("[0x1e]"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("[0x1e]"));
 
     charsRefBuilder.setCharAt(2, (char) NRTSuggesterBuilder.END_BYTE);
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       new SuggestField("name", charsRefBuilder.toString(), 1);
-      fail("no exception thrown for suggestion value containing END_BYTE:" + NRTSuggesterBuilder.END_BYTE);
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("[0x0]"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("[0x0]"));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java
index 4f4a126..1006700 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java
@@ -52,12 +52,10 @@ public class BytesRefSortersTest extends LuceneTestCase {
     BytesRefIterator i2 = sorter.iterator();
     
     // Verify sorter contract.
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       sorter.add(new BytesRef(new byte [1]));
-      fail("expected contract violation.");
-    } catch (IllegalStateException e) {
-      // Expected.
-    }
+    });
+
     BytesRef spare1;
     BytesRef spare2;
     while ((spare1 = i1.next()) != null && (spare2 = i2.next()) != null) {


[47/53] [abbrv] lucene-solr git commit: SOLR-8711: follow-up removal of dependencies no longer used.

Posted by no...@apache.org.
SOLR-8711: follow-up removal of dependencies no longer used.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a77d67a9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a77d67a9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a77d67a9

Branch: refs/heads/apiv2
Commit: a77d67a926ea16b90b39c959099e27c1b749ba7f
Parents: cf96432
Author: Dawid Weiss <dw...@apache.org>
Authored: Tue Feb 23 10:49:23 2016 +0100
Committer: Dawid Weiss <dw...@apache.org>
Committed: Tue Feb 23 10:49:23 2016 +0100

----------------------------------------------------------------------
 lucene/ivy-versions.properties                  |   4 +-
 solr/contrib/clustering/ivy.xml                 |   3 -
 solr/licenses/attributes-binder-1.2.3.jar.sha1  |   1 -
 solr/licenses/attributes-binder-1.3.1.jar.sha1  |   1 +
 solr/licenses/mahout-collections-1.0.jar.sha1   |   1 -
 .../licenses/mahout-collections-LICENSE-ASL.txt | 202 -------------------
 solr/licenses/mahout-collections-NOTICE.txt     |  56 -----
 solr/licenses/mahout-math-0.6.jar.sha1          |   1 -
 solr/licenses/mahout-math-LICENSE-ASL.txt       | 202 -------------------
 solr/licenses/mahout-math-NOTICE.txt            |  56 -----
 10 files changed, 2 insertions(+), 525 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a77d67a9/lucene/ivy-versions.properties
----------------------------------------------------------------------
diff --git a/lucene/ivy-versions.properties b/lucene/ivy-versions.properties
index 0c2808b..2d630a2 100644
--- a/lucene/ivy-versions.properties
+++ b/lucene/ivy-versions.properties
@@ -171,8 +171,6 @@ org.apache.james.apache.mime4j.version = 0.7.2
 /org.apache.james/apache-mime4j-core = ${org.apache.james.apache.mime4j.version}
 /org.apache.james/apache-mime4j-dom = ${org.apache.james.apache.mime4j.version}
 
-/org.apache.mahout/mahout-collections = 1.0
-/org.apache.mahout/mahout-math = 0.6
 /org.apache.mina/mina-core = 2.0.0-M5
 /org.apache.mrunit/mrunit = 1.0.0
 
@@ -210,7 +208,7 @@ org.bouncycastle.version = 1.45
 /org.bouncycastle/bcmail-jdk15 = ${org.bouncycastle.version}
 /org.bouncycastle/bcprov-jdk15 = ${org.bouncycastle.version}
 
-/org.carrot2.attributes/attributes-binder = 1.2.3
+/org.carrot2.attributes/attributes-binder = 1.3.1
 /org.carrot2.shaded/carrot2-guava = 18.0
 
 /org.carrot2/carrot2-mini = 3.12.0

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a77d67a9/solr/contrib/clustering/ivy.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/clustering/ivy.xml b/solr/contrib/clustering/ivy.xml
index 450e9e2..a799c79 100644
--- a/solr/contrib/clustering/ivy.xml
+++ b/solr/contrib/clustering/ivy.xml
@@ -29,9 +29,6 @@
 
     <dependency org="org.simpleframework" name="simple-xml" rev="${/org.simpleframework/simple-xml}" conf="compile"/>
 
-    <dependency org="org.apache.mahout" name="mahout-math"        rev="${/org.apache.mahout/mahout-math}"        conf="compile"/>
-    <dependency org="org.apache.mahout" name="mahout-collections" rev="${/org.apache.mahout/mahout-collections}" conf="compile"/>
-
     <dependency org="com.fasterxml.jackson.core" name="jackson-annotations"  rev="${/com.fasterxml.jackson.core/jackson-annotations}"   conf="compile"/>
     <dependency org="com.fasterxml.jackson.core" name="jackson-databind"     rev="${/com.fasterxml.jackson.core/jackson-databind}"      conf="compile"/>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a77d67a9/solr/licenses/attributes-binder-1.2.3.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/attributes-binder-1.2.3.jar.sha1 b/solr/licenses/attributes-binder-1.2.3.jar.sha1
deleted file mode 100644
index 7433910..0000000
--- a/solr/licenses/attributes-binder-1.2.3.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-4dd69fb0bac1148a408d88a0e0ef5b92edcee70f

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a77d67a9/solr/licenses/attributes-binder-1.3.1.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/attributes-binder-1.3.1.jar.sha1 b/solr/licenses/attributes-binder-1.3.1.jar.sha1
new file mode 100644
index 0000000..0467976
--- /dev/null
+++ b/solr/licenses/attributes-binder-1.3.1.jar.sha1
@@ -0,0 +1 @@
+25e015cc2cfa2080aa53cca3449b1272da9065b4

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a77d67a9/solr/licenses/mahout-collections-1.0.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/mahout-collections-1.0.jar.sha1 b/solr/licenses/mahout-collections-1.0.jar.sha1
deleted file mode 100644
index bcbc1f8..0000000
--- a/solr/licenses/mahout-collections-1.0.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-7b900df4d03b7ac108a48424e5d1632aa0a2ebdf

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a77d67a9/solr/licenses/mahout-collections-LICENSE-ASL.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/mahout-collections-LICENSE-ASL.txt b/solr/licenses/mahout-collections-LICENSE-ASL.txt
deleted file mode 100644
index d645695..0000000
--- a/solr/licenses/mahout-collections-LICENSE-ASL.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a77d67a9/solr/licenses/mahout-collections-NOTICE.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/mahout-collections-NOTICE.txt b/solr/licenses/mahout-collections-NOTICE.txt
deleted file mode 100644
index cb1207d..0000000
--- a/solr/licenses/mahout-collections-NOTICE.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-
-Mahout Collections
-Copyright 2008-2010 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-
-==============================================================
- Apache Mahout
- Copyright 2009 The Apache Software Foundation
-==============================================================
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-Includes software from other Apache Software Foundation projects,
-including, but not limited to:
-  - Apache Lucene Java
-  - Apache Hadoop
-  - Apache Commons
-
-This product includes software developed by the Indiana University
-  Extreme! Lab (http://www.extreme.indiana.edu/).
-  Copyright (c) 2002 Extreme! Lab, Indiana University.
-
-This product includes examples code from the Watchmaker project   
-  https://watchmaker.dev.java.net/
-  Copyright (c) 2006-2009 Daniel W. Dyer.
-
-This product includes libraries developed by the Kosmos project (http://kosmosfs.sourceforge.net/)
- Copyright 2008 Quantcast Corp.
- Copyright 2007 Kosmix Corp.
-
-This product includes software developed by the Jets3T project (https://jets3t.dev.java.net/) 
-Copyright (c) 2008 James Murty
-
-This product includes libraries developed by the CGLib project (http://cglib.sourceforge.net/)
-Copyright (c) 2008, cglib
-
-This product includes a JUnit jar: http://junit.sourceforge.net/
-License: Common Public License - v 1.0 (http://junit.sourceforge.net/cpl-v10.html)
-Copyright (c) 2000-2006, www.hamcrest.org
-
-This product includes code from the XStream project (http://xstream.codehaus.org/)
-Copyright (c) 2003-2006, Joe Walnes
-Copyright (c) 2006-2007, XStream Committers
-
-This product includes tests written with EasyMock 
-Copyright 2001-2007 Tammo Freese (http://www.easymock.org/)
-
-This product uses the Breast Cancer Wisconsin (Diagnostic) Dataset from the
-UCI Machine Learning Repository [http://www.ics.uci.edu/~mlearn/MLRepository.html, http://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+(Diagnostic)]. 
-
-This product contains parts of the Bayesian Logic (BLOG) Inference Engine.
-Copyright (c) 2005, Regents of the University of California

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a77d67a9/solr/licenses/mahout-math-0.6.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/mahout-math-0.6.jar.sha1 b/solr/licenses/mahout-math-0.6.jar.sha1
deleted file mode 100644
index be99d93..0000000
--- a/solr/licenses/mahout-math-0.6.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-4958aae94b34bf42e9001c6e322f2fa299f53cde

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a77d67a9/solr/licenses/mahout-math-LICENSE-ASL.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/mahout-math-LICENSE-ASL.txt b/solr/licenses/mahout-math-LICENSE-ASL.txt
deleted file mode 100644
index d645695..0000000
--- a/solr/licenses/mahout-math-LICENSE-ASL.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a77d67a9/solr/licenses/mahout-math-NOTICE.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/mahout-math-NOTICE.txt b/solr/licenses/mahout-math-NOTICE.txt
deleted file mode 100644
index cb1207d..0000000
--- a/solr/licenses/mahout-math-NOTICE.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-
-Mahout Collections
-Copyright 2008-2010 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-
-==============================================================
- Apache Mahout
- Copyright 2009 The Apache Software Foundation
-==============================================================
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-Includes software from other Apache Software Foundation projects,
-including, but not limited to:
-  - Apache Lucene Java
-  - Apache Hadoop
-  - Apache Commons
-
-This product includes software developed by the Indiana University
-  Extreme! Lab (http://www.extreme.indiana.edu/).
-  Copyright (c) 2002 Extreme! Lab, Indiana University.
-
-This product includes examples code from the Watchmaker project   
-  https://watchmaker.dev.java.net/
-  Copyright (c) 2006-2009 Daniel W. Dyer.
-
-This product includes libraries developed by the Kosmos project (http://kosmosfs.sourceforge.net/)
- Copyright 2008 Quantcast Corp.
- Copyright 2007 Kosmix Corp.
-
-This product includes software developed by the Jets3T project (https://jets3t.dev.java.net/) 
-Copyright (c) 2008 James Murty
-
-This product includes libraries developed by the CGLib project (http://cglib.sourceforge.net/)
-Copyright (c) 2008, cglib
-
-This product includes a JUnit jar: http://junit.sourceforge.net/
-License: Common Public License - v 1.0 (http://junit.sourceforge.net/cpl-v10.html)
-Copyright (c) 2000-2006, www.hamcrest.org
-
-This product includes code from the XStream project (http://xstream.codehaus.org/)
-Copyright (c) 2003-2006, Joe Walnes
-Copyright (c) 2006-2007, XStream Committers
-
-This product includes tests written with EasyMock 
-Copyright 2001-2007 Tammo Freese (http://www.easymock.org/)
-
-This product uses the Breast Cancer Wisconsin (Diagnostic) Dataset from the
-UCI Machine Learning Repository [http://www.ics.uci.edu/~mlearn/MLRepository.html, http://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+(Diagnostic)]. 
-
-This product contains parts of the Bayesian Logic (BLOG) Inference Engine.
-Copyright (c) 2005, Regents of the University of California


[45/53] [abbrv] lucene-solr git commit: SOLR-7362

Posted by no...@apache.org.
SOLR-7362


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e069d310
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e069d310
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e069d310

Branch: refs/heads/apiv2
Commit: e069d31086116fa293f40155f9e96e0da9912c8f
Parents: a7a6663
Author: Noble Paul <no...@apache.org>
Authored: Tue Feb 23 11:21:59 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Tue Feb 23 11:21:59 2016 +0530

----------------------------------------------------------------------
 solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e069d310/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java b/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
index 5572f1c..d38122d 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java
@@ -38,7 +38,6 @@ import org.junit.Test;
 import static java.util.Arrays.asList;
 import static org.apache.solr.handler.TestSolrConfigHandlerCloud.compareValues;
 
-@LuceneTestCase.BadApple(bugUrl = "https://issues.apache.org/jira/browse/SOLR-7362")
 public class TestReqParamsAPI extends AbstractFullDistribZkTestBase {
   private List<RestTestHarness> restTestHarnesses = new ArrayList<>();
 


[21/53] [abbrv] lucene-solr git commit: Include 5.5.0 indices in TestBackwardsCompatibility

Posted by no...@apache.org.
Include 5.5.0 indices in TestBackwardsCompatibility


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/aef2ff55
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/aef2ff55
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/aef2ff55

Branch: refs/heads/apiv2
Commit: aef2ff55dd8499a8d5a58d785ca97069c084d179
Parents: 2b3529c
Author: Mike McCandless <mi...@apache.org>
Authored: Sun Feb 21 05:33:25 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Sun Feb 21 05:33:25 2016 -0500

----------------------------------------------------------------------
 .../lucene/index/TestBackwardsCompatibility.java   |   4 +++-
 .../org/apache/lucene/index/index.5.5.0-cfs.zip    | Bin 0 -> 24776 bytes
 .../org/apache/lucene/index/index.5.5.0-nocfs.zip  | Bin 0 -> 13756 bytes
 3 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/aef2ff55/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index 156f6f8..57b8d2d 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -233,7 +233,9 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
       "5.4.0-cfs",
       "5.4.0-nocfs",
       "5.4.1-cfs",
-      "5.4.1-nocfs"
+      "5.4.1-nocfs",
+      "5.5.0-cfs",
+      "5.5.0-nocfs"
   };
   
   final String[] unsupportedNames = {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/aef2ff55/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.0-cfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.0-cfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.0-cfs.zip
new file mode 100644
index 0000000..2e27d2e
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.0-cfs.zip differ

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/aef2ff55/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.0-nocfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.0-nocfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.0-nocfs.zip
new file mode 100644
index 0000000..44c3af2
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.0-nocfs.zip differ


[04/53] [abbrv] lucene-solr git commit: LUCENE-7037: Switch all exceptions tests to expectThrows()

Posted by no...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestParallelLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestParallelLeafReader.java b/lucene/core/src/test/org/apache/lucene/index/TestParallelLeafReader.java
index ff6fab6..31aa603 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestParallelLeafReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestParallelLeafReader.java
@@ -126,12 +126,10 @@ public class TestParallelLeafReader extends LuceneTestCase {
 
     ir1.close();
     
-    try {
+    // should already be closed because inner reader is closed!
+    expectThrows(AlreadyClosedException.class, () -> {
       pr.document(0);
-      fail("ParallelLeafReader should be already closed because inner reader was closed!");
-    } catch (AlreadyClosedException e) {
-      // pass
-    }
+    });
     
     // noop:
     pr.close();
@@ -154,21 +152,17 @@ public class TestParallelLeafReader extends LuceneTestCase {
     LeafReader ir1 = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dir1));
     LeafReader ir2 = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dir2));
 
-    try {
+    // indexes don't have the same number of documents
+    expectThrows(IllegalArgumentException.class, () -> {
       new ParallelLeafReader(ir1, ir2);
-      fail("didn't get exptected exception: indexes don't have same number of documents");
-    } catch (IllegalArgumentException e) {
-      // expected exception
-    }
+    });
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new ParallelLeafReader(random().nextBoolean(),
                                new LeafReader[] {ir1, ir2},
                                new LeafReader[] {ir1, ir2});
-      fail("didn't get expected exception: indexes don't have same number of documents");
-    } catch (IllegalArgumentException e) {
-      // expected exception
-    }
+    });
+
     // check RefCounts
     assertEquals(1, ir1.getRefCount());
     assertEquals(1, ir2.getRefCount());
@@ -230,14 +224,11 @@ public class TestParallelLeafReader extends LuceneTestCase {
     pr.close();
     
     // no main readers
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new ParallelLeafReader(true,
         new LeafReader[0],
         new LeafReader[] {ir1});
-      fail("didn't get expected exception: need a non-empty main-reader array");
-    } catch (IllegalArgumentException iae) {
-      // pass
-    }
+    });
     
     dir1.close();
     dir2.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestPayloadsOnVectors.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPayloadsOnVectors.java b/lucene/core/src/test/org/apache/lucene/index/TestPayloadsOnVectors.java
index 3b0117d..a90a5d2 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestPayloadsOnVectors.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestPayloadsOnVectors.java
@@ -133,12 +133,11 @@ public class TestPayloadsOnVectors extends LuceneTestCase {
     customType.setStoreTermVectorPayloads(true);
     customType.setStoreTermVectorOffsets(random().nextBoolean());
     doc.add(new Field("field", "foo", customType));
-    try {
+
+    expectThrows(IllegalArgumentException.class, () -> {
       writer.addDocument(doc);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
+
     writer.close();
     dir.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
index 0ace804..f4a6024 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
@@ -103,13 +103,12 @@ public class TestPersistentSnapshotDeletionPolicy extends TestSnapshotDeletionPo
   @Test
   public void testMissingSnapshots() throws Exception {
     Directory dir = newDirectory();
-    try {
+
+    expectThrows(IllegalStateException.class, () -> {
       new PersistentSnapshotDeletionPolicy(
                                            new KeepOnlyLastCommitDeletionPolicy(), dir, OpenMode.APPEND);
-      fail("did not hit expected exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
+
     dir.close();
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestPointValues.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPointValues.java b/lucene/core/src/test/org/apache/lucene/index/TestPointValues.java
index 0eb5e8f..3e1fe2d 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestPointValues.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestPointValues.java
@@ -60,12 +60,10 @@ public class TestPointValues extends LuceneTestCase {
     Document doc = new Document();
     doc.add(new BinaryPoint("dim", new byte[4]));
     doc.add(new BinaryPoint("dim", new byte[4], new byte[4]));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertEquals("cannot change point dimension count from 1 to 2 for field=\"dim\"", iae.getMessage());
-    }
+    });
+    assertEquals("cannot change point dimension count from 1 to 2 for field=\"dim\"", expected.getMessage());
     w.close();
     dir.close();
   }
@@ -77,14 +75,14 @@ public class TestPointValues extends LuceneTestCase {
     Document doc = new Document();
     doc.add(new BinaryPoint("dim", new byte[4]));
     w.addDocument(doc);
-    doc = new Document();
-    doc.add(new BinaryPoint("dim", new byte[4], new byte[4]));
-    try {
-      w.addDocument(doc);
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertEquals("cannot change point dimension count from 1 to 2 for field=\"dim\"", iae.getMessage());
-    }
+
+    Document doc2 = new Document();
+    doc2.add(new BinaryPoint("dim", new byte[4], new byte[4]));
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      w.addDocument(doc2);
+    });
+    assertEquals("cannot change point dimension count from 1 to 2 for field=\"dim\"", expected.getMessage());
+
     w.close();
     dir.close();
   }
@@ -97,14 +95,14 @@ public class TestPointValues extends LuceneTestCase {
     doc.add(new BinaryPoint("dim", new byte[4]));
     w.addDocument(doc);
     w.commit();
-    doc = new Document();
-    doc.add(new BinaryPoint("dim", new byte[4], new byte[4]));
-    try {
-      w.addDocument(doc);
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertEquals("cannot change point dimension count from 1 to 2 for field=\"dim\"", iae.getMessage());
-    }
+
+    Document doc2 = new Document();
+    doc2.add(new BinaryPoint("dim", new byte[4], new byte[4]));
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      w.addDocument(doc2);
+    });
+    assertEquals("cannot change point dimension count from 1 to 2 for field=\"dim\"", expected.getMessage());
+
     w.close();
     dir.close();
   }
@@ -118,16 +116,16 @@ public class TestPointValues extends LuceneTestCase {
     w.addDocument(doc);
     w.close();
     iwc = new IndexWriterConfig(new MockAnalyzer(random()));
-    w = new IndexWriter(dir, iwc);
-    doc = new Document();
-    doc.add(new BinaryPoint("dim", new byte[4], new byte[4]));
-    try {
-      w.addDocument(doc);
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertEquals("cannot change point dimension count from 1 to 2 for field=\"dim\"", iae.getMessage());
-    }
-    w.close();
+
+    IndexWriter w2 = new IndexWriter(dir, iwc);
+    Document doc2 = new Document();
+    doc2.add(new BinaryPoint("dim", new byte[4], new byte[4]));
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      w2.addDocument(doc2);
+    });
+    assertEquals("cannot change point dimension count from 1 to 2 for field=\"dim\"", expected.getMessage());
+
+    w2.close();
     dir.close();
   }
 
@@ -141,17 +139,16 @@ public class TestPointValues extends LuceneTestCase {
     w.close();
 
     Directory dir2 = newDirectory();
-    iwc = new IndexWriterConfig(new MockAnalyzer(random()));
-    w = new IndexWriter(dir2, iwc);
+    IndexWriter w2 = new IndexWriter(dir2, new IndexWriterConfig(new MockAnalyzer(random())));
     doc = new Document();
     doc.add(new BinaryPoint("dim", new byte[4], new byte[4]));
-    w.addDocument(doc);
-    try {
-      w.addIndexes(new Directory[] {dir});
-    } catch (IllegalArgumentException iae) {
-      assertEquals("cannot change point dimension count from 2 to 1 for field=\"dim\"", iae.getMessage());
-    }
-    IOUtils.close(w, dir, dir2);
+    w2.addDocument(doc);
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      w2.addIndexes(new Directory[] {dir});
+    });
+    assertEquals("cannot change point dimension count from 2 to 1 for field=\"dim\"", expected.getMessage());
+
+    IOUtils.close(w2, dir, dir2);
   }
 
   public void testIllegalDimChangeViaAddIndexesCodecReader() throws Exception {
@@ -164,18 +161,17 @@ public class TestPointValues extends LuceneTestCase {
     w.close();
 
     Directory dir2 = newDirectory();
-    iwc = new IndexWriterConfig(new MockAnalyzer(random()));
-    w = new IndexWriter(dir2, iwc);
+    IndexWriter w2 = new IndexWriter(dir2, new IndexWriterConfig(new MockAnalyzer(random())));
     doc = new Document();
     doc.add(new BinaryPoint("dim", new byte[4], new byte[4]));
-    w.addDocument(doc);
+    w2.addDocument(doc);
     DirectoryReader r = DirectoryReader.open(dir);
-    try {
-      w.addIndexes(new CodecReader[] {getOnlySegmentReader(r)});
-    } catch (IllegalArgumentException iae) {
-      assertEquals("cannot change point dimension count from 2 to 1 for field=\"dim\"", iae.getMessage());
-    }
-    IOUtils.close(r, w, dir, dir2);
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      w2.addIndexes(new CodecReader[] {getOnlySegmentReader(r)});
+    });
+    assertEquals("cannot change point dimension count from 2 to 1 for field=\"dim\"", expected.getMessage());
+
+    IOUtils.close(r, w2, dir, dir2);
   }
 
   public void testIllegalDimChangeViaAddIndexesSlowCodecReader() throws Exception {
@@ -189,17 +185,17 @@ public class TestPointValues extends LuceneTestCase {
 
     Directory dir2 = newDirectory();
     iwc = new IndexWriterConfig(new MockAnalyzer(random()));
-    w = new IndexWriter(dir2, iwc);
+    IndexWriter w2 = new IndexWriter(dir2, iwc);
     doc = new Document();
     doc.add(new BinaryPoint("dim", new byte[4], new byte[4]));
-    w.addDocument(doc);
+    w2.addDocument(doc);
     DirectoryReader r = DirectoryReader.open(dir);
-    try {
-      TestUtil.addIndexesSlowly(w, r);
-    } catch (IllegalArgumentException iae) {
-      assertEquals("cannot change point dimension count from 2 to 1 for field=\"dim\"", iae.getMessage());
-    }
-    IOUtils.close(r, w, dir, dir2);
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      TestUtil.addIndexesSlowly(w2, r);
+    });
+    assertEquals("cannot change point dimension count from 2 to 1 for field=\"dim\"", expected.getMessage());
+
+    IOUtils.close(r, w2, dir, dir2);
   }
 
   public void testIllegalNumBytesChangeOneDoc() throws Exception {
@@ -209,12 +205,11 @@ public class TestPointValues extends LuceneTestCase {
     Document doc = new Document();
     doc.add(new BinaryPoint("dim", new byte[4]));
     doc.add(new BinaryPoint("dim", new byte[6]));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertEquals("cannot change point numBytes from 4 to 6 for field=\"dim\"", iae.getMessage());
-    }
+    });
+    assertEquals("cannot change point numBytes from 4 to 6 for field=\"dim\"", expected.getMessage());
+
     w.close();
     dir.close();
   }
@@ -226,14 +221,14 @@ public class TestPointValues extends LuceneTestCase {
     Document doc = new Document();
     doc.add(new BinaryPoint("dim", new byte[4]));
     w.addDocument(doc);
-    doc = new Document();
-    doc.add(new BinaryPoint("dim", new byte[6]));
-    try {
-      w.addDocument(doc);
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertEquals("cannot change point numBytes from 4 to 6 for field=\"dim\"", iae.getMessage());
-    }
+
+    Document doc2 = new Document();
+    doc2.add(new BinaryPoint("dim", new byte[6]));
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      w.addDocument(doc2);
+    });
+    assertEquals("cannot change point numBytes from 4 to 6 for field=\"dim\"", expected.getMessage());
+
     w.close();
     dir.close();
   }
@@ -246,14 +241,14 @@ public class TestPointValues extends LuceneTestCase {
     doc.add(new BinaryPoint("dim", new byte[4]));
     w.addDocument(doc);
     w.commit();
-    doc = new Document();
-    doc.add(new BinaryPoint("dim", new byte[6]));
-    try {
-      w.addDocument(doc);
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertEquals("cannot change point numBytes from 4 to 6 for field=\"dim\"", iae.getMessage());
-    }
+    
+    Document doc2 = new Document();
+    doc2.add(new BinaryPoint("dim", new byte[6]));
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      w.addDocument(doc2);
+    });
+    assertEquals("cannot change point numBytes from 4 to 6 for field=\"dim\"", expected.getMessage());
+
     w.close();
     dir.close();
   }
@@ -266,17 +261,18 @@ public class TestPointValues extends LuceneTestCase {
     doc.add(new BinaryPoint("dim", new byte[4]));
     w.addDocument(doc);
     w.close();
+    
     iwc = new IndexWriterConfig(new MockAnalyzer(random()));
-    w = new IndexWriter(dir, iwc);
-    doc = new Document();
-    doc.add(new BinaryPoint("dim", new byte[6]));
-    try {
-      w.addDocument(doc);
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertEquals("cannot change point numBytes from 4 to 6 for field=\"dim\"", iae.getMessage());
-    }
-    w.close();
+    IndexWriter w2 = new IndexWriter(dir, iwc);
+    Document doc2 = new Document();
+    doc2.add(new BinaryPoint("dim", new byte[6]));
+    
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      w2.addDocument(doc2);
+    });
+    assertEquals("cannot change point numBytes from 4 to 6 for field=\"dim\"", expected.getMessage());
+
+    w2.close();
     dir.close();
   }
 
@@ -291,16 +287,16 @@ public class TestPointValues extends LuceneTestCase {
 
     Directory dir2 = newDirectory();
     iwc = new IndexWriterConfig(new MockAnalyzer(random()));
-    w = new IndexWriter(dir2, iwc);
+    IndexWriter w2 = new IndexWriter(dir2, iwc);
     doc = new Document();
     doc.add(new BinaryPoint("dim", new byte[6]));
-    w.addDocument(doc);
-    try {
-      w.addIndexes(new Directory[] {dir});
-    } catch (IllegalArgumentException iae) {
-      assertEquals("cannot change point numBytes from 6 to 4 for field=\"dim\"", iae.getMessage());
-    }
-    IOUtils.close(w, dir, dir2);
+    w2.addDocument(doc);
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      w2.addIndexes(new Directory[] {dir});
+    });
+    assertEquals("cannot change point numBytes from 6 to 4 for field=\"dim\"", expected.getMessage());
+
+    IOUtils.close(w2, dir, dir2);
   }
 
   public void testIllegalNumBytesChangeViaAddIndexesCodecReader() throws Exception {
@@ -314,17 +310,17 @@ public class TestPointValues extends LuceneTestCase {
 
     Directory dir2 = newDirectory();
     iwc = new IndexWriterConfig(new MockAnalyzer(random()));
-    w = new IndexWriter(dir2, iwc);
+    IndexWriter w2 = new IndexWriter(dir2, iwc);
     doc = new Document();
     doc.add(new BinaryPoint("dim", new byte[6]));
-    w.addDocument(doc);
+    w2.addDocument(doc);
     DirectoryReader r = DirectoryReader.open(dir);
-    try {
-      w.addIndexes(new CodecReader[] {getOnlySegmentReader(r)});
-    } catch (IllegalArgumentException iae) {
-      assertEquals("cannot change point numBytes from 6 to 4 for field=\"dim\"", iae.getMessage());
-    }
-    IOUtils.close(r, w, dir, dir2);
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      w2.addIndexes(new CodecReader[] {getOnlySegmentReader(r)});
+    });
+    assertEquals("cannot change point numBytes from 6 to 4 for field=\"dim\"", expected.getMessage());
+
+    IOUtils.close(r, w2, dir, dir2);
   }
 
   public void testIllegalNumBytesChangeViaAddIndexesSlowCodecReader() throws Exception {
@@ -338,17 +334,17 @@ public class TestPointValues extends LuceneTestCase {
 
     Directory dir2 = newDirectory();
     iwc = new IndexWriterConfig(new MockAnalyzer(random()));
-    w = new IndexWriter(dir2, iwc);
+    IndexWriter w2 = new IndexWriter(dir2, iwc);
     doc = new Document();
     doc.add(new BinaryPoint("dim", new byte[6]));
-    w.addDocument(doc);
+    w2.addDocument(doc);
     DirectoryReader r = DirectoryReader.open(dir);
-    try {
-      TestUtil.addIndexesSlowly(w, r);
-    } catch (IllegalArgumentException iae) {
-      assertEquals("cannot change point numBytes from 6 to 4 for field=\"dim\"", iae.getMessage());
-    }
-    IOUtils.close(r, w, dir, dir2);
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      TestUtil.addIndexesSlowly(w2, r);
+    });
+    assertEquals("cannot change point numBytes from 6 to 4 for field=\"dim\"", expected.getMessage());
+
+    IOUtils.close(r, w2, dir, dir2);
   }
 
   public void testIllegalTooManyBytes() throws Exception {
@@ -357,15 +353,13 @@ public class TestPointValues extends LuceneTestCase {
     IndexWriter w = new IndexWriter(dir, iwc);
     Document doc = new Document();
     doc.add(new BinaryPoint("dim", new byte[PointValues.MAX_NUM_BYTES+1]));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    doc = new Document();
-    doc.add(new IntPoint("dim", 17));
-    w.addDocument(doc);
+    });
+
+    Document doc2 = new Document();
+    doc2.add(new IntPoint("dim", 17));
+    w.addDocument(doc2);
     w.close();
     dir.close();
   }
@@ -380,15 +374,13 @@ public class TestPointValues extends LuceneTestCase {
       values[i] = new byte[4];
     }
     doc.add(new BinaryPoint("dim", values));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    doc = new Document();
-    doc.add(new IntPoint("dim", 17));
-    w.addDocument(doc);
+    });
+
+    Document doc2 = new Document();
+    doc2.add(new IntPoint("dim", 17));
+    w.addDocument(doc2);
     w.close();
     dir.close();
   }
@@ -441,69 +433,49 @@ public class TestPointValues extends LuceneTestCase {
 
   public void testInvalidIntPointUsage() throws Exception {
     IntPoint field = new IntPoint("field", 17, 42);
-    try {
-      field.setIntValue(14);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // good
-    }
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
+      field.setIntValue(14);
+    });
+    
+    expectThrows(IllegalStateException.class, () -> {
       field.numericValue();
-      fail("did not hit exception");
-    } catch (IllegalStateException ise) {
-      // good
-    }
+    });
   }
 
   public void testInvalidLongPointUsage() throws Exception {
     LongPoint field = new LongPoint("field", 17, 42);
-    try {
+
+    expectThrows(IllegalArgumentException.class, () -> {
       field.setLongValue(14);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // good
-    }
+    });
 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       field.numericValue();
-      fail("did not hit exception");
-    } catch (IllegalStateException ise) {
-      // good
-    }
+    });
   }
 
   public void testInvalidFloatPointUsage() throws Exception {
     FloatPoint field = new FloatPoint("field", 17, 42);
-    try {
+
+    expectThrows(IllegalArgumentException.class, () -> {
       field.setFloatValue(14);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // good
-    }
+    });
 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       field.numericValue();
-      fail("did not hit exception");
-    } catch (IllegalStateException ise) {
-      // good
-    }
+    });
   }
 
   public void testInvalidDoublePointUsage() throws Exception {
     DoublePoint field = new DoublePoint("field", 17, 42);
-    try {
+
+    expectThrows(IllegalArgumentException.class, () -> {
       field.setDoubleValue(14);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // good
-    }
+    });
 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       field.numericValue();
-      fail("did not hit exception");
-    } catch (IllegalStateException ise) {
-      // good
-    }
+    });
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java b/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java
index bf01c8a..aff0bd9 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java
@@ -402,48 +402,36 @@ public class TestPostingsOffsets extends LuceneTestCase {
   
   // NOTE: the next two tests aren't that good as we need an EvilToken...
   public void testNegativeOffsets() throws Exception {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       checkTokens(new Token[] { 
           makeToken("foo", 1, -1, -1)
       });
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //expected
-    }
+    });
   }
   
   public void testIllegalOffsets() throws Exception {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       checkTokens(new Token[] { 
           makeToken("foo", 1, 1, 0)
       });
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //expected
-    }
+    });
   }
   
   public void testIllegalOffsetsAcrossFieldInstances() throws Exception {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       checkTokens(new Token[] { makeToken("use", 1, 150, 160) }, 
                   new Token[] { makeToken("use", 1, 50, 60) });
-      fail();
-    } catch (IllegalArgumentException expected) {
-      //expected
-    }
+    });
   }
    
   public void testBackwardsOffsets() throws Exception {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       checkTokens(new Token[] { 
          makeToken("foo", 1, 0, 3),
          makeToken("foo", 1, 4, 7),
          makeToken("foo", 0, 3, 6)
       });
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
   }
   
   public void testStackedTokens() throws Exception {
@@ -471,14 +459,14 @@ public class TestPostingsOffsets extends LuceneTestCase {
     // add good document
     Document doc = new Document();
     iw.addDocument(doc);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       FieldType ft = new FieldType(TextField.TYPE_NOT_STORED);
       ft.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS);
       doc.add(new Field("foo", "bar", ft));
       doc.add(new Field("foo", "bar", ft));
       iw.addDocument(doc);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {}
+    });
+    iw.commit();
     iw.close();
 
     // make sure we see our good doc

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java b/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java
index e43bc0e..f008afe 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java
@@ -204,25 +204,21 @@ public class TestSegmentReader extends LuceneTestCase {
   
   public void testOutOfBoundsAccess() throws IOException {
     int numDocs = reader.maxDoc();
-    try {
+
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       reader.document(-1);
-      fail();
-    } catch (IndexOutOfBoundsException expected) {}
+    });
     
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       reader.getTermVectors(-1);
-      fail();
-    } catch (IndexOutOfBoundsException expected) {}
+    });
     
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       reader.document(numDocs);
-      fail();
-    } catch (IndexOutOfBoundsException expected) {}
+    });
     
-    try {
+    expectThrows(IndexOutOfBoundsException.class, () -> {
       reader.getTermVectors(numDocs);
-      fail();
-    } catch (IndexOutOfBoundsException expected) {}
-    
+    });    
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
index ad87ed8..c72e26d 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
@@ -113,13 +113,10 @@ public class TestSnapshotDeletionPolicy extends LuceneTestCase {
         .setMaxBufferedDocs(2));
 
     // Verify we catch misuse:
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       dp.snapshot();
-      fail("did not hit exception");
-    } catch(IllegalStateException ise) {
-      // expected
-    }
-    dp = (SnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
+    });
+
     writer.commit();
     
     final Thread t = new Thread() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java b/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java
index fad0755..4b2a060 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java
@@ -336,7 +336,7 @@ public class TestTermVectorsReader extends LuceneTestCase {
     reader.close();
   }
 
-  public void testIllegalIndexableField() throws Exception {
+  public void testIllegalPayloadsWithoutPositions() throws Exception {
     Directory dir = newDirectory();
     MockAnalyzer a = new MockAnalyzer(random());
     a.setEnableChecks(false);
@@ -346,116 +346,149 @@ public class TestTermVectorsReader extends LuceneTestCase {
     ft.setStoreTermVectorPayloads(true);
     Document doc = new Document();
     doc.add(new Field("field", "value", ft));
-    try {
-      w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // Expected
-      assertEquals("cannot index term vector payloads without term vector positions (field=\"field\")", iae.getMessage());
-    }
 
-    ft = new FieldType(TextField.TYPE_NOT_STORED);
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+      w.addDocument(doc);
+    });
+    assertEquals("cannot index term vector payloads without term vector positions (field=\"field\")", expected.getMessage());
+    
+    w.close();
+    dir.close();
+  }
+  
+  public void testIllegalOffsetsWithoutVectors() throws Exception {
+    Directory dir = newDirectory();
+    MockAnalyzer a = new MockAnalyzer(random());
+    a.setEnableChecks(false);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, a);
+    FieldType ft = new FieldType(TextField.TYPE_NOT_STORED);
     ft.setStoreTermVectors(false);
     ft.setStoreTermVectorOffsets(true);
-    doc = new Document();
+    Document doc = new Document();
     doc.add(new Field("field", "value", ft));
-    try {
+    
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // Expected
-      assertEquals("cannot index term vector offsets when term vectors are not indexed (field=\"field\")", iae.getMessage());
-    }
+    });
+    assertEquals("cannot index term vector offsets when term vectors are not indexed (field=\"field\")", expected.getMessage());
+    
+    w.close();
+    dir.close();
+  }
 
-    ft = new FieldType(TextField.TYPE_NOT_STORED);
+  public void testIllegalPositionsWithoutVectors() throws Exception {
+    Directory dir = newDirectory();
+    MockAnalyzer a = new MockAnalyzer(random());
+    a.setEnableChecks(false);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, a);
+    FieldType ft = new FieldType(TextField.TYPE_NOT_STORED);
     ft.setStoreTermVectors(false);
     ft.setStoreTermVectorPositions(true);
-    doc = new Document();
+    Document doc = new Document();
     doc.add(new Field("field", "value", ft));
-    try {
-      w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // Expected
-      assertEquals("cannot index term vector positions when term vectors are not indexed (field=\"field\")", iae.getMessage());
-    }
 
-    ft = new FieldType(TextField.TYPE_NOT_STORED);
-    ft.setStoreTermVectors(false);
-    ft.setStoreTermVectorPayloads(true);
-    doc = new Document();
-    doc.add(new Field("field", "value", ft));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // Expected
-      assertEquals("cannot index term vector payloads when term vectors are not indexed (field=\"field\")", iae.getMessage());
-    }
+    });
+    assertEquals("cannot index term vector positions when term vectors are not indexed (field=\"field\")", expected.getMessage());
+    
+    w.close();
+    dir.close();
+  }
 
-    ft = new FieldType(TextField.TYPE_NOT_STORED);
-    ft.setStoreTermVectors(true);
+  public void testIllegalVectorPayloadsWithoutVectors() throws Exception {
+    Directory dir = newDirectory();
+    MockAnalyzer a = new MockAnalyzer(random());
+    a.setEnableChecks(false);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, a);
+    FieldType ft = new FieldType(TextField.TYPE_NOT_STORED);
+    ft.setStoreTermVectors(false);
     ft.setStoreTermVectorPayloads(true);
-    doc = new Document();
+    Document doc = new Document();
     doc.add(new Field("field", "value", ft));
-    try {
+    
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // Expected
-      assertEquals("cannot index term vector payloads without term vector positions (field=\"field\")", iae.getMessage());
-    }
+    });
+    assertEquals("cannot index term vector payloads when term vectors are not indexed (field=\"field\")", expected.getMessage());
+    
+    w.close();
+    dir.close();
+  }
 
-    ft = new FieldType(StoredField.TYPE);
+  public void testIllegalVectorsWithoutIndexed() throws Exception {
+    Directory dir = newDirectory();
+    MockAnalyzer a = new MockAnalyzer(random());
+    a.setEnableChecks(false);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, a);
+    FieldType ft = new FieldType(StoredField.TYPE);
     ft.setStoreTermVectors(true);
-    doc = new Document();
+    Document doc = new Document();
     doc.add(new Field("field", "value", ft));
-    try {
+    
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // Expected
-      assertEquals("cannot store term vectors for a field that is not indexed (field=\"field\")", iae.getMessage());
-    }
+    });
+    assertEquals("cannot store term vectors for a field that is not indexed (field=\"field\")", expected.getMessage());
+    
+    w.close();
+    dir.close();
+  }
 
-    ft = new FieldType(StoredField.TYPE);
+  public void testIllegalVectorPositionsWithoutIndexed() throws Exception {
+    Directory dir = newDirectory();
+    MockAnalyzer a = new MockAnalyzer(random());
+    a.setEnableChecks(false);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, a);
+    FieldType ft = new FieldType(StoredField.TYPE);
     ft.setStoreTermVectorPositions(true);
-    doc = new Document();
+    Document doc = new Document();
     doc.add(new Field("field", "value", ft));
-    try {
+    
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // Expected
-      assertEquals("cannot store term vector positions for a field that is not indexed (field=\"field\")", iae.getMessage());
-    }
+    });
+    assertEquals("cannot store term vector positions for a field that is not indexed (field=\"field\")", expected.getMessage());
+    
+    w.close();
+    dir.close();
+  }
 
-    ft = new FieldType(StoredField.TYPE);
+  public void testIllegalVectorOffsetsWithoutIndexed() throws Exception {
+    Directory dir = newDirectory();
+    MockAnalyzer a = new MockAnalyzer(random());
+    a.setEnableChecks(false);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, a);
+    FieldType ft = new FieldType(StoredField.TYPE);
     ft.setStoreTermVectorOffsets(true);
-    doc = new Document();
+    Document doc = new Document();
     doc.add(new Field("field", "value", ft));
-    try {
+    
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // Expected
-      assertEquals("cannot store term vector offsets for a field that is not indexed (field=\"field\")", iae.getMessage());
-    }
-
-    ft = new FieldType(StoredField.TYPE);
+    });
+    assertEquals("cannot store term vector offsets for a field that is not indexed (field=\"field\")", expected.getMessage());
+    
+    w.close();
+    dir.close();
+  }
+  
+  public void testIllegalVectorPayloadsWithoutIndexed() throws Exception {
+    Directory dir = newDirectory();
+    MockAnalyzer a = new MockAnalyzer(random());
+    a.setEnableChecks(false);
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, a);
+    FieldType ft = new FieldType(StoredField.TYPE);
     ft.setStoreTermVectorPayloads(true);
-    doc = new Document();
+    Document doc = new Document();
     doc.add(new Field("field", "value", ft));
-    try {
+    
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // Expected
-      assertEquals("cannot store term vector payloads for a field that is not indexed (field=\"field\")", iae.getMessage());
-    }
+    });
+    assertEquals("cannot store term vector payloads for a field that is not indexed (field=\"field\")", expected.getMessage());
 
     w.close();
-    
     dir.close();
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java
index f1ce915..11f1503 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java
@@ -635,13 +635,11 @@ public class TestTermVectorsWriter extends LuceneTestCase {
     doc.add(new Field("field", "value2", ft2));
     
     // ensure broken doc hits exception
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       iw.addDocument(doc);
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      assertNotNull(iae.getMessage());
-      assertTrue(iae.getMessage().startsWith("all instances of a given field name must have the same term vectors settings"));
-    }
+    });
+    assertNotNull(expected.getMessage());
+    assertTrue(expected.getMessage().startsWith("all instances of a given field name must have the same term vectors settings"));
     
     // ensure good docs are still ok
     IndexReader ir = iw.getReader();
@@ -665,12 +663,11 @@ public class TestTermVectorsWriter extends LuceneTestCase {
     ft.setStoreTermVectors(true);
     ft.freeze();
     doc.add(new Field("field", "value", ft));
-    try {
+
+    expectThrows(IllegalArgumentException.class, () -> {
       iw.addDocument(doc);
-      fail("should have hit exc");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     IndexReader r = DirectoryReader.open(iw);
 
     // Make sure the exc didn't lose our first document:

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
index 1c83e06..c8a87d3 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java
@@ -170,12 +170,9 @@ public class TestTieredMergePolicy extends BaseMergePolicyTestCase {
     tmp.setMaxMergedSegmentMB(Long.MAX_VALUE/1024/1024.);
     assertEquals(Long.MAX_VALUE/1024/1024., tmp.getMaxMergedSegmentMB(), EPSILON*Long.MAX_VALUE);
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       tmp.setMaxMergedSegmentMB(-2.0);
-      fail("Didn't throw IllegalArgumentException");
-    } catch (IllegalArgumentException iae) {
-      // pass
-    }
+    });
     
     tmp.setFloorSegmentMB(2.0);
     assertEquals(2.0, tmp.getFloorSegmentMB(), EPSILON);
@@ -186,12 +183,9 @@ public class TestTieredMergePolicy extends BaseMergePolicyTestCase {
     tmp.setFloorSegmentMB(Long.MAX_VALUE/1024/1024.);
     assertEquals(Long.MAX_VALUE/1024/1024., tmp.getFloorSegmentMB(), EPSILON*Long.MAX_VALUE);
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       tmp.setFloorSegmentMB(-2.0);
-      fail("Didn't throw IllegalArgumentException");
-    } catch (IllegalArgumentException iae) {
-      // pass
-    }
+    });
     
     tmp.setMaxCFSSegmentSizeMB(2.0);
     assertEquals(2.0, tmp.getMaxCFSSegmentSizeMB(), EPSILON);
@@ -202,12 +196,9 @@ public class TestTieredMergePolicy extends BaseMergePolicyTestCase {
     tmp.setMaxCFSSegmentSizeMB(Long.MAX_VALUE/1024/1024.);
     assertEquals(Long.MAX_VALUE/1024/1024., tmp.getMaxCFSSegmentSizeMB(), EPSILON*Long.MAX_VALUE);
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       tmp.setMaxCFSSegmentSizeMB(-2.0);
-      fail("Didn't throw IllegalArgumentException");
-    } catch (IllegalArgumentException iae) {
-      // pass
-    }
+    });
     
     // TODO: Add more checks for other non-double setters!
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/MultiCollectorTest.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/MultiCollectorTest.java b/lucene/core/src/test/org/apache/lucene/search/MultiCollectorTest.java
index fe63741..de97954 100644
--- a/lucene/core/src/test/org/apache/lucene/search/MultiCollectorTest.java
+++ b/lucene/core/src/test/org/apache/lucene/search/MultiCollectorTest.java
@@ -59,12 +59,9 @@ public class MultiCollectorTest extends LuceneTestCase {
   @Test
   public void testNullCollectors() throws Exception {
     // Tests that the collector rejects all null collectors.
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       MultiCollector.wrap(null, null);
-      fail("only null collectors should not be supported");
-    } catch (IllegalArgumentException e) {
-      // expected
-    }
+    });
 
     // Tests that the collector handles some null collectors well. If it
     // doesn't, an NPE would be thrown.
@@ -141,12 +138,9 @@ public class MultiCollectorTest extends LuceneTestCase {
     
     final LeafReaderContext ctx = reader.leaves().get(0);
 
-    try {
+    expectThrows(AssertionError.class, () -> {
       collector(false, ScoreCachingWrappingScorer.class).getLeafCollector(ctx).setScorer(new FakeScorer());
-      fail("The collector was configured to expect a ScoreCachingWrappingScorer and did not fail when pass in a FakeScorer");
-    } catch (AssertionError e) {
-      // expected
-    }
+    });
 
     // no collector needs scores => no caching
     Collector c1 = collector(false, FakeScorer.class);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java
index 5e16bcb..3970355 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java
@@ -189,12 +189,9 @@ public class TestBooleanQuery extends LuceneTestCase {
   }
 
   public void testException() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       BooleanQuery.setMaxClauseCount(0);
-      fail();
-    } catch (IllegalArgumentException e) {
-      // okay
-    }
+    });
   }
 
   // LUCENE-1630

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java
index 1886919..89304ba 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java
@@ -99,12 +99,9 @@ public class TestCachingCollector extends LuceneTestCase {
     
     assertFalse("CachingCollector should not be cached due to low memory limit", cc.isCached());
     
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       cc.replay(new NoOpCollector());
-      fail("replay should fail if CachingCollector is not cached");
-    } catch (IllegalStateException e) {
-      // expected
-    }
+    });
   }
   
   public void testCachedArraysAllocation() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java b/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java
index 2ed7c43..8217eb1 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java
@@ -422,12 +422,10 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc
       }
       };
 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       new SearcherManager(w.w, false, false, theEvilOne);
-      fail("didn't hit expected exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
+
     w.close();
     other.close();
     dir.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java
index 7f36902..79dc157 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java
@@ -449,52 +449,39 @@ public class TestFuzzyQuery extends LuceneTestCase {
     assertEquals(1, hits.length);
     assertEquals("foobar", searcher.doc(hits[0].doc).get("field"));
     
-    try {
-      q = new FuzzyQuery(new Term("field", "t"), 3);
-      fail();
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
-      
+    expectThrows(IllegalArgumentException.class, () -> {
+      new FuzzyQuery(new Term("field", "t"), 3);
+    });
+
     reader.close();
     index.close();
   }
 
   public void testValidation() {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new FuzzyQuery(new Term("field", "foo"), -1, 0, 1, false);
-      fail("Expected error for illegal max edits value");
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("maxEdits"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("maxEdits"));
 
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       new FuzzyQuery(new Term("field", "foo"), LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE + 1, 0, 1, false);
-      fail("Expected error for illegal max edits value");
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("maxEdits must be between"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("maxEdits must be between"));
 
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       new FuzzyQuery(new Term("field", "foo"), 1, -1, 1, false);
-      fail("Expected error for illegal prefix length value");
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("prefixLength cannot be negative"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("prefixLength cannot be negative"));
 
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       new FuzzyQuery(new Term("field", "foo"), 1, 0, -1, false);
-      fail("Expected error for illegal max expansions value");
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("maxExpansions must be positive"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("maxExpansions must be positive"));
 
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       new FuzzyQuery(new Term("field", "foo"), 1, 0, -1, false);
-      fail("Expected error for illegal max expansions value");
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("maxExpansions must be positive"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("maxExpansions must be positive"));
   }
   
   private void addDoc(String text, RandomIndexWriter writer) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java b/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java
index c561d64..e7cdfcd 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java
@@ -129,14 +129,11 @@ public class TestIndexSearcher extends LuceneTestCase {
     w.close();
 
     IndexSearcher s = new IndexSearcher(r);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       s.searchAfter(new ScoreDoc(r.maxDoc(), 0.54f), new MatchAllDocsQuery(), 10);
-      fail("should have hit IllegalArgumentException when searchAfter exceeds maxDoc");
-    } catch (IllegalArgumentException e) {
-      // ok
-    } finally {
-      IOUtils.close(r, dir);
-    }
+    });
+
+    IOUtils.close(r, dir);
   }
 
   public void testCount() throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestMultiCollector.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiCollector.java
index 4ef54da..3b4e1bd 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestMultiCollector.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiCollector.java
@@ -152,12 +152,9 @@ public class TestMultiCollector extends LuceneTestCase {
     assertFalse(setScorerCalled1.get());
     assertTrue(setScorerCalled2.get());
 
-    try {
+    expectThrows(CollectionTerminatedException.class, () -> {
       leafCollector.collect(1);
-      fail();
-    } catch (CollectionTerminatedException e) {
-      // expected
-    }
+    });
 
     setScorerCalled1.set(false);
     setScorerCalled2.set(false);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
index d2fec0e..5c81fed 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
@@ -125,13 +125,10 @@ public class TestMultiPhraseQuery extends LuceneTestCase {
                                     // foobar pizza
     
     MultiPhraseQuery query4 = new MultiPhraseQuery();
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       query4.add(new Term("field1", "foo"));
       query4.add(new Term("field2", "foobar"));
-      fail();
-    } catch (IllegalArgumentException e) {
-      // okay, all terms must belong to the same field
-    }
+    });
     
     writer.close();
     reader.close();
@@ -571,12 +568,9 @@ public class TestMultiPhraseQuery extends LuceneTestCase {
     MultiPhraseQuery query = new MultiPhraseQuery();
     query.add(new Term("field", "two"));
     query.add(new Term("field", "one"));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       query.setSlop(-2);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected exception
-    }
+    });
   }
   
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestMultiTermQueryRewrites.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiTermQueryRewrites.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiTermQueryRewrites.java
index 3772d45..458dd68 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestMultiTermQueryRewrites.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiTermQueryRewrites.java
@@ -215,12 +215,12 @@ public class TestMultiTermQueryRewrites extends LuceneTestCase {
     final MultiTermQuery mtq = TermRangeQuery.newStringRange("data", "2", "7", true, true);
     mtq.setRewriteMethod(method);
     try {
-      multiSearcherDupls.rewrite(mtq);
-      fail("Should throw BooleanQuery.TooManyClauses");
-    } catch (BooleanQuery.TooManyClauses e) {
+      BooleanQuery.TooManyClauses expected = expectThrows(BooleanQuery.TooManyClauses.class, () -> {
+        multiSearcherDupls.rewrite(mtq);
+      });
       //  Maybe remove this assert in later versions, when internal API changes:
       assertEquals("Should throw BooleanQuery.TooManyClauses with a stacktrace containing checkMaxClauseCount()",
-        "checkMaxClauseCount", e.getStackTrace()[0].getMethodName());
+        "checkMaxClauseCount", expected.getStackTrace()[0].getMethodName());
     } finally {
       BooleanQuery.setMaxClauseCount(savedMaxClauseCount);
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java
index c9f8f97..cf77903 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java
@@ -693,33 +693,24 @@ public class TestPhraseQuery extends LuceneTestCase {
   }
   
   public void testNegativeSlop() throws Exception {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new PhraseQuery(-2, "field", "two", "one");
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected exception
-    }
+    });
   }
 
   public void testNegativePosition() throws Exception {
     PhraseQuery.Builder builder = new PhraseQuery.Builder();
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       builder.add(new Term("field", "two"), -42);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected exception
-    }
+    });
   }
 
   public void testBackwardPositions() throws Exception {
     PhraseQuery.Builder builder = new PhraseQuery.Builder();
     builder.add(new Term("field", "one"), 1);
     builder.add(new Term("field", "two"), 5);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       builder.add(new Term("field", "three"), 4);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected exception
-    }
+    });
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
index 3fca681..5758546 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
@@ -948,11 +948,10 @@ public class TestPointQueries extends LuceneTestCase {
     // no wrapping, else the exc might happen in executor thread:
     IndexSearcher s = new IndexSearcher(r);
     byte[][] point = new byte[2][];
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       s.count(new PointRangeQuery("value", point, new boolean[] {true, true}, point, new boolean[] {true, true}));
-    } catch (IllegalArgumentException iae) {
-      assertEquals("field=\"value\" was indexed with numDims=1 but this query has numDims=2", iae.getMessage());
-    }
+    });
+    assertEquals("field=\"value\" was indexed with numDims=1 but this query has numDims=2", expected.getMessage());
 
     IOUtils.close(r, w, dir);
   }
@@ -972,11 +971,10 @@ public class TestPointQueries extends LuceneTestCase {
     IndexSearcher s = new IndexSearcher(r);
     byte[][] point = new byte[1][];
     point[0] = new byte[10];
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       s.count(new PointRangeQuery("value", point, new boolean[] {true}, point, new boolean[] {true}));
-    } catch (IllegalArgumentException iae) {
-      assertEquals("field=\"value\" was indexed with bytesPerDim=8 but this query has bytesPerDim=10", iae.getMessage());
-    }
+    });
+    assertEquals("field=\"value\" was indexed with bytesPerDim=8 but this query has bytesPerDim=10", expected.getMessage());
 
     IOUtils.close(r, w, dir);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java
index f33acf9..02419b8 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java
@@ -280,12 +280,9 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase {
     searcherManager.close();
     awaitClose.countDown();
     thread.join();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       searcherManager.acquire();
-      fail("already closed");
-    } catch (AlreadyClosedException ex) {
-      // expected
-    }
+    });
     assertFalse(success.get());
     assertTrue(triedReopen.get());
     assertNull("" + exc[0], exc[0]);
@@ -325,12 +322,9 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase {
     acquire = sm.acquire();
     acquire.getIndexReader().decRef();
     sm.release(acquire);
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       sm.acquire();
-      fail("acquire should have thrown an IllegalStateException since we modified the refCount outside of the manager");
-    } catch (IllegalStateException ex) {
-      //
-    }
+    });
 
     // sm.close(); -- already closed
     writer.close();
@@ -348,19 +342,16 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase {
     // this should succeed;
     sm.release(s);
     
-    try {
-      // this should fail
+    // this should fail
+    expectThrows(AlreadyClosedException.class, () -> {
       sm.acquire();
-    } catch (AlreadyClosedException e) {
-      // ok
-    }
+    });
     
-    try {
-      // this should fail
+    // this should fail
+    expectThrows(AlreadyClosedException.class, () -> {
       sm.maybeRefresh();
-    } catch (AlreadyClosedException e) {
-      // ok
-    }
+    });
+
     dir.close();
   }
 
@@ -405,16 +396,12 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase {
       }
       };
 
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       new SearcherManager(dir, theEvilOne);
-    } catch (IllegalStateException ise) {
-      // expected
-    }
-    try {
+    });
+    expectThrows(IllegalStateException.class, () -> {
       new SearcherManager(w.w, random.nextBoolean(), false, theEvilOne);
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
     w.close();
     other.close();
     dir.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java
index 95e9865..bc0a2d0 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java
@@ -40,10 +40,9 @@ public class TestSynonymQuery extends LuceneTestCase {
   }
   
   public void testBogusParams() {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new SynonymQuery(new Term("field1", "a"), new Term("field2", "b"));
-      fail();
-    } catch (IllegalArgumentException expected) {}
+    });
   }
 
   public void testToString() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java
index cadc3ce..30061b5 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java
@@ -185,15 +185,12 @@ public class TestTermScorer extends LuceneTestCase {
     IndexSearcher indexSearcher = new IndexSearcher(forbiddenNorms);
     
     Weight weight = indexSearcher.createNormalizedWeight(termQuery, true);
-    try {
+    expectThrows(AssertionError.class, () -> {
       weight.scorer(forbiddenNorms.getContext()).iterator().nextDoc();
-      fail("Should load norms");
-    } catch (AssertionError e) {
-      // ok
-    }
+    });
     
-    weight = indexSearcher.createNormalizedWeight(termQuery, false);
+    Weight weight2 = indexSearcher.createNormalizedWeight(termQuery, false);
     // should not fail this time since norms are not necessary
-    weight.scorer(forbiddenNorms.getContext()).iterator().nextDoc();
+    weight2.scorer(forbiddenNorms.getContext()).iterator().nextDoc();
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
index b98de80..d26006c 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
@@ -181,18 +181,10 @@ public class TestTimeLimitingCollector extends LuceneTestCase {
     myHc.setSlowDown(SLOW_DOWN);
     Collector tlCollector = createTimedCollector(myHc, TIME_ALLOWED, greedy);
 
-    // search
-    TimeExceededException timeoutException = null;
-    try {
+    // search: must get exception
+    TimeExceededException timeoutException = expectThrows(TimeExceededException.class, () -> {
       search(tlCollector);
-    } catch (TimeExceededException x) {
-      timeoutException = x;
-    } catch (Exception e) {
-      assertTrue("Unexpected exception: "+e, false); //==fail
-    }
-    
-    // must get exception
-    assertNotNull( "Timeout expected!", timeoutException );
+    });
 
     // greediness affect last doc collected
     int exceptionDoc = timeoutException.getLastDocCollected();
@@ -275,18 +267,13 @@ public class TestTimeLimitingCollector extends LuceneTestCase {
   public void testNoHits() throws IOException {
     MyHitCollector myHc = new MyHitCollector();
     Collector collector = createTimedCollector(myHc, -1, random().nextBoolean());
-    // search
-    TimeExceededException timeoutException = null;
-    try {
+    // search: must get exception
+    expectThrows(TimeExceededException.class, () -> {
       BooleanQuery.Builder booleanQuery = new BooleanQuery.Builder(); // won't match - we only test if we check timeout when collectors are pulled
       booleanQuery.add(new TermQuery(new Term(FIELD_NAME, "one")), BooleanClause.Occur.MUST);
       booleanQuery.add(new TermQuery(new Term(FIELD_NAME, "blueberry")), BooleanClause.Occur.MUST);
       searcher.search(booleanQuery.build(), collector);
-    } catch (TimeExceededException x) {
-      timeoutException = x;
-    }
-    // must get exception
-    assertNotNull("Timeout expected!", timeoutException);
+    });
     assertEquals(-1, myHc.getLastDocCollected());
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java
index f653971..dc43406 100644
--- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java
+++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java
@@ -35,48 +35,41 @@ public class TestBM25Similarity extends LuceneTestCase {
   }
   
   public void testIllegalK1() {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new BM25Similarity(Float.POSITIVE_INFINITY, 0.75f);
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("illegal k1 value"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("illegal k1 value"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       new BM25Similarity(-1, 0.75f);
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("illegal k1 value"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("illegal k1 value"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       new BM25Similarity(Float.NaN, 0.75f);
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("illegal k1 value"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("illegal k1 value"));
   }
   
   public void testIllegalB() {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new BM25Similarity(1.2f, 2f);
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("illegal b value"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("illegal b value"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       new BM25Similarity(1.2f, -1f);
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("illegal b value"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("illegal b value"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       new BM25Similarity(1.2f, Float.POSITIVE_INFINITY);
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("illegal b value"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("illegal b value"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       new BM25Similarity(1.2f, Float.NaN);
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("illegal b value"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("illegal b value"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanNearQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanNearQuery.java b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanNearQuery.java
index b010147..fbc098c 100644
--- a/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanNearQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanNearQuery.java
@@ -48,12 +48,10 @@ public class TestSpanNearQuery extends LuceneTestCase {
   public void testDifferentField() throws Exception {
     SpanTermQuery q1 = new SpanTermQuery(new Term("field1", "foo"));
     SpanTermQuery q2 = new SpanTermQuery(new Term("field2", "bar"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new SpanNearQuery(new SpanQuery[] { q1, q2 }, 10, true);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("must have same field"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("must have same field"));
   }
   
   public void testNoPositions() throws IOException {
@@ -70,12 +68,11 @@ public class TestSpanNearQuery extends LuceneTestCase {
     SpanTermQuery query = new SpanTermQuery(new Term("foo", "bar"));
     SpanTermQuery query2 = new SpanTermQuery(new Term("foo", "baz"));
 
-    try {
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
       is.search(new SpanNearQuery(new SpanQuery[] { query, query2 }, 10, true), 5);
-      fail("didn't get expected exception");
-    } catch (IllegalStateException expected) {
-      assertTrue(expected.getMessage().contains("was indexed without position data"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("was indexed without position data"));
+
     ir.close();
     dir.close();
   }
@@ -83,18 +80,14 @@ public class TestSpanNearQuery extends LuceneTestCase {
   public void testBuilder() throws Exception {
 
     // Can't add subclauses from different fields
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       SpanNearQuery.newOrderedNearQuery("field1").addClause(new SpanTermQuery(new Term("field2", "term")));
-      fail("Expected an error when adding a clause with a different field");
-    }
-    catch (IllegalArgumentException e) {}
+    });
 
     // Can't add gaps to unordered queries
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       SpanNearQuery.newUnorderedNearQuery("field1").addGap(1);
-      fail("Expected an error when adding a gap to an unordered query");
-    }
-    catch (IllegalArgumentException e) {}
+    });
 
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanNotQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanNotQuery.java b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanNotQuery.java
index 79026bb..4ffb270 100644
--- a/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanNotQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanNotQuery.java
@@ -48,12 +48,10 @@ public class TestSpanNotQuery extends LuceneTestCase {
   public void testDifferentField() throws Exception {
     SpanTermQuery q1 = new SpanTermQuery(new Term("field1", "foo"));
     SpanTermQuery q2 = new SpanTermQuery(new Term("field2", "bar"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new SpanNotQuery(q1, q2);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("must have same field"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("must have same field"));
   }
   
   public void testNoPositions() throws IOException {
@@ -70,12 +68,11 @@ public class TestSpanNotQuery extends LuceneTestCase {
     SpanTermQuery query = new SpanTermQuery(new Term("foo", "bar"));
     SpanTermQuery query2 = new SpanTermQuery(new Term("foo", "baz"));
 
-    try {
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
       is.search(new SpanNotQuery(query, query2), 5);
-      fail("didn't get expected exception");
-    } catch (IllegalStateException expected) {
-      assertTrue(expected.getMessage().contains("was indexed without position data"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("was indexed without position data"));
+
     ir.close();
     dir.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanOrQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanOrQuery.java b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanOrQuery.java
index 6f3c41f..b0fe485 100644
--- a/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanOrQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanOrQuery.java
@@ -45,11 +45,9 @@ public class TestSpanOrQuery extends LuceneTestCase {
   public void testDifferentField() throws Exception {
     SpanTermQuery q1 = new SpanTermQuery(new Term("field1", "foo"));
     SpanTermQuery q2 = new SpanTermQuery(new Term("field2", "bar"));
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new SpanOrQuery(q1, q2);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("must have same field"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("must have same field"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanTermQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanTermQuery.java b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanTermQuery.java
index 97951bf..a1498ce 100644
--- a/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanTermQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanTermQuery.java
@@ -53,12 +53,11 @@ public class TestSpanTermQuery extends LuceneTestCase {
     
     IndexSearcher is = new IndexSearcher(ir);
     SpanTermQuery query = new SpanTermQuery(new Term("foo", "bar"));
-    try {
+    IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
       is.search(query, 5);
-      fail("didn't get expected exception");
-    } catch (IllegalStateException expected) {
-      assertTrue(expected.getMessage().contains("was indexed without position data"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("was indexed without position data"));
+
     ir.close();
     dir.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java b/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
index df81d8f..178d792 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
@@ -142,26 +142,24 @@ public class TestBufferedIndexInput extends LuceneTestCase {
      input.seek(pos);
      checkReadBytes(input, 10, pos);  
      input.seek(pos);
-     try {
+     // block read past end of file
+     expectThrows(IOException.class, () -> {
        checkReadBytes(input, 11, pos);
-           fail("Block read past end of file");
-       } catch (IOException e) {
-           /* success */
-       }
+     });
+
      input.seek(pos);
-     try {
+
+     // block read past end of file
+     expectThrows(IOException.class, () -> {
        checkReadBytes(input, 50, pos);
-           fail("Block read past end of file");
-       } catch (IOException e) {
-           /* success */
-       }
+     });
+
      input.seek(pos);
-     try {
+
+     // block read past end of file
+     expectThrows(IOException.class, () -> {
        checkReadBytes(input, 100000, pos);
-           fail("Block read past end of file");
-       } catch (IOException e) {
-           /* success */
-       }
+     });
   }
 
     // byten emulates a file - byten(n) returns the n'th byte in that file.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
index 99f9e0c..571119d 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
@@ -89,12 +89,9 @@ public class TestDirectory extends LuceneTestCase {
       Lock lock = dir.obtainLock(lockname);
 
       for (Directory other : dirs) {
-        try {
+        expectThrows(LockObtainFailedException.class, () -> {
           other.obtainLock(lockname);
-          fail("didnt get exception");
-        } catch (LockObtainFailedException e) {
-          // OK
-        }
+        });
       }
 
       lock.close();
@@ -131,12 +128,9 @@ public class TestDirectory extends LuceneTestCase {
       IndexOutput out = fsDir.createOutput("afile", newIOContext(random()));
       out.close();
       assertTrue(slowFileExists(fsDir, "afile"));
-      try {
+      expectThrows(IOException.class, () -> {
         new SimpleFSDirectory(path.resolve("afile"));
-        fail("did not hit expected exception");
-      } catch (IOException nsde) {
-        // Expected
-      }
+      });
     } finally {
       fsDir.close();
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
index bdd3dfa..927c913 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
@@ -101,12 +101,10 @@ public class TestFileSwitchDirectory extends BaseDirectoryTestCase {
     Path primDir = createTempDir("foo");
     Path secondDir = createTempDir("bar");
     Directory dir = newFSSwitchDirectory(primDir, secondDir, Collections.<String>emptySet());
-    try {
+    expectThrows(IndexNotFoundException.class, () -> {
       DirectoryReader.open(dir);
-      fail("did not hit expected exception");
-    } catch (IndexNotFoundException nsde) {
-      // expected
-    }
+    });
+
     dir.close();
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/store/TestMultiMMap.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestMultiMMap.java b/lucene/core/src/test/org/apache/lucene/store/TestMultiMMap.java
index 3b6ef22..76632cb 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestMultiMMap.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestMultiMMap.java
@@ -59,24 +59,16 @@ public class TestMultiMMap extends BaseDirectoryTestCase {
     IndexInput two = one.clone();
     IndexInput three = two.clone(); // clone of clone
     one.close();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       one.readVInt();
-      fail("Must throw AlreadyClosedException");
-    } catch (AlreadyClosedException ignore) {
-      // pass
-    }
-    try {
+    });
+    expectThrows(AlreadyClosedException.class, () -> {
       two.readVInt();
-      fail("Must throw AlreadyClosedException");
-    } catch (AlreadyClosedException ignore) {
-      // pass
-    }
-    try {
+    });
+    expectThrows(AlreadyClosedException.class, () -> {
       three.readVInt();
-      fail("Must throw AlreadyClosedException");
-    } catch (AlreadyClosedException ignore) {
-      // pass
-    }
+    });
+
     two.close();
     three.close();
     // test double close of master:
@@ -94,12 +86,9 @@ public class TestMultiMMap extends BaseDirectoryTestCase {
     IndexInput three = two.clone(); // clone of clone
     two.close();
     assertEquals(5, one.readVInt());
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       two.readVInt();
-      fail("Must throw AlreadyClosedException");
-    } catch (AlreadyClosedException ignore) {
-      // pass
-    }
+    });
     assertEquals(5, three.readVInt());
     one.close();
     three.close();
@@ -118,30 +107,19 @@ public class TestMultiMMap extends BaseDirectoryTestCase {
     IndexInput three = one.clone(); // clone of clone
     IndexInput four = two.clone(); // clone of clone
     slicer.close();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       one.readInt();
-      fail("Must throw AlreadyClosedException");
-    } catch (AlreadyClosedException ignore) {
-      // pass
-    }
-    try {
+    });
+    expectThrows(AlreadyClosedException.class, () -> {
       two.readInt();
-      fail("Must throw AlreadyClosedException");
-    } catch (AlreadyClosedException ignore) {
-      // pass
-    }
-    try {
+    });
+    expectThrows(AlreadyClosedException.class, () -> {
       three.readInt();
-      fail("Must throw AlreadyClosedException");
-    } catch (AlreadyClosedException ignore) {
-      // pass
-    }
-    try {
+    });
+    expectThrows(AlreadyClosedException.class, () -> {
       four.readInt();
-      fail("Must throw AlreadyClosedException");
-    } catch (AlreadyClosedException ignore) {
-      // pass
-    }
+    });
+
     one.close();
     two.close();
     three.close();
@@ -161,17 +139,14 @@ public class TestMultiMMap extends BaseDirectoryTestCase {
     IndexInput one = slicer.slice("first int", 0, 4);
     IndexInput two = slicer.slice("second int", 4, 4);
     one.close();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       one.readInt();
-      fail("Must throw AlreadyClosedException");
-    } catch (AlreadyClosedException ignore) {
-      // pass
-    }
+    });
     assertEquals(2, two.readInt());
-    // reopen a new slice "one":
-    one = slicer.slice("first int", 0, 4);
-    assertEquals(1, one.readInt());
-    one.close();
+    // reopen a new slice "another":
+    IndexInput another = slicer.slice("first int", 0, 4);
+    assertEquals(1, another.readInt());
+    another.close();
     two.close();
     slicer.close();
     mmapDir.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
index 4e62daf..5d202bf 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
@@ -50,14 +50,11 @@ public class TestNativeFSLockFactory extends BaseLockFactoryTestCase {
     NativeFSLockFactory.NativeFSLock lock =  (NativeFSLockFactory.NativeFSLock) dir.obtainLock("test.lock");
     lock.ensureValid();
     lock.lock.release();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       lock.ensureValid();
-      fail("no exception");
-    } catch (AlreadyClosedException expected) {
-      // ok
-    } finally {
-      IOUtils.closeWhileHandlingException(lock);
-    }
+    });
+
+    IOUtils.closeWhileHandlingException(lock);
     dir.close();
   }
   
@@ -67,14 +64,11 @@ public class TestNativeFSLockFactory extends BaseLockFactoryTestCase {
     NativeFSLockFactory.NativeFSLock lock =  (NativeFSLockFactory.NativeFSLock) dir.obtainLock("test.lock");
     lock.ensureValid();
     lock.channel.close();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       lock.ensureValid();
-      fail("no exception");
-    } catch (AlreadyClosedException expected) {
-      // ok
-    } finally {
-      IOUtils.closeWhileHandlingException(lock);
-    }
+    });
+
+    IOUtils.closeWhileHandlingException(lock);
     dir.close();
   }
   
@@ -88,14 +82,11 @@ public class TestNativeFSLockFactory extends BaseLockFactoryTestCase {
 
       dir.deleteFile("test.lock");
 
-      try {
+      expectThrows(IOException.class, () -> {
         lock.ensureValid();
-        fail("no exception");
-      } catch (IOException expected) {
-        // ok
-      } finally {
-        IOUtils.closeWhileHandlingException(lock);
-      }
+      });
+      
+      IOUtils.closeWhileHandlingException(lock);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
index c5d3066..d4e8bfc 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
@@ -175,17 +175,14 @@ public class TestRAMDirectory extends BaseDirectoryTestCase {
       }
 
       try (IndexInput is = dir.openInput("foo", newIOContext(random))) {
-        try {
+        expectThrows(EOFException.class, () -> {
           is.seek(0);
           // Here, I go past EOF.
           is.seek(len + random().nextInt(2048));
           // since EOF is not enforced by the previous call in RAMInputStream
           // this call to readBytes should throw the exception.
           is.readBytes(bytes, 0, 16);
-          fail("Did not get EOFException");
-        } catch (EOFException eof) {
-          // expected!
-        }
+        });
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
index 84bdd9f..ec50498 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
@@ -46,14 +46,10 @@ public class TestSimpleFSLockFactory extends BaseLockFactoryTestCase {
         assumeNoException("test requires the ability to delete a locked file", e);
       }
     
-      try {
+      expectThrows(IOException.class, () -> {
         lock.ensureValid();
-        fail("no exception");
-      } catch (IOException expected) {
-        // ok
-      } finally {
-        IOUtils.closeWhileHandlingException(lock);
-      }
+      });
+      IOUtils.closeWhileHandlingException(lock);
     } finally {
       // Do this in finally clause in case the assumeNoException is false:
       dir.close();


[43/53] [abbrv] lucene-solr git commit: Merge remote-tracking branch 'origin/master'

Posted by no...@apache.org.
Merge remote-tracking branch 'origin/master'


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/982654b7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/982654b7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/982654b7

Branch: refs/heads/apiv2
Commit: 982654b7952d89675834b2b1bc2bc987dddf53be
Parents: eb1f8e2 9ca1a19
Author: Noble Paul <no...@apache.org>
Authored: Tue Feb 23 06:32:33 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Tue Feb 23 06:32:33 2016 +0530

----------------------------------------------------------------------
 dev-tools/idea/solr/core/src/java/solr-core.iml |  12 +-
 .../idea/solr/core/src/solr-core-tests.iml      |   9 -
 dev-tools/idea/solr/solrj/src/solrj-tests.iml   |   9 -
 .../maven/solr/core/src/java/pom.xml.template   |   5 +
 lucene/CHANGES.txt                              |   3 +
 .../lucene/analysis/en/PorterStemmer.java       |   3 +-
 .../miscellaneous/ASCIIFoldingFilter.java       |   4 +-
 .../miscellaneous/WordDelimiterFilter.java      |   3 +-
 .../lucene/analysis/synonym/SynonymFilter.java  |   7 +-
 .../lucene/analysis/util/RollingCharBuffer.java |   4 +-
 .../org/tartarus/snowball/SnowballProgram.java  |   4 +-
 .../lucene/analysis/ja/JapaneseTokenizer.java   |   5 +-
 .../lucene50/Lucene50DocValuesProducer.java     |   6 +-
 .../codecs/blocktreeords/FSTOrdsOutputs.java    |   2 +-
 .../bloom/BloomFilteringPostingsFormat.java     |   5 +-
 .../codecs/memory/DirectPostingsFormat.java     |   3 +-
 .../codecs/memory/MemoryPostingsFormat.java     |   5 +-
 .../tokenattributes/CharTermAttributeImpl.java  |   8 +-
 .../org/apache/lucene/codecs/PointWriter.java   |   2 +-
 .../lucene54/Lucene54DocValuesProducer.java     |   3 +-
 .../codecs/lucene60/Lucene60PointFormat.java    |   4 +-
 .../perfield/PerFieldDocValuesFormat.java       |   5 +-
 .../org/apache/lucene/document/BinaryPoint.java |   2 +-
 .../org/apache/lucene/document/DoublePoint.java |  40 +-
 .../org/apache/lucene/document/FloatPoint.java  |  40 +-
 .../org/apache/lucene/document/IntPoint.java    |  40 +-
 .../org/apache/lucene/document/LongPoint.java   |  40 +-
 .../apache/lucene/index/BufferedUpdates.java    |  16 +-
 .../lucene/index/ConcurrentMergeScheduler.java  |   6 +
 .../apache/lucene/index/DocValuesUpdate.java    |  14 +-
 .../lucene/index/DocumentsWriterPerThread.java  |   7 +-
 .../index/FreqProxTermsWriterPerField.java      |  10 +-
 .../lucene/index/FrozenBufferedUpdates.java     |   3 +-
 .../lucene/index/ParallelPostingsArray.java     |   4 +-
 .../apache/lucene/index/PointValuesWriter.java  |   6 +-
 .../apache/lucene/index/PrefixCodedTerms.java   |   4 +-
 .../lucene/index/SortedDocValuesWriter.java     |   4 +-
 .../lucene/index/SortedSetDocValuesWriter.java  |   6 +-
 .../index/TermVectorsConsumerPerField.java      |   3 +-
 .../apache/lucene/search/CachingCollector.java  |   8 +-
 .../apache/lucene/search/ExactPointQuery.java   | 153 ------
 .../apache/lucene/search/PointRangeQuery.java   | 491 ++++++++++++++++---
 .../apache/lucene/search/ScoringRewrite.java    |   3 +-
 .../java/org/apache/lucene/util/ArrayUtil.java  |  21 +-
 .../org/apache/lucene/util/BytesRefArray.java   |   6 +-
 .../org/apache/lucene/util/BytesRefHash.java    |  15 +-
 .../org/apache/lucene/util/DocIdSetBuilder.java |   3 +-
 .../org/apache/lucene/util/NumericUtils.java    |  31 +-
 .../apache/lucene/util/RamUsageEstimator.java   |  41 +-
 .../lucene/util/RecyclingIntBlockAllocator.java |   6 +-
 .../org/apache/lucene/util/SentinelIntSet.java  |   2 +-
 .../apache/lucene/util/automaton/Automaton.java |   4 +-
 .../lucene/util/automaton/SortedIntSet.java     |   4 +-
 .../org/apache/lucene/util/bkd/BKDReader.java   |   4 +-
 .../org/apache/lucene/util/bkd/BKDWriter.java   |   5 +-
 .../apache/lucene/util/bkd/HeapPointWriter.java |   4 +-
 .../lucene/util/bkd/OfflinePointReader.java     |   5 +-
 .../lucene/util/bkd/OfflinePointWriter.java     |   6 +-
 .../util/packed/AbstractPagedMutable.java       |   4 +-
 .../org/apache/lucene/util/packed/Direct16.java |   2 +-
 .../org/apache/lucene/util/packed/Direct32.java |   2 +-
 .../org/apache/lucene/util/packed/Direct64.java |   2 +-
 .../org/apache/lucene/util/packed/Direct8.java  |   2 +-
 .../lucene/util/packed/GrowableWriter.java      |   4 +-
 .../lucene/util/packed/Packed16ThreeBlocks.java |   2 +-
 .../org/apache/lucene/util/packed/Packed64.java |   4 +-
 .../lucene/util/packed/Packed64SingleBlock.java |   2 +-
 .../lucene/util/packed/Packed8ThreeBlocks.java  |   2 +-
 .../apache/lucene/util/packed/PackedInts.java   |   2 +-
 .../lucene/util/packed/PagedGrowableWriter.java |   4 +-
 .../lucene/TestMergeSchedulerExternal.java      |   3 +
 .../index/TestDemoParallelLeafReader.java       |   2 +-
 .../apache/lucene/index/TestIntBlockPool.java   |  11 +-
 .../apache/lucene/search/TestPointQueries.java  | 106 ++--
 .../TestUsageTrackingFilterCachingPolicy.java   |   2 +-
 .../org/apache/lucene/util/bkd/TestBKD.java     |  12 +-
 .../demo/facet/DistanceFacetsExample.java       |   8 +-
 .../lucene/demo/facet/RangeFacetsExample.java   |   2 +-
 .../facet/range/TestRangeFacetCounts.java       |  20 +-
 .../search/highlight/HighlighterTest.java       |   2 +-
 lucene/ivy-versions.properties                  |   4 +-
 lucene/licenses/morfologik-fsa-2.0.1.jar.sha1   |   1 -
 lucene/licenses/morfologik-fsa-2.1.0.jar.sha1   |   1 +
 lucene/licenses/morfologik-fsa-LICENSE-BSD.txt  |   2 +-
 .../licenses/morfologik-polish-2.0.1.jar.sha1   |   1 -
 .../licenses/morfologik-polish-2.1.0.jar.sha1   |   1 +
 .../licenses/morfologik-polish-LICENSE-BSD.txt  |  16 +-
 .../licenses/morfologik-stemming-2.0.1.jar.sha1 |   1 -
 .../licenses/morfologik-stemming-2.1.0.jar.sha1 |   1 +
 .../morfologik-stemming-LICENSE-BSD.txt         |   2 +-
 .../apache/lucene/index/memory/MemoryIndex.java |  10 +-
 .../lucene/uninverting/FieldCacheImpl.java      |   4 +-
 .../org/apache/lucene/document/LatLonPoint.java |   4 +-
 .../lucene/search/PointInPolygonQuery.java      |   6 +-
 .../apache/lucene/search/PointInRectQuery.java  |   6 +-
 .../lucene/search/TestDocValuesRangeQuery.java  |  10 +-
 .../spatial/prefix/ContainsPrefixTreeQuery.java |   2 +-
 .../org/apache/lucene/geo3d/Geo3DPoint.java     |   6 +-
 .../lucene/geo3d/PointInGeo3DShapeQuery.java    |  12 +-
 .../search/suggest/tst/TernaryTreeNode.java     |   2 +-
 .../suggest/document/TestSuggestField.java      |   2 +-
 .../lucene/index/BasePointFormatTestCase.java   |   6 +-
 solr/CHANGES.txt                                |  18 +-
 .../solrconfig.snippet.randomindexconfig.xml    |   2 +-
 .../apache/solr/handler/PingRequestHandler.java |   7 +-
 .../solr/handler/component/SearchHandler.java   |  19 +-
 .../apache/solr/search/SolrIndexSearcher.java   |  18 +
 .../apache/solr/update/IndexFingerprint.java    |   5 +-
 .../java/org/apache/solr/update/PeerSync.java   |   2 +-
 .../collection1/conf/solrconfig-delpolicy1.xml  |   3 +-
 .../collection1/conf/solrconfig-delpolicy2.xml  |   3 +-
 .../conf/solrconfig-spellcheckcomponent.xml     |   3 +-
 .../solrconfig.snippet.randomindexconfig.xml    |   3 +-
 .../org/apache/solr/TestGroupingSearch.java     |  12 +-
 .../solr/cloud/ConnectionManagerTest.java       |  46 ++
 .../solr/cloud/TestMiniSolrCloudCluster.java    |  12 +-
 .../cloud/TestMiniSolrCloudClusterBase.java     |  12 +-
 .../cloud/TestSolrCloudWithKerberosAlt.java     |  12 +-
 .../test/org/apache/solr/core/TestNRTOpen.java  |   8 +-
 .../solr/handler/PingRequestHandlerTest.java    |   3 +
 .../handler/component/SearchHandlerTest.java    |  47 ++
 .../apache/solr/search/TestIndexSearcher.java   |  11 +-
 .../solr/update/DirectUpdateHandlerTest.java    |   6 +-
 .../org/apache/solr/update/PeerSyncTest.java    |   8 +
 .../solr/update/SolrCmdDistributorTest.java     |  12 +-
 solr/licenses/carrot2-mini-3.10.4.jar.sha1      |   1 -
 solr/licenses/carrot2-mini-3.12.0.jar.sha1      |   1 +
 solr/licenses/morfologik-fsa-2.0.1.jar.sha1     |   1 -
 solr/licenses/morfologik-fsa-2.1.0.jar.sha1     |   1 +
 solr/licenses/morfologik-fsa-LICENSE-BSD.txt    |   2 +-
 solr/licenses/morfologik-polish-2.0.1.jar.sha1  |   1 -
 solr/licenses/morfologik-polish-2.1.0.jar.sha1  |   1 +
 solr/licenses/morfologik-polish-LICENSE-BSD.txt |  16 +-
 .../licenses/morfologik-stemming-2.0.1.jar.sha1 |   1 -
 .../licenses/morfologik-stemming-2.1.0.jar.sha1 |   1 +
 .../morfologik-stemming-LICENSE-BSD.txt         |   2 +-
 .../solr/common/cloud/ConnectionManager.java    |  96 ++--
 .../java/org/apache/solr/SolrTestCaseJ4.java    |  45 ++
 138 files changed, 1224 insertions(+), 685 deletions(-)
----------------------------------------------------------------------



[46/53] [abbrv] lucene-solr git commit: SOLR-8522: Make it possible to use ip fragments in replica placement rules , such as ip_1, ip_2 etc

Posted by no...@apache.org.
SOLR-8522: Make it possible to use ip fragments in replica placement rules , such as ip_1, ip_2 etc


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/cf964326
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/cf964326
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/cf964326

Branch: refs/heads/apiv2
Commit: cf964326309feb7a5a41a3e4f22cad073807a097
Parents: e069d31
Author: Noble Paul <no...@apache.org>
Authored: Tue Feb 23 13:31:08 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Tue Feb 23 13:31:08 2016 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                |   2 +
 solr/core/ivy.xml                               |   2 +
 .../apache/solr/cloud/rule/ImplicitSnitch.java  |  80 +++++++-
 .../solr/cloud/rule/ImplicitSnitchTest.java     | 186 +++++++++++++++++++
 .../org/apache/solr/cloud/rule/RulesTest.java   |  77 ++++++++
 5 files changed, 343 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cf964326/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index a3e59b4..525e8d5 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -153,6 +153,8 @@ New Features
   a connection to zookeeper has been lost and there is a possibility of stale data on the node the request is coming
   from. (Keith Laban, Dennis Gove)
 
+* SOLR-8522: Make it possible to use ip fragments in replica placement rules , such as ip_1, ip_2 etc (Arcadius Ahouansou, noble)
+
 Bug Fixes
 ----------------------
 * SOLR-8386: Add field option in the new admin UI schema page loads up even when no schemaFactory has been

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cf964326/solr/core/ivy.xml
----------------------------------------------------------------------
diff --git a/solr/core/ivy.xml b/solr/core/ivy.xml
index f6b2cac..2936c5b 100644
--- a/solr/core/ivy.xml
+++ b/solr/core/ivy.xml
@@ -54,6 +54,8 @@
     <dependency org="cglib" name="cglib-nodep" rev="${/cglib/cglib-nodep}" conf="test"/>
     <dependency org="org.objenesis" name="objenesis" rev="${/org.objenesis/objenesis}" conf="test"/>
 
+    <dependency org="org.mockito" name="mockito-core" rev="${/org.mockito/mockito-core}" conf="test"/>
+
     <dependency org="com.fasterxml.jackson.core" name="jackson-core" rev="${/com.fasterxml.jackson.core/jackson-core}" conf="compile"/>
     <dependency org="com.fasterxml.jackson.core" name="jackson-databind" rev="${/com.fasterxml.jackson.core/jackson-databind}" conf="test"/>
     <dependency org="com.fasterxml.jackson.core" name="jackson-annotations" rev="${/com.fasterxml.jackson.core/jackson-annotations}" conf="test"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cf964326/solr/core/src/java/org/apache/solr/cloud/rule/ImplicitSnitch.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/rule/ImplicitSnitch.java b/solr/core/src/java/org/apache/solr/cloud/rule/ImplicitSnitch.java
index cbaa90f..d089aa0 100644
--- a/solr/core/src/java/org/apache/solr/cloud/rule/ImplicitSnitch.java
+++ b/solr/core/src/java/org/apache/solr/cloud/rule/ImplicitSnitch.java
@@ -17,21 +17,29 @@
 package org.apache.solr.cloud.rule;
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import java.net.InetAddress;
 import java.nio.file.Files;
 import java.nio.file.Paths;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.handler.admin.CoreAdminHandler;
 import org.apache.solr.request.SolrQueryRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ImplicitSnitch extends Snitch implements CoreAdminHandler.Invocable {
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   public static final Pattern hostAndPortPattern = Pattern.compile("(?:https?://)?([^:]+):(\\d+)");
 
@@ -42,8 +50,10 @@ public class ImplicitSnitch extends Snitch implements CoreAdminHandler.Invocable
   public static final String CORES = "cores";
   public static final String DISK = "freedisk";
   public static final String SYSPROP = "sysprop.";
+  public static final List<String> IP_SNITCHES = ImmutableList.of("ip_1", "ip_2", "ip_3", "ip_4");
+
+  public static final Set<String> tags = ImmutableSet.<String>builder().add(NODE, PORT, HOST, CORES, DISK).addAll(IP_SNITCHES).build();
 
-  public static final Set<String> tags = ImmutableSet.of(NODE, PORT, HOST, CORES, DISK);
 
 
   @Override
@@ -57,6 +67,9 @@ public class ImplicitSnitch extends Snitch implements CoreAdminHandler.Invocable
       Matcher hostAndPortMatcher = hostAndPortPattern.matcher(solrNode);
       if (hostAndPortMatcher.find()) ctx.getTags().put(PORT, hostAndPortMatcher.group(2));
     }
+
+    addIpTags(solrNode, requestedTags, ctx);
+
     ModifiableSolrParams params = new ModifiableSolrParams();
     if (requestedTags.contains(CORES)) params.add(CORES, "1");
     if (requestedTags.contains(DISK)) params.add(DISK, "1");
@@ -71,7 +84,7 @@ public class ImplicitSnitch extends Snitch implements CoreAdminHandler.Invocable
     long spaceInGB = space / 1024 / 1024 / 1024;
     return spaceInGB;
   }
-  
+
   public Map<String, Object> invoke(SolrQueryRequest req) {
     Map<String, Object> result = new HashMap<>();
     if (req.getParams().getInt(CORES, -1) == 1) {
@@ -88,16 +101,75 @@ public class ImplicitSnitch extends Snitch implements CoreAdminHandler.Invocable
     }
     String[] sysProps = req.getParams().getParams(SYSPROP);
     if (sysProps != null && sysProps.length > 0) {
-      for (String prop : sysProps) result.put(SYSPROP+prop, System.getProperty(prop));
+      for (String prop : sysProps) result.put(SYSPROP + prop, System.getProperty(prop));
     }
     return result;
   }
 
+  private static final String HOST_FRAG_SEPARATOR_REGEX = "\\.";
 
   @Override
   public boolean isKnownTag(String tag) {
     return tags.contains(tag) ||
-        tag.startsWith(SYSPROP);//a system property
+        tag.startsWith(SYSPROP);
+  }
+
+  private void addIpTags(String solrNode, Set<String> requestedTags, SnitchContext context) {
+
+    List<String> requestedHostTags = new ArrayList<>();
+    for (String tag : requestedTags) {
+      if (IP_SNITCHES.contains(tag)) {
+        requestedHostTags.add(tag);
+      }
+    }
+
+    if (requestedHostTags.isEmpty()) {
+      return;
+    }
+
+    String[] ipFragments = getIpFragments(solrNode);
+
+    if (ipFragments == null) {
+      return;
+    }
+
+    int ipSnitchCount = IP_SNITCHES.size();
+    for (int i = 0; i < ipSnitchCount; i++) {
+      String currentTagValue = ipFragments[i];
+      String currentTagKey = IP_SNITCHES.get(ipSnitchCount - i - 1);
+
+      if (requestedHostTags.contains(currentTagKey)) {
+        context.getTags().put(currentTagKey, currentTagValue);
+      }
+
+    }
+
+  }
+
+  private String[] getIpFragments(String solrNode) {
+    Matcher hostAndPortMatcher = hostAndPortPattern.matcher(solrNode);
+    if (hostAndPortMatcher.find()) {
+      String host = hostAndPortMatcher.group(1);
+      if (host != null) {
+        String ip = getHostIp(host);
+        if (ip != null) {
+          return ip.split(HOST_FRAG_SEPARATOR_REGEX); //IPv6 support will be provided by SOLR-8523
+        }
+      }
+    }
+
+    log.warn("Failed to match host IP address from node URL [{}] using regex [{}]", solrNode, hostAndPortPattern.pattern());
+    return null;
+  }
+
+  protected String getHostIp(String host) {
+    try {
+      InetAddress address = InetAddress.getByName(host);
+      return address.getHostAddress();
+    } catch (Exception e) {
+      log.warn("Failed to get IP address from host [{}], with exception [{}] ", host, e);
+      return null;
+    }
   }
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cf964326/solr/core/src/test/org/apache/solr/cloud/rule/ImplicitSnitchTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/rule/ImplicitSnitchTest.java b/solr/core/src/test/org/apache/solr/cloud/rule/ImplicitSnitchTest.java
new file mode 100644
index 0000000..a5abb16
--- /dev/null
+++ b/solr/core/src/test/org/apache/solr/cloud/rule/ImplicitSnitchTest.java
@@ -0,0 +1,186 @@
+package org.apache.solr.cloud.rule;
+
+import java.util.Map;
+
+import com.google.common.collect.Sets;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.when;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class ImplicitSnitchTest {
+
+  private ImplicitSnitch snitch;
+  private SnitchContext context;
+
+  private static final String IP_1 = "ip_1";
+  private static final String IP_2 = "ip_2";
+  private static final String IP_3 = "ip_3";
+  private static final String IP_4 = "ip_4";
+
+  @Before
+  public void beforeImplicitSnitchTest() {
+    snitch = new ImplicitSnitch();
+    context = new SnitchContext(null, null);
+  }
+
+
+  @Test
+  public void testGetTags_withAllIPv4RequestedTags_with_omitted_zeros_returns_four_tags() throws Exception {
+    String node = "5:8983_solr";
+
+    snitch.getTags(node, Sets.newHashSet(IP_1, IP_2, IP_3, IP_4), context);
+
+    Map<String, Object> tags = context.getTags();
+    assertThat(tags.entrySet().size(), is(4));
+    assertThat(tags.get(IP_1), is("5"));
+    assertThat(tags.get(IP_2), is("0"));
+    assertThat(tags.get(IP_3), is("0"));
+    assertThat(tags.get(IP_4), is("0"));
+  }
+
+
+  @Test
+  public void testGetTags_withAllIPv4RequestedTags_returns_four_tags() throws Exception {
+    String node = "192.168.1.2:8983_solr";
+
+    snitch.getTags(node, Sets.newHashSet(IP_1, IP_2, IP_3, IP_4), context);
+
+    Map<String, Object> tags = context.getTags();
+    assertThat(tags.entrySet().size(), is(4));
+    assertThat(tags.get(IP_1), is("2"));
+    assertThat(tags.get(IP_2), is("1"));
+    assertThat(tags.get(IP_3), is("168"));
+    assertThat(tags.get(IP_4), is("192"));
+  }
+
+  @Test
+  public void testGetTags_withIPv4RequestedTags_ip2_and_ip4_returns_two_tags() throws Exception {
+    String node = "192.168.1.2:8983_solr";
+
+    SnitchContext context = new SnitchContext(null, node);
+    snitch.getTags(node, Sets.newHashSet(IP_2, IP_4), context);
+
+    Map<String, Object> tags = context.getTags();
+    assertThat(tags.entrySet().size(), is(2));
+    assertThat(tags.get(IP_2), is("1"));
+    assertThat(tags.get(IP_4), is("192"));
+  }
+
+  @Test
+  public void testGetTags_with_wrong_ipv4_format_ip_returns_nothing() throws Exception {
+    String node = "192.168.1.2.1:8983_solr";
+
+    SnitchContext context = new SnitchContext(null, node);
+    snitch.getTags(node, Sets.newHashSet(IP_1), context);
+
+    Map<String, Object> tags = context.getTags();
+    assertThat(tags.entrySet().size(), is(0));
+  }
+
+
+  @Test
+  public void testGetTags_with_correct_ipv6_format_ip_returns_nothing() throws Exception {
+    String node = "[0:0:0:0:0:0:0:1]:8983_solr";
+
+    SnitchContext context = new SnitchContext(null, node);
+    snitch.getTags(node, Sets.newHashSet(IP_1), context);
+
+    Map<String, Object> tags = context.getTags();
+    assertThat(tags.entrySet().size(), is(0)); //This will fail when IPv6 is implemented
+  }
+
+
+  @Test
+  public void testGetTags_withEmptyRequestedTag_returns_nothing() throws Exception {
+    String node = "192.168.1.2:8983_solr";
+
+    snitch.getTags(node, Sets.newHashSet(), context);
+
+    Map<String, Object> tags = context.getTags();
+    assertThat(tags.entrySet().size(), is(0));
+  }
+
+
+  @Test
+  public void testGetTags_withAllHostNameRequestedTags_returns_all_Tags() throws Exception {
+    String node = "serv01.dc01.london.uk.apache.org:8983_solr";
+
+    SnitchContext context = new SnitchContext(null, node);
+    //We need mocking here otherwise, we would need proper DNS entry for this test to pass
+    ImplicitSnitch mockedSnitch = Mockito.spy(snitch);
+    when(mockedSnitch.getHostIp(anyString())).thenReturn("10.11.12.13");
+
+    mockedSnitch.getTags(node, Sets.newHashSet(IP_1, IP_2, IP_3, IP_4), context);
+
+    Map<String, Object> tags = context.getTags();
+    assertThat(tags.entrySet().size(), is(4));
+    assertThat(tags.get(IP_1), is("13"));
+    assertThat(tags.get(IP_2), is("12"));
+    assertThat(tags.get(IP_3), is("11"));
+    assertThat(tags.get(IP_4), is("10"));
+  }
+
+  @Test
+  public void testGetTags_withHostNameRequestedTag_ip3_returns_1_tag() throws Exception {
+    String node = "serv01.dc01.london.uk.apache.org:8983_solr";
+
+    SnitchContext context = new SnitchContext(null, node);
+    //We need mocking here otherwise, we would need proper DNS entry for this test to pass
+    ImplicitSnitch mockedSnitch = Mockito.spy(snitch);
+    when(mockedSnitch.getHostIp(anyString())).thenReturn("10.11.12.13");
+    mockedSnitch.getTags(node, Sets.newHashSet(IP_3), context);
+
+    Map<String, Object> tags = context.getTags();
+    assertThat(tags.entrySet().size(), is(1));
+    assertThat(tags.get(IP_3), is("11"));
+  }
+
+  @Test
+  public void testGetTags_withHostNameRequestedTag_ip99999_returns_nothing() throws Exception {
+    String node = "serv01.dc01.london.uk.apache.org:8983_solr";
+
+    SnitchContext context = new SnitchContext(null, node);
+    //We need mocking here otherwise, we would need proper DNS entry for this test to pass
+    ImplicitSnitch mockedSnitch = Mockito.spy(snitch);
+    when(mockedSnitch.getHostIp(anyString())).thenReturn("10.11.12.13");
+    mockedSnitch.getTags(node, Sets.newHashSet("ip_99999"), context);
+
+    Map<String, Object> tags = context.getTags();
+    assertThat(tags.entrySet().size(), is(0));
+  }
+
+  @Test
+  public void testIsKnownTag_ip1() throws Exception {
+    assertFalse(snitch.isKnownTag("ip_0"));
+    assertTrue(snitch.isKnownTag(IP_1));
+    assertTrue(snitch.isKnownTag(IP_2));
+    assertTrue(snitch.isKnownTag(IP_3));
+    assertTrue(snitch.isKnownTag(IP_4));
+    assertFalse(snitch.isKnownTag("ip_5"));
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cf964326/solr/core/src/test/org/apache/solr/cloud/rule/RulesTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/rule/RulesTest.java b/solr/core/src/test/org/apache/solr/cloud/rule/RulesTest.java
index cf8cfd7..f23d475 100644
--- a/solr/core/src/test/org/apache/solr/cloud/rule/RulesTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/rule/RulesTest.java
@@ -34,15 +34,20 @@ import org.apache.solr.common.cloud.ImplicitDocRouter;
 import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.junit.Test;
+import org.junit.rules.ExpectedException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
 import static org.apache.solr.common.params.CommonParams.COLLECTIONS_HANDLER_PATH;
+import static org.junit.matchers.JUnitMatchers.containsString;
 
 public class RulesTest extends AbstractFullDistribZkTestBase {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
+  @org.junit.Rule
+  public ExpectedException expectedException = ExpectedException.none();
+
   @Test
   @ShardsFixed(num = 5)
   public void doIntegrationTest() throws Exception {
@@ -128,6 +133,78 @@ public class RulesTest extends AbstractFullDistribZkTestBase {
   }
 
   @Test
+  public void testHostFragmentRule() throws Exception {
+    String rulesColl = "ipRuleColl";
+    String baseUrl = getBaseUrl((HttpSolrClient) clients.get(0));
+    String ip_1 = "-1";
+    String ip_2 = "-1";
+    Matcher hostAndPortMatcher = Pattern.compile("(?:https?://)?([^:]+):(\\d+)").matcher(baseUrl);
+    if (hostAndPortMatcher.find()) {
+      String[] ipFragments = hostAndPortMatcher.group(1).split("\\.");
+      ip_1 = ipFragments[ipFragments.length - 1];
+      ip_2 = ipFragments[ipFragments.length - 2];
+    }
+
+    try (SolrClient client = createNewSolrClient("", baseUrl)) {
+      CollectionAdminResponse rsp;
+      CollectionAdminRequest.Create create = new CollectionAdminRequest.Create();
+      create.setCollectionName(rulesColl);
+      create.setShards("shard1");
+      create.setRouterName(ImplicitDocRouter.NAME);
+      create.setReplicationFactor(2);
+      create.setRule("ip_2:" + ip_2, "ip_1:" + ip_1);
+      create.setSnitch("class:ImplicitSnitch");
+      rsp = create.process(client);
+      assertEquals(0, rsp.getStatus());
+      assertTrue(rsp.isSuccess());
+
+    }
+
+    DocCollection rulesCollection = cloudClient.getZkStateReader().getClusterState().getCollection(rulesColl);
+    List<Map> list = (List<Map>) rulesCollection.get("rule");
+    assertEquals(2, list.size());
+    assertEquals(ip_2, list.get(0).get("ip_2"));
+    assertEquals(ip_1, list.get(1).get("ip_1"));
+
+    list = (List) rulesCollection.get("snitch");
+    assertEquals(1, list.size());
+    assertEquals("ImplicitSnitch", list.get(0).get("class"));
+  }
+
+
+  @Test
+  public void testHostFragmentRuleThrowsExceptionWhenIpDoesNotMatch() throws Exception {
+    String rulesColl = "ipRuleColl";
+    String baseUrl = getBaseUrl((HttpSolrClient) clients.get(0));
+    String ip_1 = "-1";
+    String ip_2 = "-1";
+    Matcher hostAndPortMatcher = Pattern.compile("(?:https?://)?([^:]+):(\\d+)").matcher(baseUrl);
+    if (hostAndPortMatcher.find()) {
+      String[] ipFragments = hostAndPortMatcher.group(1).split("\\.");
+      ip_1 = ipFragments[ipFragments.length - 1];
+      ip_2 = ipFragments[ipFragments.length - 2];
+    }
+
+    try (SolrClient client = createNewSolrClient("", baseUrl)) {
+      CollectionAdminRequest.Create create = new CollectionAdminRequest.Create();
+      create.setCollectionName(rulesColl);
+      create.setShards("shard1");
+      create.setRouterName(ImplicitDocRouter.NAME);
+      create.setReplicationFactor(2);
+
+      create.setRule("ip_2:" + ip_2, "ip_1:" + ip_1 + "9999");
+      create.setSnitch("class:ImplicitSnitch");
+
+      expectedException.expect(HttpSolrClient.RemoteSolrException.class);
+      expectedException.expectMessage(containsString("ip_1"));
+
+      create.process(client);
+    }
+
+  }
+
+
+  @Test
   public void testModifyColl() throws Exception {
     final long minGB1 = (random().nextBoolean() ? 1 : 0);
     final long minGB2 = 5;


[34/53] [abbrv] lucene-solr git commit: SOLR-8690: add solr.disableFingerprint system property

Posted by no...@apache.org.
SOLR-8690: add solr.disableFingerprint system property


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f47e6b22
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f47e6b22
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f47e6b22

Branch: refs/heads/apiv2
Commit: f47e6b220066565cd7741ac76b75b9eb56091b87
Parents: dfd95df
Author: yonik <yo...@apache.org>
Authored: Mon Feb 22 12:41:30 2016 -0500
Committer: yonik <yo...@apache.org>
Committed: Mon Feb 22 12:44:30 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                            | 3 +++
 solr/core/src/java/org/apache/solr/update/PeerSync.java     | 2 +-
 solr/core/src/test/org/apache/solr/update/PeerSyncTest.java | 8 ++++++++
 3 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f47e6b22/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 6f6133f..f005ae8 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -294,6 +294,9 @@ Other Changes
 
 * SOLR-8711: Upgrade Carrot2 clustering dependency to 3.12.0. (Dawid Weiss)
 
+* SOLR-8690: Make peersync fingerprinting optional with solr.disableFingerprint system
+  property. (yonik)
+
 ======================= 5.5.0 =======================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f47e6b22/solr/core/src/java/org/apache/solr/update/PeerSync.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/PeerSync.java b/solr/core/src/java/org/apache/solr/update/PeerSync.java
index ea71783..a1ef5f4 100644
--- a/solr/core/src/java/org/apache/solr/update/PeerSync.java
+++ b/solr/core/src/java/org/apache/solr/update/PeerSync.java
@@ -140,7 +140,7 @@ public class PeerSync  {
     this.maxUpdates = nUpdates;
     this.cantReachIsSuccess = cantReachIsSuccess;
     this.getNoVersionsIsSuccess = getNoVersionsIsSuccess;
-    this.doFingerprint = doFingerprint;
+    this.doFingerprint = doFingerprint && !("true".equals(System.getProperty("solr.disableFingerprint")));
     this.client = core.getCoreDescriptor().getCoreContainer().getUpdateShardHandler().getHttpClient();
     this.onlyIfActive = onlyIfActive;
     

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f47e6b22/solr/core/src/test/org/apache/solr/update/PeerSyncTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/PeerSyncTest.java b/solr/core/src/test/org/apache/solr/update/PeerSyncTest.java
index bcaf846..64edd21 100644
--- a/solr/core/src/test/org/apache/solr/update/PeerSyncTest.java
+++ b/solr/core/src/test/org/apache/solr/update/PeerSyncTest.java
@@ -181,6 +181,14 @@ public class PeerSyncTest extends BaseDistributedSearchTestCase {
     // client0 now has an additional add beyond our window and the fingerprint should cause this to fail
     assertSync(client1, numVersions, false, shardsArr[0]);
 
+    // if we turn of fingerprinting, it should succeed
+    System.setProperty("solr.disableFingerprint", "true");
+    try {
+      assertSync(client1, numVersions, true, shardsArr[0]);
+    } finally {
+      System.clearProperty("solr.disableFingerprint");
+    }
+
     // lets add the missing document and verify that order doesn't matter
     add(client1, seenLeader, sdoc("id",Integer.toString((int)v),"_version_",v));
     assertSync(client1, numVersions, true, shardsArr[0]);


[08/53] [abbrv] lucene-solr git commit: LUCENE-7037: Switch all exceptions tests to expectThrows()

Posted by no...@apache.org.
LUCENE-7037: Switch all exceptions tests to expectThrows()


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/189e985b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/189e985b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/189e985b

Branch: refs/heads/apiv2
Commit: 189e985b5c14c5c19799b7bdfd040874b94ba18c
Parents: c4d3179
Author: Robert Muir <rm...@apache.org>
Authored: Fri Feb 19 12:07:07 2016 -0500
Committer: Robert Muir <rm...@apache.org>
Committed: Fri Feb 19 12:07:47 2016 -0500

----------------------------------------------------------------------
 .../lucene/analysis/ar/TestArabicFilters.java   |  24 +-
 .../bg/TestBulgarianStemFilterFactory.java      |   8 +-
 .../br/TestBrazilianStemFilterFactory.java      |   8 +-
 .../TestHTMLStripCharFilterFactory.java         |   8 +-
 .../TestMappingCharFilterFactory.java           |  33 +-
 .../cjk/TestCJKBigramFilterFactory.java         |   7 +-
 .../analysis/cjk/TestCJKWidthFilterFactory.java |   8 +-
 .../TestSoraniNormalizationFilterFactory.java   |   8 +-
 .../ckb/TestSoraniStemFilterFactory.java        |   8 +-
 .../TestCommonGramsFilterFactory.java           |   8 +-
 .../TestCommonGramsQueryFilterFactory.java      |   8 +-
 ...ictionaryCompoundWordTokenFilterFactory.java |   8 +-
 ...phenationCompoundWordTokenFilterFactory.java |   8 +-
 .../analysis/core/TestBugInSomething.java       |  80 ++---
 .../core/TestDecimalDigitFilterFactory.java     |   8 +-
 .../analysis/core/TestStopFilterFactory.java    |  36 +-
 .../core/TestTypeTokenFilterFactory.java        |  16 +-
 .../analysis/custom/TestCustomAnalyzer.java     |  87 ++---
 .../analysis/cz/TestCzechStemFilterFactory.java |   8 +-
 .../de/TestGermanLightStemFilterFactory.java    |   8 +-
 .../de/TestGermanMinimalStemFilterFactory.java  |   8 +-
 .../TestGermanNormalizationFilterFactory.java   |   8 +-
 .../de/TestGermanStemFilterFactory.java         |   8 +-
 .../el/TestGreekLowerCaseFilterFactory.java     |   8 +-
 .../analysis/el/TestGreekStemFilterFactory.java |   8 +-
 .../en/TestEnglishMinimalStemFilterFactory.java |   8 +-
 .../analysis/en/TestKStemFilterFactory.java     |   8 +-
 .../en/TestPorterStemFilterFactory.java         |   8 +-
 .../es/TestSpanishLightStemFilterFactory.java   |   8 +-
 .../TestPersianNormalizationFilterFactory.java  |   8 +-
 .../fi/TestFinnishLightStemFilterFactory.java   |   8 +-
 .../fr/TestFrenchLightStemFilterFactory.java    |   8 +-
 .../fr/TestFrenchMinimalStemFilterFactory.java  |   8 +-
 .../ga/TestIrishLowerCaseFilterFactory.java     |   8 +-
 .../TestGalicianMinimalStemFilterFactory.java   |   8 +-
 .../gl/TestGalicianStemFilterFactory.java       |   8 +-
 .../lucene/analysis/hi/TestHindiFilters.java    |  24 +-
 .../hu/TestHungarianLightStemFilterFactory.java |   8 +-
 .../analysis/hunspell/TestDictionary.java       |  18 +-
 .../hunspell/TestHunspellStemFilterFactory.java |   8 +-
 .../id/TestIndonesianStemFilterFactory.java     |   8 +-
 .../it/TestItalianLightStemFilterFactory.java   |   8 +-
 .../lv/TestLatvianStemFilterFactory.java        |   8 +-
 .../DateRecognizerFilterFactoryTest.java        |   7 +-
 .../TestCapitalizationFilterFactory.java        |  18 +-
 .../TestCodepointCountFilterFactory.java        |  16 +-
 .../TestFingerprintFilterFactory.java           |   8 +-
 .../miscellaneous/TestKeepFilterFactory.java    |   8 +-
 .../TestKeywordMarkerFilterFactory.java         |   8 +-
 .../miscellaneous/TestLengthFilterFactory.java  |  16 +-
 .../TestLimitTokenCountFilterFactory.java       |  18 +-
 .../TestLimitTokenOffsetFilterFactory.java      |  18 +-
 .../TestLimitTokenPositionFilterFactory.java    |  18 +-
 .../TestRemoveDuplicatesTokenFilterFactory.java |   8 +-
 .../TestScandinavianFoldingFilterFactory.java   |   8 +-
 ...tScandinavianNormalizationFilterFactory.java |   8 +-
 .../TestStemmerOverrideFilterFactory.java       |   8 +-
 .../miscellaneous/TestTrimFilterFactory.java    |   8 +-
 .../TestTruncateTokenFilterFactory.java         |  16 +-
 .../ngram/EdgeNGramTokenFilterTest.java         |  24 +-
 .../analysis/ngram/EdgeNGramTokenizerTest.java  |  24 +-
 .../analysis/ngram/NGramTokenFilterTest.java    |  16 +-
 .../analysis/ngram/NGramTokenizerTest.java      |  17 +-
 .../lucene/analysis/ngram/TestNGramFilters.java |  32 +-
 .../no/TestNorwegianLightStemFilterFactory.java |   8 +-
 .../TestNorwegianMinimalStemFilterFactory.java  |   8 +-
 .../TestPatternReplaceCharFilterFactory.java    |   8 +-
 .../TestPatternReplaceFilterFactory.java        |   8 +-
 .../pattern/TestPatternTokenizerFactory.java    |   8 +-
 .../TestDelimitedPayloadTokenFilterFactory.java |   8 +-
 .../TestPortugueseLightStemFilterFactory.java   |   8 +-
 .../TestPortugueseMinimalStemFilterFactory.java |   8 +-
 .../pt/TestPortugueseStemFilterFactory.java     |   8 +-
 .../reverse/TestReverseStringFilterFactory.java |   8 +-
 .../ru/TestRussianLightStemFilterFactory.java   |   8 +-
 .../shingle/TestShingleFilterFactory.java       |   8 +-
 .../TestSnowballPorterFilterFactory.java        |   8 +-
 .../TestSerbianNormalizationFilterFactory.java  |   8 +-
 .../standard/TestStandardFactories.java         |  64 ++--
 .../TestUAX29URLEmailTokenizerFactory.java      |  18 +-
 .../sv/TestSwedishLightStemFilterFactory.java   |   8 +-
 .../analysis/synonym/TestSolrSynonymParser.java |  35 +-
 .../synonym/TestSynonymFilterFactory.java       |  34 +-
 .../analysis/synonym/TestSynonymMapFilter.java  |   9 +-
 .../analysis/th/TestThaiTokenizerFactory.java   |   8 +-
 .../tr/TestApostropheFilterFactory.java         |   8 +-
 .../tr/TestTurkishLowerCaseFilterFactory.java   |   8 +-
 .../analysis/util/TestAnalysisSPILoader.java    |  84 ++---
 .../analysis/util/TestCharArrayIterator.java    |   7 +-
 .../lucene/analysis/util/TestCharArrayMap.java  |  10 +-
 .../lucene/analysis/util/TestCharArraySet.java  |  26 +-
 .../analysis/util/TestCharacterUtils.java       |  22 +-
 .../analysis/util/TestElisionFilterFactory.java |   8 +-
 .../util/TestFilesystemResourceLoader.java      |  17 +-
 .../TestWikipediaTokenizerFactory.java          |   8 +-
 .../icu/TestICUFoldingFilterFactory.java        |   8 +-
 .../TestICUNormalizer2CharFilterFactory.java    |   8 +-
 .../icu/TestICUNormalizer2FilterFactory.java    |   8 +-
 .../icu/TestICUTransformFilterFactory.java      |   8 +-
 .../icu/segmentation/TestCharArrayIterator.java |   7 +-
 .../segmentation/TestICUTokenizerFactory.java   |   8 +-
 .../ja/TestJapaneseBaseFormFilterFactory.java   |   8 +-
 ...tJapaneseIterationMarkCharFilterFactory.java |   8 +-
 .../TestJapaneseKatakanaStemFilterFactory.java  |   8 +-
 .../ja/TestJapaneseNumberFilterFactory.java     |   8 +-
 ...stJapanesePartOfSpeechStopFilterFactory.java |   8 +-
 .../TestJapaneseReadingFormFilterFactory.java   |   8 +-
 .../ja/TestJapaneseTokenizerFactory.java        |   8 +-
 .../morfologik/TestMorfologikFilterFactory.java |  16 +-
 .../phonetic/TestBeiderMorseFilterFactory.java  |   8 +-
 .../TestDaitchMokotoffSoundexFilterFactory.java |   8 +-
 .../TestDoubleMetaphoneFilterFactory.java       |   8 +-
 .../phonetic/TestPhoneticFilterFactory.java     |  32 +-
 .../smart/TestHMMChineseTokenizerFactory.java   |   8 +-
 .../TestStempelPolishStemFilterFactory.java     |   8 +-
 .../uima/ae/OverridingParamsAEProviderTest.java |  14 +-
 .../lucene/index/TestMaxPositionInOldIndex.java |  22 +-
 .../benchmark/byTask/TestPerfTasksLogic.java    |  10 +-
 .../byTask/feeds/EnwikiContentSourceTest.java   |   7 +-
 .../byTask/feeds/LineDocSourceTest.java         |   7 +-
 .../byTask/feeds/TrecContentSourceTest.java     |   8 +-
 .../byTask/tasks/alt/AltPackageTaskTest.java    |   7 +-
 .../codecs/autoprefix/TestAutoPrefixTerms.java  |  23 +-
 .../lucene/analysis/TestCachingTokenFilter.java |   8 +-
 .../lucene/analysis/TestNumericTokenStream.java |  31 +-
 .../TestCharTermAttributeImpl.java              |  38 +--
 .../lucene50/TestBlockPostingsFormat.java       |   7 +-
 ...cene50StoredFieldsFormatHighCompression.java |  14 +-
 .../apache/lucene/document/TestDateTools.java   |  22 +-
 .../apache/lucene/document/TestDocument.java    |  40 +--
 .../org/apache/lucene/document/TestField.java   |  84 ++---
 .../org/apache/lucene/index/TestAddIndexes.java |  38 +--
 .../index/TestBinaryDocValuesUpdates.java       |  14 +-
 .../org/apache/lucene/index/TestCodecUtil.java  | 119 +++----
 .../index/TestConcurrentMergeScheduler.java     |  28 +-
 .../index/TestCrashCausesCorruptIndex.java      |  10 +-
 .../lucene/index/TestDirectoryReader.java       |  14 +-
 .../lucene/index/TestDirectoryReaderReopen.java |  24 +-
 .../index/TestDocInverterPerFieldErrorInfo.java |  12 +-
 .../org/apache/lucene/index/TestDocValues.java  | 115 +++----
 .../lucene/index/TestDocValuesIndexing.java     | 327 ++++++++-----------
 .../lucene/index/TestExceedMaxTermLength.java   |  26 +-
 .../index/TestExitableDirectoryReader.java      |  16 +-
 .../org/apache/lucene/index/TestIndexInput.java |  18 +-
 .../lucene/index/TestIndexReaderClose.java      |  22 +-
 .../apache/lucene/index/TestIndexWriter.java    | 125 ++++---
 .../lucene/index/TestIndexWriterCommit.java     |  17 +-
 .../lucene/index/TestIndexWriterConfig.java     |  77 ++---
 .../lucene/index/TestIndexWriterDelete.java     |  23 +-
 .../lucene/index/TestIndexWriterExceptions.java | 230 ++++++-------
 .../lucene/index/TestIndexWriterFromReader.java |  49 ++-
 .../lucene/index/TestIndexWriterMaxDocs.java    | 208 +++++-------
 .../index/TestIndexWriterMergePolicy.java       |   7 +-
 .../lucene/index/TestIndexWriterOnDiskFull.java |  28 +-
 .../lucene/index/TestIndexWriterReader.java     |  18 +-
 .../index/TestIndexWriterWithThreads.java       |  16 +-
 .../apache/lucene/index/TestMaxPosition.java    |   7 +-
 .../index/TestNumericDocValuesUpdates.java      |  14 +-
 .../org/apache/lucene/index/TestOmitTf.java     |  16 +-
 .../index/TestParallelCompositeReader.java      |  71 ++--
 .../lucene/index/TestParallelLeafReader.java    |  31 +-
 .../lucene/index/TestPayloadsOnVectors.java     |   9 +-
 .../TestPersistentSnapshotDeletionPolicy.java   |   9 +-
 .../apache/lucene/index/TestPointValues.java    | 310 ++++++++----------
 .../lucene/index/TestPostingsOffsets.java       |  34 +-
 .../apache/lucene/index/TestSegmentReader.java  |  22 +-
 .../index/TestSnapshotDeletionPolicy.java       |   9 +-
 .../lucene/index/TestTermVectorsReader.java     | 191 ++++++-----
 .../lucene/index/TestTermVectorsWriter.java     |  19 +-
 .../lucene/index/TestTieredMergePolicy.java     |  21 +-
 .../lucene/search/MultiCollectorTest.java       |  14 +-
 .../apache/lucene/search/TestBooleanQuery.java  |   7 +-
 .../lucene/search/TestCachingCollector.java     |   7 +-
 .../TestControlledRealTimeReopenThread.java     |   8 +-
 .../apache/lucene/search/TestFuzzyQuery.java    |  51 ++-
 .../apache/lucene/search/TestIndexSearcher.java |  11 +-
 .../lucene/search/TestMultiCollector.java       |   7 +-
 .../lucene/search/TestMultiPhraseQuery.java     |  14 +-
 .../search/TestMultiTermQueryRewrites.java      |   8 +-
 .../apache/lucene/search/TestPhraseQuery.java   |  21 +-
 .../apache/lucene/search/TestPointQueries.java  |  14 +-
 .../lucene/search/TestSearcherManager.java      |  43 +--
 .../apache/lucene/search/TestSynonymQuery.java  |   5 +-
 .../apache/lucene/search/TestTermScorer.java    |  11 +-
 .../search/TestTimeLimitingCollector.java       |  25 +-
 .../search/similarities/TestBM25Similarity.java |  49 ++-
 .../lucene/search/spans/TestSpanNearQuery.java  |  29 +-
 .../lucene/search/spans/TestSpanNotQuery.java   |  17 +-
 .../lucene/search/spans/TestSpanOrQuery.java    |   8 +-
 .../lucene/search/spans/TestSpanTermQuery.java  |   9 +-
 .../lucene/store/TestBufferedIndexInput.java    |  28 +-
 .../org/apache/lucene/store/TestDirectory.java  |  14 +-
 .../lucene/store/TestFileSwitchDirectory.java   |   8 +-
 .../org/apache/lucene/store/TestMultiMMap.java  |  73 ++---
 .../lucene/store/TestNativeFSLockFactory.java   |  33 +-
 .../apache/lucene/store/TestRAMDirectory.java   |   7 +-
 .../lucene/store/TestSimpleFSLockFactory.java   |  10 +-
 .../store/TestSingleInstanceLockFactory.java    |  12 +-
 .../org/apache/lucene/util/TestArrayUtil.java   |  71 ++--
 .../apache/lucene/util/TestAttributeSource.java |  22 +-
 .../org/apache/lucene/util/TestCharsRef.java    |  42 +--
 .../apache/lucene/util/TestFilterIterator.java  |  14 +-
 .../org/apache/lucene/util/TestIOUtils.java     |   7 +-
 .../lucene/util/TestLegacyNumericUtils.java     |  20 +-
 .../apache/lucene/util/TestNamedSPILoader.java  |   5 +-
 .../apache/lucene/util/TestOfflineSorter.java   |  18 +-
 .../apache/lucene/util/TestPriorityQueue.java   |  36 +-
 .../org/apache/lucene/util/TestUnicodeUtil.java |   8 +-
 .../org/apache/lucene/util/TestVersion.java     | 147 +++------
 .../apache/lucene/util/TestVirtualMethod.java   |  34 +-
 .../apache/lucene/util/TestWeakIdentityMap.java |   6 +-
 .../automaton/FiniteStringsIteratorTest.java    |   8 +-
 .../LimitedFiniteStringsIteratorTest.java       |  14 +-
 .../lucene/util/automaton/TestAutomaton.java    |   7 +-
 .../lucene/util/automaton/TestRegExp.java       |  32 +-
 .../org/apache/lucene/util/bkd/TestBKD.java     |  23 +-
 .../lucene/util/packed/TestDirectPacked.java    |   9 +-
 .../lucene/util/packed/TestPackedInts.java      |  21 +-
 .../expressions/TestExpressionValidation.java   |  56 ++--
 .../expressions/js/TestCustomFunctions.java     | 123 +++----
 .../expressions/js/TestJavascriptCompiler.java  | 116 +++----
 .../facet/range/TestRangeFacetCounts.java       |  29 +-
 .../sortedset/TestSortedSetDocValuesFacets.java |   7 +-
 .../lucene/facet/taxonomy/TestFacetLabel.java   | 134 +++-----
 .../taxonomy/TestSearcherTaxonomyManager.java   |   7 +-
 .../facet/taxonomy/TestTaxonomyCombined.java    |  24 +-
 .../taxonomy/TestTaxonomyFacetAssociations.java |  37 +--
 .../facet/taxonomy/TestTaxonomyFacetCounts.java |  46 +--
 .../TestTaxonomyFacetSumValueSource.java        |  14 +-
 .../directory/TestDirectoryTaxonomyReader.java  |   8 +-
 .../directory/TestDirectoryTaxonomyWriter.java  |  19 +-
 .../TestPostingsHighlighter.java                |  14 +-
 .../SimpleFragListBuilderTest.java              |   9 +-
 .../lucene/search/join/TestBlockJoin.java       |   8 +-
 .../search/join/TestBlockJoinValidation.java    |  35 +-
 .../lucene/index/memory/TestMemoryIndex.java    |  18 +-
 .../lucene/index/SortingLeafReaderTest.java     |   8 +-
 .../lucene/index/TestSortingMergePolicy.java    |   8 +-
 .../lucene/uninverting/TestFieldCache.java      |  70 ++--
 .../lucene/uninverting/TestFieldCacheSort.java  |   5 +-
 .../lucene/queries/CommonTermsQueryTest.java    |  22 +-
 .../analyzing/TestAnalyzingQueryParser.java     |  59 +---
 .../classic/TestMultiFieldQueryParser.java      |  50 ++-
 .../queryparser/classic/TestQueryParser.java    |  23 +-
 .../complexPhrase/TestComplexPhraseQuery.java   |   9 +-
 .../ext/TestExtendableQueryParser.java          |   6 +-
 .../lucene/queryparser/ext/TestExtensions.java  |   8 +-
 .../precedence/TestPrecedenceQueryParser.java   |  21 +-
 .../flexible/spans/TestSpanQueryParser.java     |  71 ++--
 .../standard/TestMultiFieldQPHelper.java        |  50 ++-
 .../flexible/standard/TestQPHelper.java         |  47 +--
 .../flexible/standard/TestStandardQP.java       |  12 +-
 .../IndexAndTaxonomyRevisionTest.java           |  16 +-
 .../lucene/replicator/IndexRevisionTest.java    |  32 +-
 .../lucene/replicator/LocalReplicatorTest.java  |  37 +--
 .../idversion/TestIDVersionPostingsFormat.java  |  82 ++---
 .../sandbox/queries/TestSlowFuzzyQuery.java     |  19 +-
 .../lucene/search/TestTermAutomatonQuery.java   |  14 +-
 .../geopoint/search/TestGeoPointQuery.java      |  23 +-
 .../spatial/query/SpatialArgsParserTest.java    |  16 +-
 .../lucene/search/spell/TestSpellChecker.java   |  46 +--
 .../analyzing/AnalyzingInfixSuggesterTest.java  |  16 +-
 .../analyzing/AnalyzingSuggesterTest.java       |  15 +-
 .../analyzing/TestFreeTextSuggester.java        |  24 +-
 .../analyzing/TestSuggestStopFilterFactory.java |  38 +--
 .../suggest/document/TestContextQuery.java      |  16 +-
 .../document/TestContextSuggestField.java       |  43 +--
 .../suggest/document/TestSuggestField.java      |  40 +--
 .../search/suggest/fst/BytesRefSortersTest.java |   8 +-
 .../index/BaseCompoundFormatTestCase.java       |  68 ++--
 .../index/BaseFieldInfoFormatTestCase.java      |  53 +--
 .../index/BaseSegmentInfoFormatTestCase.java    |  71 ++--
 .../apache/lucene/index/BaseTestCheckIndex.java |   9 +-
 .../java/org/apache/lucene/index/DocHelper.java |   6 +-
 .../lucene/index/RandomPostingsTester.java      |   7 +-
 .../lucene/store/BaseDirectoryTestCase.java     | 177 ++++------
 .../lucene/store/BaseLockFactoryTestCase.java   |  13 +-
 277 files changed, 2787 insertions(+), 4626 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicFilters.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicFilters.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicFilters.java
index 7bc9abc..eb2018f 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicFilters.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicFilters.java
@@ -61,25 +61,19 @@ public class TestArabicFilters extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("ArabicNormalization", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("Arabicstem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {      
       charFilterFactory("Persian", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemFilterFactory.java
index 7edd86b..4b19c94 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemFilterFactory.java
@@ -41,11 +41,9 @@ public class TestBulgarianStemFilterFactory extends BaseTokenStreamFactoryTestCa
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("BulgarianStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianStemFilterFactory.java
index b325797..af47bd2 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianStemFilterFactory.java
@@ -42,11 +42,9 @@ public class TestBrazilianStemFilterFactory extends BaseTokenStreamFactoryTestCa
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("BrazilianStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilterFactory.java
index f3a0b71..75b3e87 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilterFactory.java
@@ -104,11 +104,9 @@ public class TestHTMLStripCharFilterFactory extends BaseTokenStreamFactoryTestCa
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       charFilterFactory("HTMLStrip", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilterFactory.java
index b1c730f..e24089c 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilterFactory.java
@@ -24,11 +24,9 @@ public class TestMappingCharFilterFactory extends BaseTokenStreamFactoryTestCase
 
     MappingCharFilterFactory f = (MappingCharFilterFactory)charFilterFactory("Mapping");
 
-    try {
-      f.parseString( "\\" );
-      fail( "escape character cannot be alone." );
-    }
-    catch (IllegalArgumentException expected) {}
+    expectThrows(IllegalArgumentException.class, () -> {      
+      f.parseString("\\");
+    });
     
     assertEquals( "unexpected escaped characters",
         "\\\"\n\t\r\b\f", f.parseString( "\\\\\\\"\\n\\t\\r\\b\\f" ) );
@@ -37,26 +35,21 @@ public class TestMappingCharFilterFactory extends BaseTokenStreamFactoryTestCase
     assertEquals( "unexpected escaped characters",
         "AB", f.parseString( "\\u0041\\u0042" ) );
 
-    try {
-      f.parseString( "\\u000" );
-      fail( "invalid length check." );
-    }
-    catch (IllegalArgumentException expected) {}
+    expectThrows(IllegalArgumentException.class, () -> {      
+      f.parseString("\\u000");
+    });
 
-    try {
-      f.parseString( "\\u123x" );
-      fail( "invalid hex number check." );
-    }
-    catch( NumberFormatException expected ){}
+    // invalid hex number
+    expectThrows(NumberFormatException.class, () -> {      
+      f.parseString("\\u123x");
+    });
   }
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       charFilterFactory("Mapping", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilterFactory.java
index 6828d51..a917e0c 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilterFactory.java
@@ -60,11 +60,8 @@ public class TestCJKBigramFilterFactory extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("CJKBigram", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilterFactory.java
index c9e8088..d4882a9 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilterFactory.java
@@ -37,11 +37,9 @@ public class TestCJKWidthFilterFactory extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("CJKWidth", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilterFactory.java
index b1027b2..510b83c 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilterFactory.java
@@ -38,11 +38,9 @@ public class TestSoraniNormalizationFilterFactory extends BaseTokenStreamFactory
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("SoraniNormalization", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilterFactory.java
index 384ea9e..1c4b162 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilterFactory.java
@@ -40,11 +40,9 @@ public class TestSoraniStemFilterFactory extends BaseTokenStreamFactoryTestCase
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("SoraniStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilterFactory.java
index e1838b4..98c351e 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilterFactory.java
@@ -92,11 +92,9 @@ public class TestCommonGramsFilterFactory extends BaseTokenStreamFactoryTestCase
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("CommonGrams", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsQueryFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsQueryFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsQueryFilterFactory.java
index 8ed2e40..7c826a9 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsQueryFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsQueryFilterFactory.java
@@ -91,11 +91,9 @@ public class TestCommonGramsQueryFilterFactory extends BaseTokenStreamFactoryTes
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("CommonGramsQuery", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestDictionaryCompoundWordTokenFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestDictionaryCompoundWordTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestDictionaryCompoundWordTokenFilterFactory.java
index 76532aa..8862519 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestDictionaryCompoundWordTokenFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestDictionaryCompoundWordTokenFilterFactory.java
@@ -44,13 +44,11 @@ public class TestDictionaryCompoundWordTokenFilterFactory extends BaseTokenStrea
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("DictionaryCompoundWord", 
           "dictionary", "compoundDictionary.txt", 
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestHyphenationCompoundWordTokenFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestHyphenationCompoundWordTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestHyphenationCompoundWordTokenFilterFactory.java
index 31f65d3..0039e20 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestHyphenationCompoundWordTokenFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestHyphenationCompoundWordTokenFilterFactory.java
@@ -67,13 +67,11 @@ public class TestHyphenationCompoundWordTokenFilterFactory extends BaseTokenStre
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {      
       tokenFilterFactory("HyphenationCompoundWord", 
           "hyphenator", "da_UTF8.xml",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java
index e69d5b8..783811a 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java
@@ -138,75 +138,55 @@ public class TestBugInSomething extends BaseTokenStreamTestCase {
   
   public void testWrapping() throws Exception {
     CharFilter cs = new TestRandomChains.CheckThatYouDidntReadAnythingReaderWrapper(wrappedStream);
-    try {
+    Exception expected = expectThrows(Exception.class, () -> {
       cs.mark(1);
-      fail();
-    } catch (Exception e) {
-      assertEquals("mark(int)", e.getMessage());
-    }
+    });
+    assertEquals("mark(int)", expected.getMessage());
     
-    try {
+    expected = expectThrows(Exception.class, () -> {
       cs.markSupported();
-      fail();
-    } catch (Exception e) {
-      assertEquals("markSupported()", e.getMessage());
-    }
+    });
+    assertEquals("markSupported()", expected.getMessage());
     
-    try {
+    expected = expectThrows(Exception.class, () -> {
       cs.read();
-      fail();
-    } catch (Exception e) {
-      assertEquals("read()", e.getMessage());
-    }
+    });
+    assertEquals("read()", expected.getMessage());
     
-    try {
+    expected = expectThrows(Exception.class, () -> {
       cs.read(new char[0]);
-      fail();
-    } catch (Exception e) {
-      assertEquals("read(char[])", e.getMessage());
-    }
+    });
+    assertEquals("read(char[])", expected.getMessage());
     
-    try {
+    expected = expectThrows(Exception.class, () -> {
       cs.read(CharBuffer.wrap(new char[0]));
-      fail();
-    } catch (Exception e) {
-      assertEquals("read(CharBuffer)", e.getMessage());
-    }
+    });
+    assertEquals("read(CharBuffer)", expected.getMessage());
     
-    try {
+    expected = expectThrows(Exception.class, () -> {
       cs.reset();
-      fail();
-    } catch (Exception e) {
-      assertEquals("reset()", e.getMessage());
-    }
+    });
+    assertEquals("reset()", expected.getMessage());
     
-    try {
+    expected = expectThrows(Exception.class, () -> {
       cs.skip(1);
-      fail();
-    } catch (Exception e) {
-      assertEquals("skip(long)", e.getMessage());
-    }
+    });
+    assertEquals("skip(long)", expected.getMessage());
     
-    try {
+    expected = expectThrows(Exception.class, () -> {
       cs.correctOffset(1);
-      fail();
-    } catch (Exception e) {
-      assertEquals("correct(int)", e.getMessage());
-    }
+    });
+    assertEquals("correct(int)", expected.getMessage());
     
-    try {
+    expected = expectThrows(Exception.class, () -> {
       cs.close();
-      fail();
-    } catch (Exception e) {
-      assertEquals("close()", e.getMessage());
-    }
+    });
+    assertEquals("close()", expected.getMessage());
     
-    try {
+    expected = expectThrows(Exception.class, () -> {
       cs.read(new char[0], 0, 0);
-      fail();
-    } catch (Exception e) {
-      assertEquals("read(char[], int, int)", e.getMessage());
-    }
+    });
+    assertEquals("read(char[], int, int)", expected.getMessage());
   }
   
   // todo: test framework?

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilterFactory.java
index 112f009..8a484d4 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilterFactory.java
@@ -40,11 +40,9 @@ public class TestDecimalDigitFilterFactory extends BaseTokenStreamFactoryTestCas
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("DecimalDigit", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopFilterFactory.java
index 1d0aa8a..9fca6b9 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopFilterFactory.java
@@ -66,37 +66,33 @@ public class TestStopFilterFactory extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Stop", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 
   /** Test that bogus arguments result in exception */
   public void testBogusFormats() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Stop", 
                          "words", "stop-snowball.txt",
                          "format", "bogus");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      String msg = expected.getMessage();
-      assertTrue(msg, msg.contains("Unknown"));
-      assertTrue(msg, msg.contains("format"));
-      assertTrue(msg, msg.contains("bogus"));
-    }
-    try {
+    });
+    String msg = expected.getMessage();
+    assertTrue(msg, msg.contains("Unknown"));
+    assertTrue(msg, msg.contains("format"));
+    assertTrue(msg, msg.contains("bogus"));
+
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Stop", 
                          // implicit default words file
                          "format", "bogus");
       fail();
-    } catch (IllegalArgumentException expected) {
-      String msg = expected.getMessage();
-      assertTrue(msg, msg.contains("can not be specified"));
-      assertTrue(msg, msg.contains("format"));
-      assertTrue(msg, msg.contains("bogus"));
-    }
+    });
+    msg = expected.getMessage();
+    assertTrue(msg, msg.contains("can not be specified"));
+    assertTrue(msg, msg.contains("format"));
+    assertTrue(msg, msg.contains("bogus"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilterFactory.java
index f7a1f62..0cfa575 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilterFactory.java
@@ -59,23 +59,19 @@ public class TestTypeTokenFilterFactory extends BaseTokenStreamFactoryTestCase {
   }
 
   public void testMissingTypesParameter() throws Exception {
-    try {
+    // not supplying 'types' parameter should cause an IllegalArgumentException
+    expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Type");
-      fail("not supplying 'types' parameter should cause an IllegalArgumentException");
-    } catch (IllegalArgumentException e) {
-      // everything ok
-    }
+    });
   }
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Type", 
           "types", "stoptypes-1.txt", 
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/custom/TestCustomAnalyzer.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/custom/TestCustomAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/custom/TestCustomAnalyzer.java
index 86088c0..af11927 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/custom/TestCustomAnalyzer.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/custom/TestCustomAnalyzer.java
@@ -203,15 +203,12 @@ public class TestCustomAnalyzer extends BaseTokenStreamTestCase {
     assertAnalyzesTo(a, "foo Foo Bar", new String[0]);
     
     // try with unmodifiableMap, should fail
-    try {
+    expectThrows(UnsupportedOperationException.class, () -> {
       CustomAnalyzer.builder()
           .withTokenizer("whitespace")
           .addTokenFilter("stop", stopConfigImmutable)
           .build();
-      fail();
-    } catch (UnsupportedOperationException e) {
-      // pass
-    }
+    });
     a.close();
   }
   
@@ -242,133 +239,101 @@ public class TestCustomAnalyzer extends BaseTokenStreamTestCase {
   // Now test misconfigurations:
 
   public void testIncorrectOrder() throws Exception {
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       CustomAnalyzer.builder()
           .addCharFilter("htmlstrip")
           .withDefaultMatchVersion(Version.LATEST)
           .withTokenizer("whitespace")
           .build();
-      fail();
-    } catch (IllegalStateException e) {
-      // pass
-    }
+    });
   }
 
   public void testMissingSPI() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       CustomAnalyzer.builder()
           .withTokenizer("foobar_nonexistent")
           .build();
-      fail();
-    } catch (IllegalArgumentException e) {
-      assertTrue(e.getMessage().contains("SPI"));
-      assertTrue(e.getMessage().contains("does not exist"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("SPI"));
+    assertTrue(expected.getMessage().contains("does not exist"));
   }
 
   public void testSetTokenizerTwice() throws Exception {
-    try {
+    expectThrows(AlreadySetException.class, () -> {
       CustomAnalyzer.builder()
           .withTokenizer("whitespace")
           .withTokenizer(StandardTokenizerFactory.class)
           .build();
-      fail();
-    } catch (AlreadySetException e) {
-      // pass
-    }
+    });
   }
 
   public void testSetMatchVersionTwice() throws Exception {
-    try {
+    expectThrows(AlreadySetException.class, () -> {
       CustomAnalyzer.builder()
           .withDefaultMatchVersion(Version.LATEST)
           .withDefaultMatchVersion(Version.LATEST)
           .withTokenizer("standard")
           .build();
-      fail();
-    } catch (AlreadySetException e) {
-      // pass
-    }
+    });
   }
 
   public void testSetPosIncTwice() throws Exception {
-    try {
+    expectThrows(AlreadySetException.class, () -> {
       CustomAnalyzer.builder()
           .withPositionIncrementGap(2)
           .withPositionIncrementGap(3)
           .withTokenizer("standard")
           .build();
-      fail();
-    } catch (AlreadySetException e) {
-      // pass
-    }
+    });
   }
 
   public void testSetOfsGapTwice() throws Exception {
-    try {
+    expectThrows(AlreadySetException.class, () -> {
       CustomAnalyzer.builder()
           .withOffsetGap(2)
           .withOffsetGap(3)
           .withTokenizer("standard")
           .build();
-      fail();
-    } catch (AlreadySetException e) {
-      // pass
-    }
+    });
   }
 
   public void testNoTokenizer() throws Exception {
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       CustomAnalyzer.builder().build();
-      fail();
-    } catch (IllegalStateException e) {
-      assertTrue(e.getMessage().equals("You have to set at least a tokenizer."));
-    }
+    });
   }
 
   public void testNullTokenizer() throws Exception {
-    try {
+    expectThrows(NullPointerException.class, () -> {
       CustomAnalyzer.builder()
         .withTokenizer((String) null)
         .build();
-      fail();
-    } catch (NullPointerException e) {
-      // pass
-    }
+    });
   }
 
   public void testNullTokenizerFactory() throws Exception {
-    try {
+    expectThrows(NullPointerException.class, () -> {
       CustomAnalyzer.builder()
         .withTokenizer((Class<TokenizerFactory>) null)
         .build();
-      fail();
-    } catch (NullPointerException e) {
-      // pass
-    }
+    });
   }
 
   public void testNullParamKey() throws Exception {
-    try {
+    expectThrows(NullPointerException.class, () -> {
       CustomAnalyzer.builder()
         .withTokenizer("whitespace", null, "foo")
         .build();
-      fail();
-    } catch (NullPointerException e) {
-      // pass
-    }
+    });
   }
 
   public void testNullMatchVersion() throws Exception {
-    try {
+    expectThrows(NullPointerException.class, () -> {
       CustomAnalyzer.builder()
         .withDefaultMatchVersion(null)
         .withTokenizer("whitespace")
         .build();
-      fail();
-    } catch (NullPointerException e) {
-      // pass
-    }
+    });
   }
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemFilterFactory.java
index 81fbfc7..10a36ae 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemFilterFactory.java
@@ -42,11 +42,9 @@ public class TestCzechStemFilterFactory extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("CzechStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilterFactory.java
index 6d52e3b..5bf6ed0 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilterFactory.java
@@ -37,11 +37,9 @@ public class TestGermanLightStemFilterFactory extends BaseTokenStreamFactoryTest
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("GermanLightStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilterFactory.java
index e571cea..5c85894 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilterFactory.java
@@ -39,11 +39,9 @@ public class TestGermanMinimalStemFilterFactory extends BaseTokenStreamFactoryTe
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("GermanMinimalStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilterFactory.java
index 02effb3..fd65746 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilterFactory.java
@@ -39,11 +39,9 @@ public class TestGermanNormalizationFilterFactory extends BaseTokenStreamFactory
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("GermanNormalization", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilterFactory.java
index 1383ec0..952283a 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilterFactory.java
@@ -42,11 +42,9 @@ public class TestGermanStemFilterFactory extends BaseTokenStreamFactoryTestCase
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("GermanStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekLowerCaseFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekLowerCaseFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekLowerCaseFilterFactory.java
index 85d516d..cedc9ab 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekLowerCaseFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekLowerCaseFilterFactory.java
@@ -40,11 +40,9 @@ public class TestGreekLowerCaseFilterFactory extends BaseTokenStreamFactoryTestC
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("GreekLowerCase", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemFilterFactory.java
index 75d7c4c..13830e9 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemFilterFactory.java
@@ -38,11 +38,9 @@ public class TestGreekStemFilterFactory extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("GreekStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilterFactory.java
index 547a127..e3dc81d 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilterFactory.java
@@ -37,11 +37,9 @@ public class TestEnglishMinimalStemFilterFactory extends BaseTokenStreamFactoryT
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("EnglishMinimalStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemFilterFactory.java
index acefd6c..79fa7cf 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemFilterFactory.java
@@ -37,11 +37,9 @@ public class TestKStemFilterFactory extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("KStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilterFactory.java
index dabb39c..a7739b2 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilterFactory.java
@@ -40,11 +40,9 @@ public class TestPorterStemFilterFactory extends BaseTokenStreamFactoryTestCase
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("PorterStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilterFactory.java
index f75b5b0..1e038e2 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilterFactory.java
@@ -39,11 +39,9 @@ public class TestSpanishLightStemFilterFactory extends BaseTokenStreamFactoryTes
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("SpanishLightStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilterFactory.java
index 0479c00..5bffb71 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilterFactory.java
@@ -40,11 +40,9 @@ public class TestPersianNormalizationFilterFactory extends BaseTokenStreamFactor
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("PersianNormalization", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilterFactory.java
index 852e35b..a433c95 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilterFactory.java
@@ -39,11 +39,9 @@ public class TestFinnishLightStemFilterFactory extends BaseTokenStreamFactoryTes
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("FinnishLightStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilterFactory.java
index cb57376..15a2b96 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilterFactory.java
@@ -37,11 +37,9 @@ public class TestFrenchLightStemFilterFactory extends BaseTokenStreamFactoryTest
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("FrenchLightStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilterFactory.java
index d5790b6..6cd399b 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilterFactory.java
@@ -37,11 +37,9 @@ public class TestFrenchMinimalStemFilterFactory extends BaseTokenStreamFactoryTe
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("FrenchMinimalStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilterFactory.java
index d5d96bf..2014936 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilterFactory.java
@@ -37,11 +37,9 @@ public class TestIrishLowerCaseFilterFactory extends BaseTokenStreamFactoryTestC
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("IrishLowerCase", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilterFactory.java
index 4fb75bd..ddc60f0 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilterFactory.java
@@ -37,11 +37,9 @@ public class TestGalicianMinimalStemFilterFactory extends BaseTokenStreamFactory
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("GalicianMinimalStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilterFactory.java
index ef3242e..e02fc5c 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilterFactory.java
@@ -37,11 +37,9 @@ public class TestGalicianStemFilterFactory extends BaseTokenStreamFactoryTestCas
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("GalicianStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiFilters.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiFilters.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiFilters.java
index bdf4087..8caf700 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiFilters.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiFilters.java
@@ -64,25 +64,19 @@ public class TestHindiFilters extends BaseTokenStreamFactoryTestCase {
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("IndicNormalization", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("HindiNormalization", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
     
-    try {
+    expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("HindiStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilterFactory.java
index 53a1832..b595067 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilterFactory.java
@@ -37,11 +37,9 @@ public class TestHungarianLightStemFilterFactory extends BaseTokenStreamFactoryT
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("HungarianLightStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java
index 455a111..4f04407 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java
@@ -131,13 +131,11 @@ public class TestDictionary extends LuceneTestCase {
     InputStream dictStream = getClass().getResourceAsStream("simple.dic");
     Directory tempDir = getDirectory();
     
-    try {
+    ParseException expected = expectThrows(ParseException.class, () -> {
       new Dictionary(tempDir, "dictionary", affixStream, dictStream);
-      fail("didn't get expected exception");
-    } catch (ParseException expected) {
-      assertTrue(expected.getMessage().startsWith("The affix file contains a rule with less than four elements"));
-      assertEquals(24, expected.getErrorOffset());
-    }
+    });
+    assertTrue(expected.getMessage().startsWith("The affix file contains a rule with less than four elements"));
+    assertEquals(24, expected.getErrorOffset());
     
     affixStream.close();
     dictStream.close();
@@ -150,12 +148,10 @@ public class TestDictionary extends LuceneTestCase {
     InputStream dictStream = getClass().getResourceAsStream("simple.dic");
     Directory tempDir = getDirectory();
     
-    try {
+    Exception expected = expectThrows(Exception.class, () -> {
       new Dictionary(tempDir, "dictionary", affixStream, dictStream);
-      fail("didn't get expected exception");
-    } catch (Exception expected) {
-      assertTrue(expected.getMessage().startsWith("expected only one flag"));
-    }
+    });
+    assertTrue(expected.getMessage().startsWith("expected only one flag"));
     
     affixStream.close();
     dictStream.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilterFactory.java
index 77a5d34..7c44552 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilterFactory.java
@@ -38,13 +38,11 @@ public class TestHunspellStemFilterFactory extends BaseTokenStreamFactoryTestCas
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("HunspellStem",
           "dictionary", "simple.dic",
           "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemFilterFactory.java
index 5b5c11c..ad382ec 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemFilterFactory.java
@@ -53,11 +53,9 @@ public class TestIndonesianStemFilterFactory extends BaseTokenStreamFactoryTestC
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("IndonesianStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilterFactory.java
index c809f61..a9d763f 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilterFactory.java
@@ -37,11 +37,9 @@ public class TestItalianLightStemFilterFactory extends BaseTokenStreamFactoryTes
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("ItalianLightStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemFilterFactory.java
index fd0220d..8ccdbaf 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemFilterFactory.java
@@ -39,11 +39,9 @@ public class TestLatvianStemFilterFactory extends BaseTokenStreamFactoryTestCase
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("LatvianStem", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/DateRecognizerFilterFactoryTest.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/DateRecognizerFilterFactoryTest.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/DateRecognizerFilterFactoryTest.java
index 8d15e18..739f78f 100755
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/DateRecognizerFilterFactoryTest.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/DateRecognizerFilterFactoryTest.java
@@ -24,14 +24,11 @@ import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 public class DateRecognizerFilterFactoryTest extends BaseTokenStreamTestCase {
 
   public void testBadLanguageTagThrowsException() {
-    try { 
+    expectThrows(Exception.class, () -> {
       final Map<String,String> args = new HashMap<>();
       args.put(DateRecognizerFilterFactory.LOCALE, "en_US");
       new DateRecognizerFilterFactory(args);
-      fail("Bad language tag should have thrown an exception");
-    } catch (Exception e) {
-      // expected;
-    }
+    });
   }
   
   public void testGoodLocaleParsesWell() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilterFactory.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilterFactory.java
index 3581c08..1a4f726 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilterFactory.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilterFactory.java
@@ -264,12 +264,10 @@ public class TestCapitalizationFilterFactory extends BaseTokenStreamFactoryTestC
   
   /** Test that bogus arguments result in exception */
   public void testBogusArguments() throws Exception {
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       tokenFilterFactory("Capitalization", "bogusArg", "bogusValue");
-      fail();
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("Unknown parameters"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("Unknown parameters"));
   }
 
   /**
@@ -277,7 +275,7 @@ public class TestCapitalizationFilterFactory extends BaseTokenStreamFactoryTestC
    */
   public void testInvalidArguments() throws Exception {
     for (final String arg : new String[]{"minWordLength", "maxTokenLength", "maxWordCount"}) {
-      try {
+      IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
         Reader reader = new StringReader("foo foobar super-duper-trooper");
         TokenStream stream = whitespaceMockTokenizer(reader);
 
@@ -287,11 +285,9 @@ public class TestCapitalizationFilterFactory extends BaseTokenStreamFactoryTestC
             arg, "-3",
             "okPrefix", "McK",
             "forceFirstLetter", "true").create(stream);
-        fail();
-      } catch (IllegalArgumentException expected) {
-        assertTrue(expected.getMessage().contains(arg + " must be greater than or equal to zero")
-            || expected.getMessage().contains(arg + " must be greater than zero"));
-      }
+      });
+      assertTrue(expected.getMessage().contains(arg + " must be greater than or equal to zero") ||
+                 expected.getMessage().contains(arg + " must be greater than zero"));
     }
   }
 }


[27/53] [abbrv] lucene-solr git commit: Replacing Subversion with GIT

Posted by no...@apache.org.
Replacing Subversion with GIT


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/1d0084a9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/1d0084a9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1d0084a9

Branch: refs/heads/apiv2
Commit: 1d0084a9ccd7ad44e7b04e5e6532c8131598acf3
Parents: 5c024e6
Author: Noble Paul <no...@apache.org>
Authored: Mon Feb 22 05:40:44 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Mon Feb 22 05:40:44 2016 +0530

----------------------------------------------------------------------
 solr/README.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1d0084a9/solr/README.txt
----------------------------------------------------------------------
diff --git a/solr/README.txt b/solr/README.txt
index 0a8175e..3e7a09c 100644
--- a/solr/README.txt
+++ b/solr/README.txt
@@ -142,7 +142,7 @@ Instructions for Building Apache Solr from Source
 3. Download the Apache Solr distribution, linked from the above web site. 
    Unzip the distribution to a folder of your choice, e.g. C:\solr or ~/solr
    Alternately, you can obtain a copy of the latest Apache Solr source code
-   directly from the Subversion repository:
+   directly from the GIT repository:
 
      http://lucene.apache.org/solr/versioncontrol.html
 


[09/53] [abbrv] lucene-solr git commit: SOLR-8694: DistributedMap/Queue can create too many Watchers and some code simplification.

Posted by no...@apache.org.
SOLR-8694: DistributedMap/Queue can create too many Watchers and some code simplification.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/32fbca6e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/32fbca6e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/32fbca6e

Branch: refs/heads/apiv2
Commit: 32fbca6ea7b65043041e622660e07915f04090fe
Parents: 189e985
Author: markrmiller <ma...@apache.org>
Authored: Fri Feb 19 14:33:50 2016 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Fri Feb 19 14:33:50 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                |   3 +
 .../org/apache/solr/cloud/DistributedMap.java   | 152 +------------------
 .../org/apache/solr/cloud/DistributedQueue.java |   6 +-
 .../java/org/apache/solr/cloud/Overseer.java    |   6 +-
 .../solr/cloud/SizeLimitedDistributedMap.java   |  29 ++--
 .../solr/handler/admin/CollectionsHandler.java  |   8 +-
 6 files changed, 34 insertions(+), 170 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32fbca6e/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 953b2d4..c0c8856 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -182,6 +182,9 @@ Bug Fixes
 * SOLR-8701: CloudSolrClient decides that there are no healthy nodes to handle a request too early.
   (Mark Miller)
 
+* SOLR-8694: DistributedMap/Queue can create too many Watchers and some code simplification. 
+  (Scott Blum via Mark Miller)
+
 Optimizations
 ----------------------
 * SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32fbca6e/solr/core/src/java/org/apache/solr/cloud/DistributedMap.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/DistributedMap.java b/solr/core/src/java/org/apache/solr/cloud/DistributedMap.java
index 8434eb8..c3b5690 100644
--- a/solr/core/src/java/org/apache/solr/cloud/DistributedMap.java
+++ b/solr/core/src/java/org/apache/solr/cloud/DistributedMap.java
@@ -22,15 +22,9 @@ import org.apache.solr.common.cloud.SolrZkClient;
 import org.apache.solr.common.cloud.ZkCmdExecutor;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.ZooDefs;
 import org.apache.zookeeper.data.ACL;
 import org.apache.zookeeper.data.Stat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-import java.lang.invoke.MethodHandles;
 import java.util.List;
 
 /**
@@ -39,19 +33,13 @@ import java.util.List;
  * don't have to be ordered i.e. DistributedQueue.
  */
 public class DistributedMap {
-  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-  protected static long DEFAULT_TIMEOUT = 5*60*1000;
-
   protected final String dir;
 
   protected SolrZkClient zookeeper;
 
   protected final String prefix = "mn-";
 
-  protected final String response_prefix = "mnr-" ;
-
-  public DistributedMap(SolrZkClient zookeeper, String dir, List<ACL> acl) {
+  public DistributedMap(SolrZkClient zookeeper, String dir) {
     this.dir = dir;
 
     ZkCmdExecutor cmdExecutor = new ZkCmdExecutor(zookeeper.getZkClientTimeout());
@@ -67,89 +55,13 @@ public class DistributedMap {
     this.zookeeper = zookeeper;
   }
 
-  protected class LatchChildWatcher implements Watcher {
-
-    Object lock = new Object();
-    private WatchedEvent event = null;
-
-    public LatchChildWatcher() {}
-
-    public LatchChildWatcher(Object lock) {
-      this.lock = lock;
-    }
-
-    @Override
-    public void process(WatchedEvent event) {
-      LOG.info("LatchChildWatcher fired on path: " + event.getPath() + " state: "
-          + event.getState() + " type " + event.getType());
-      synchronized (lock) {
-        this.event = event;
-        lock.notifyAll();
-      }
-    }
-
-    public void await(long timeout) throws InterruptedException {
-      synchronized (lock) {
-        lock.wait(timeout);
-      }
-    }
-
-    public WatchedEvent getWatchedEvent() {
-      return event;
-    }
-  }
-
-  /**
-   * Inserts data into zookeeper.
-   *
-   * @return true if data was successfully added
-   */
-  protected String createData(String path, byte[] data, CreateMode mode)
-      throws KeeperException, InterruptedException {
-      for (;;) {
-      try {
-        return zookeeper.create(path, data, mode, true);
-      } catch (KeeperException.NoNodeException e) {
-        try {
-          zookeeper.create(dir, new byte[0], CreateMode.PERSISTENT, true);
-        } catch (KeeperException.NodeExistsException ne) {
-          // someone created it
-        }
-      }
-    }
-  }
-
-
-  public boolean put(String trackingId, byte[] data) throws KeeperException, InterruptedException {
-    return createData(dir + "/" + prefix + trackingId, data,
-        CreateMode.PERSISTENT) != null;
-  }
 
-  /**
-   * Offer the data and wait for the response
-   *
-   */
-  public MapEvent put(String trackingId, byte[] data, long timeout) throws KeeperException,
-      InterruptedException {
-    String path = createData(dir + "/" + prefix + trackingId, data,
-        CreateMode.PERSISTENT);
-    String watchID = createData(
-        dir + "/" + response_prefix + path.substring(path.lastIndexOf("-") + 1),
-        null, CreateMode.EPHEMERAL);
-    Object lock = new Object();
-    LatchChildWatcher watcher = new LatchChildWatcher(lock);
-    synchronized (lock) {
-      if (zookeeper.exists(watchID, watcher, true) != null) {
-        watcher.await(timeout);
-      }
-    }
-    byte[] bytes = zookeeper.getData(watchID, null, null, true);
-    zookeeper.delete(watchID, -1, true);
-    return new MapEvent(watchID, bytes, watcher.getWatchedEvent());
+  public void put(String trackingId, byte[] data) throws KeeperException, InterruptedException {
+    zookeeper.makePath(dir + "/" + prefix + trackingId, data, CreateMode.PERSISTENT, null, false, true);
   }
 
-  public MapEvent get(String trackingId) throws KeeperException, InterruptedException {
-    return new MapEvent(trackingId, zookeeper.getData(dir + "/" + prefix + trackingId, null, null, true), null);
+  public byte[] get(String trackingId) throws KeeperException, InterruptedException {
+    return zookeeper.getData(dir + "/" + prefix + trackingId, null, null, true);
   }
 
   public boolean contains(String trackingId) throws KeeperException, InterruptedException {
@@ -187,58 +99,4 @@ public class DistributedMap {
 
   }
 
-  public static class MapEvent {
-    @Override
-    public int hashCode() {
-      final int prime = 31;
-      int result = 1;
-      result = prime * result + ((id == null) ? 0 : id.hashCode());
-      return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-      if (this == obj) return true;
-      if (obj == null) return false;
-      if (getClass() != obj.getClass()) return false;
-      MapEvent other = (MapEvent) obj;
-      if (id == null) {
-        if (other.id != null) return false;
-      } else if (!id.equals(other.id)) return false;
-      return true;
-    }
-
-    private WatchedEvent event = null;
-    private String id;
-    private byte[] bytes;
-
-    MapEvent(String id, byte[] bytes, WatchedEvent event) {
-      this.id = id;
-      this.bytes = bytes;
-      this.event = event;
-    }
-
-    public void setId(String id) {
-      this.id = id;
-    }
-
-    public String getId() {
-      return id;
-    }
-
-    public void setBytes(byte[] bytes) {
-      this.bytes = bytes;
-    }
-
-    public byte[] getBytes() {
-      return bytes;
-    }
-
-    public WatchedEvent getWatchedEvent() {
-      return event;
-    }
-
-  }
-
-  
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32fbca6e/solr/core/src/java/org/apache/solr/cloud/DistributedQueue.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/DistributedQueue.java b/solr/core/src/java/org/apache/solr/cloud/DistributedQueue.java
index 87d92c6..e424b7e 100644
--- a/solr/core/src/java/org/apache/solr/cloud/DistributedQueue.java
+++ b/solr/core/src/java/org/apache/solr/cloud/DistributedQueue.java
@@ -318,7 +318,7 @@ public class DistributedQueue {
         }
         return orderedChildren;
       } catch (KeeperException.NoNodeException e) {
-        zookeeper.create(dir, new byte[0], CreateMode.PERSISTENT, true);
+        zookeeper.makePath(dir, false, true);
         // go back to the loop and try again
       }
     }
@@ -408,6 +408,10 @@ public class DistributedQueue {
 
     @Override
     public void process(WatchedEvent event) {
+      // session events are not change events, and do not remove the watcher; except for Expired
+      if (Event.EventType.None.equals(event.getType()) && !Event.KeeperState.Expired.equals(event.getState())) {
+        return;
+      }
       updateLock.lock();
       try {
         // this watcher is automatically cleared when fired

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32fbca6e/solr/core/src/java/org/apache/solr/cloud/Overseer.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/Overseer.java b/solr/core/src/java/org/apache/solr/cloud/Overseer.java
index 3fe2e5c..8dfacb1 100644
--- a/solr/core/src/java/org/apache/solr/cloud/Overseer.java
+++ b/solr/core/src/java/org/apache/solr/cloud/Overseer.java
@@ -912,19 +912,19 @@ public class Overseer implements Closeable {
   /* Internal map for failed tasks, not to be used outside of the Overseer */
   static DistributedMap getRunningMap(final SolrZkClient zkClient) {
     createOverseerNode(zkClient);
-    return new DistributedMap(zkClient, "/overseer/collection-map-running", null);
+    return new DistributedMap(zkClient, "/overseer/collection-map-running");
   }
 
   /* Size-limited map for successfully completed tasks*/
   static DistributedMap getCompletedMap(final SolrZkClient zkClient) {
     createOverseerNode(zkClient);
-    return new SizeLimitedDistributedMap(zkClient, "/overseer/collection-map-completed", null, NUM_RESPONSES_TO_STORE);
+    return new SizeLimitedDistributedMap(zkClient, "/overseer/collection-map-completed", NUM_RESPONSES_TO_STORE);
   }
 
   /* Map for failed tasks, not to be used outside of the Overseer */
   static DistributedMap getFailureMap(final SolrZkClient zkClient) {
     createOverseerNode(zkClient);
-    return new SizeLimitedDistributedMap(zkClient, "/overseer/collection-map-failure", null, NUM_RESPONSES_TO_STORE);
+    return new SizeLimitedDistributedMap(zkClient, "/overseer/collection-map-failure", NUM_RESPONSES_TO_STORE);
   }
   
   /* Collection creation queue */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32fbca6e/solr/core/src/java/org/apache/solr/cloud/SizeLimitedDistributedMap.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/SizeLimitedDistributedMap.java b/solr/core/src/java/org/apache/solr/cloud/SizeLimitedDistributedMap.java
index 418eb66..3326dca 100644
--- a/solr/core/src/java/org/apache/solr/cloud/SizeLimitedDistributedMap.java
+++ b/solr/core/src/java/org/apache/solr/cloud/SizeLimitedDistributedMap.java
@@ -33,41 +33,40 @@ public class SizeLimitedDistributedMap extends DistributedMap {
 
   private final int maxSize;
 
-  public SizeLimitedDistributedMap(SolrZkClient zookeeper, String dir, List<ACL> acl, int maxSize) {
-    super(zookeeper, dir, acl);
+  public SizeLimitedDistributedMap(SolrZkClient zookeeper, String dir, int maxSize) {
+    super(zookeeper, dir);
     this.maxSize = maxSize;
   }
-  
+
   @Override
-  public boolean put(String trackingId, byte[] data) throws KeeperException, InterruptedException {
-    if(this.size() >= maxSize) {
+  public void put(String trackingId, byte[] data) throws KeeperException, InterruptedException {
+    if (this.size() >= maxSize) {
       // Bring down the size
       List<String> children = zookeeper.getChildren(dir, null, true);
 
       int cleanupSize = maxSize / 10;
-      
+
       final PriorityQueue priorityQueue = new PriorityQueue<Long>(cleanupSize) {
         @Override
         protected boolean lessThan(Long a, Long b) {
           return (a > b);
         }
       };
-      
-      for(String child: children) {
+
+      for (String child : children) {
         Stat stat = zookeeper.exists(dir + "/" + child, null, true);
         priorityQueue.insertWithOverflow(stat.getMzxid());
       }
-      
+
       long topElementMzxId = (Long) priorityQueue.top();
-      
-      for(String child:children) {
+
+      for (String child : children) {
         Stat stat = zookeeper.exists(dir + "/" + child, null, true);
-        if(stat.getMzxid() <= topElementMzxId)
+        if (stat.getMzxid() <= topElementMzxId)
           zookeeper.delete(dir + "/" + child, -1, true);
       }
     }
-      
-    return createData(dir + "/" + prefix + trackingId, data,
-        CreateMode.PERSISTENT) != null;
+
+    super.put(trackingId, data);
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/32fbca6e/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
index c9698ae..74507d1 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
@@ -564,12 +564,12 @@ public class CollectionsHandler extends RequestHandlerBase {
 
         final NamedList<Object> results = new NamedList<>();
         if (zkController.getOverseerCompletedMap().contains(requestId)) {
-          final DistributedMap.MapEvent mapEvent = zkController.getOverseerCompletedMap().get(requestId);
-          rsp.getValues().addAll(SolrResponse.deserialize(mapEvent.getBytes()).getResponse());
+          final byte[] mapEntry = zkController.getOverseerCompletedMap().get(requestId);
+          rsp.getValues().addAll(SolrResponse.deserialize(mapEntry).getResponse());
           addStatusToResponse(results, COMPLETED, "found [" + requestId + "] in completed tasks");
         } else if (zkController.getOverseerFailureMap().contains(requestId)) {
-          final DistributedMap.MapEvent mapEvent = zkController.getOverseerFailureMap().get(requestId);
-          rsp.getValues().addAll(SolrResponse.deserialize(mapEvent.getBytes()).getResponse());
+          final byte[] mapEntry = zkController.getOverseerFailureMap().get(requestId);
+          rsp.getValues().addAll(SolrResponse.deserialize(mapEntry).getResponse());
           addStatusToResponse(results, FAILED, "found [" + requestId + "] in failed tasks");
         } else if (zkController.getOverseerRunningMap().contains(requestId)) {
           addStatusToResponse(results, RUNNING, "found [" + requestId + "] in running tasks");


[13/53] [abbrv] lucene-solr git commit: SOLR-8697: Scope ZK election nodes by session to prevent elections from interfering with each other and other small LeaderElector improvements.

Posted by no...@apache.org.
SOLR-8697: Scope ZK election nodes by session to prevent elections from interfering with each other and other small LeaderElector improvements.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9418369b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9418369b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9418369b

Branch: refs/heads/apiv2
Commit: 9418369b46586818467109e482b70ba41e90d4ed
Parents: 771f14c
Author: markrmiller <ma...@apache.org>
Authored: Fri Feb 19 17:06:38 2016 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Fri Feb 19 17:06:38 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                |   3 +
 .../org/apache/solr/cloud/ElectionContext.java  |   4 +-
 .../org/apache/solr/cloud/LeaderElector.java    | 101 ++++++-------------
 .../org/apache/solr/cloud/OverseerTest.java     |   6 ++
 4 files changed, 43 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9418369b/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e090126..42c57c1 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -193,6 +193,9 @@ Bug Fixes
   
 * SOLR-8656: PeerSync should use same nUpdates everywhere. (Ramsey Haddad via Mark Miller)
 
+* SOLR-8697: Scope ZK election nodes by session to prevent elections from interfering with each other
+  and other small LeaderElector improvements. (Scott Blum via Mark Miller)
+
 Optimizations
 ----------------------
 * SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9418369b/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java b/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java
index 10ac105..da4b0c6 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java
@@ -137,6 +137,7 @@ class ShardLeaderElectionContextBase extends ElectionContext {
   
   @Override
   public void cancelElection() throws InterruptedException, KeeperException {
+    super.cancelElection();
     if (leaderZkNodeParentVersion != null) {
       try {
         // We need to be careful and make sure we *only* delete our own leader registration node.
@@ -163,7 +164,6 @@ class ShardLeaderElectionContextBase extends ElectionContext {
     } else {
       log.info("No version found for ephemeral leader parent node, won't remove previous leader registration.");
     }
-    super.cancelElection();
   }
   
   @Override
@@ -179,7 +179,7 @@ class ShardLeaderElectionContextBase extends ElectionContext {
         
         @Override
         public void execute() throws InterruptedException, KeeperException {
-          log.info("Creating leader registration node", leaderPath);
+          log.info("Creating leader registration node {} after winning as {}", leaderPath, leaderSeqPath);
           List<Op> ops = new ArrayList<>(2);
           
           // We use a multi operation to get the parent nodes version, which will

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9418369b/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java b/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
index af27f00..e7d9a7f 100644
--- a/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
+++ b/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
@@ -21,6 +21,7 @@ import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.regex.Matcher;
@@ -105,54 +106,34 @@ public  class LeaderElector {
     // get all other numbers...
     final String holdElectionPath = context.electionPath + ELECTION_NODE;
     List<String> seqs = zkClient.getChildren(holdElectionPath, null, true);
-
     sortSeqs(seqs);
-    List<Integer> intSeqs = getSeqs(seqs);
-    if (intSeqs.size() == 0) {
-      log.warn("Our node is no longer in line to be leader");
-      return;
-    }
-    // We can't really rely on the sequence number stored in the old watcher, it may be stale, thus this check.
 
-    int seq = -1;
-
-    // See if we've already been re-added, and this is an old context. In which case, use our current sequence number.
-    String newLeaderSeq = "";
-    for (String elec : seqs) {
-      if (getNodeName(elec).equals(getNodeName(context.leaderSeqPath)) && seq < getSeq(elec)) {
-        seq = getSeq(elec); // so use the current sequence number.
-        newLeaderSeq = elec;
-        break;
-      }
-    }
-
-    // Now, if we've been re-added, presumably we've also set up watchers and all that kind of thing, so we're done
-    if (StringUtils.isNotBlank(newLeaderSeq) && seq > getSeq(context.leaderSeqPath)) {
-      log.info("Node " + context.leaderSeqPath + " already in queue as " + newLeaderSeq + " nothing to do.");
+    String leaderSeqNodeName = context.leaderSeqPath.substring(context.leaderSeqPath.lastIndexOf('/') + 1);
+    if (!seqs.contains(leaderSeqNodeName)) {
+      log.warn("Our node is no longer in line to be leader");
       return;
     }
 
-    // Fallback in case we're all coming in here fresh and there is no node for this core already in the election queue.
-    if (seq == -1) {
-      seq = getSeq(context.leaderSeqPath);
-    }
-
-    if (seq <= intSeqs.get(0)) {
-      if (seq == intSeqs.get(0) && !context.leaderSeqPath.equals(holdElectionPath + "/" + seqs.get(0))) {//somebody else already  became the leader with the same sequence id , not me
-        log.info("was going to be leader {} , seq(0) {}", context.leaderSeqPath, holdElectionPath + "/" + seqs.get(0));//but someone else jumped the line
-
-        // The problem is that deleting the ZK node that's watched by others
-        // results in an unpredictable sequencing of the events and sometime the context that comes in for checking
-        // this happens to be after the node has already taken over leadership. So just leave out of here.
-        // This caused one of the tests to fail on having two nodes with the same name in the queue. I'm not sure
-        // the assumption that this is a bad state is valid.
-        if (getNodeName(context.leaderSeqPath).equals(getNodeName(seqs.get(0)))) {
-          return;
+    // If any double-registrations exist for me, remove all but this latest one!
+    // TODO: can we even get into this state?
+    String prefix = zkClient.getSolrZooKeeper().getSessionId() + "-" + context.id;
+    Iterator<String> it = seqs.iterator();
+    while (it.hasNext()) {
+      String elec = it.next();
+      if (!elec.equals(leaderSeqNodeName) && elec.startsWith(prefix)) {
+        try {
+          String toDelete = holdElectionPath + "/" + elec;
+          log.warn("Deleting duplicate registration: {}", toDelete);
+          zkClient.delete(toDelete, -1, true);
+        } catch (KeeperException.NoNodeException e) {
+          // ignore
         }
-        retryElection(context, false);//join at the tail again
-        return;
+        it.remove();
       }
+    }
 
+    if (leaderSeqNodeName.equals(seqs.get(0))) {
+      // I am the leader
       try {
         runIamLeaderProcess(context, replacement);
       } catch (KeeperException.NodeExistsException e) {
@@ -162,30 +143,25 @@ public  class LeaderElector {
       }
     } else {
       // I am not the leader - watch the node below me
-      int toWatch = -1;
-      for (int idx = 0; idx < intSeqs.size(); idx++) {
-        if (intSeqs.get(idx) < seq && ! getNodeName(context.leaderSeqPath).equals(getNodeName(seqs.get(idx)))) {
-          toWatch = idx;
-        }
-        if (intSeqs.get(idx) >= seq) {
+      String toWatch = seqs.get(0);
+      for (String node : seqs) {
+        if (leaderSeqNodeName.equals(node)) {
           break;
         }
-      }
-      if (toWatch < 0) {
-        log.warn("Our node is no longer in line to be leader");
-        return;
+        toWatch = node;
       }
       try {
-        String watchedNode = holdElectionPath + "/" + seqs.get(toWatch);
-
-        zkClient.getData(watchedNode, watcher = new ElectionWatcher(context.leaderSeqPath , watchedNode,seq, context) , null, true);
+        String watchedNode = holdElectionPath + "/" + toWatch;
+        zkClient.getData(watchedNode, watcher = new ElectionWatcher(context.leaderSeqPath, watchedNode, getSeq(context.leaderSeqPath), context), null, true);
         log.info("Watching path {} to know if I could be the leader", watchedNode);
       } catch (KeeperException.SessionExpiredException e) {
         throw e;
+      } catch (KeeperException.NoNodeException e) {
+        // the previous node disappeared, check if we are the leader again
+        checkIfIamLeader(context, true);
       } catch (KeeperException e) {
+        // we couldn't set our watch for some other reason, retry
         log.warn("Failed setting watch", e);
-        // we couldn't set our watch - the node before us may already be down?
-        // we need to check if we are the leader again
         checkIfIamLeader(context, true);
       }
     }
@@ -239,18 +215,6 @@ public  class LeaderElector {
 
   }
   
-  /**
-   * Returns int list given list of form n_0000000001, n_0000000003, etc.
-   * 
-   * @return int seqs
-   */
-  private List<Integer> getSeqs(List<String> seqs) {
-    List<Integer> intSeqs = new ArrayList<>(seqs.size());
-    for (String seq : seqs) {
-      intSeqs.add(getSeq(seq));
-    }
-    return intSeqs;
-  }
   public int joinElection(ElectionContext context, boolean replacement) throws KeeperException, InterruptedException, IOException {
     return joinElection(context,replacement, false);
   }
@@ -410,8 +374,7 @@ public  class LeaderElector {
       
       @Override
       public int compare(String o1, String o2) {
-        int i = Integer.valueOf(getSeq(o1)).compareTo(
-            Integer.valueOf(getSeq(o2)));
+        int i = getSeq(o1) - getSeq(o2);
         return i == 0 ? o1.compareTo(o2) : i ;
       }
     });

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9418369b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
index fb640c3..8ac0512 100644
--- a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
@@ -157,6 +157,11 @@ public class OverseerTest extends SolrTestCaseJ4 {
         for (int i = 0; i < 120; i++) {
           String shardId = getShardId(collection, coreNodeName);
           if (shardId != null) {
+            ElectionContext prevContext = electionContext.get(coreName);
+            if (prevContext != null) {
+              prevContext.cancelElection();
+            }
+
             try {
               zkClient.makePath("/collections/" + collection + "/leader_elect/"
                   + shardId + "/election", true);
@@ -172,6 +177,7 @@ public class OverseerTest extends SolrTestCaseJ4 {
                 elector, shardId, collection, nodeName + "_" + coreName, props,
                 zkStateReader);
             elector.setup(ctx);
+            electionContext.put(coreName, ctx);
             elector.joinElection(ctx, false);
             return shardId;
           }


[26/53] [abbrv] lucene-solr git commit: Switch Subversion for GIT mention in the README.txt

Posted by no...@apache.org.
Switch Subversion for GIT mention in the README.txt

Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5870dce4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5870dce4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5870dce4

Branch: refs/heads/apiv2
Commit: 5870dce44377b5d569711caf10f29cb84f05e332
Parents: da28b98
Author: Alexandre Rafalovitch <ar...@gmail.com>
Authored: Mon Feb 22 11:03:03 2016 +1100
Committer: Alexandre Rafalovitch <ar...@gmail.com>
Committed: Mon Feb 22 11:03:03 2016 +1100

----------------------------------------------------------------------
 solr/README.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5870dce4/solr/README.txt
----------------------------------------------------------------------
diff --git a/solr/README.txt b/solr/README.txt
index 0a8175e..3e7a09c 100644
--- a/solr/README.txt
+++ b/solr/README.txt
@@ -142,7 +142,7 @@ Instructions for Building Apache Solr from Source
 3. Download the Apache Solr distribution, linked from the above web site. 
    Unzip the distribution to a folder of your choice, e.g. C:\solr or ~/solr
    Alternately, you can obtain a copy of the latest Apache Solr source code
-   directly from the Subversion repository:
+   directly from the GIT repository:
 
      http://lucene.apache.org/solr/versioncontrol.html
 


[11/53] [abbrv] lucene-solr git commit: SOLR-8633: DistributedUpdateProcess processCommit/deleteByQuery call finish on DUP and SolrCmdDistributor, which violates the lifecycle and can cause bugs.

Posted by no...@apache.org.
SOLR-8633: DistributedUpdateProcess processCommit/deleteByQuery call finish on DUP and SolrCmdDistributor, which violates the lifecycle and can cause bugs.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/8cd53a07
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8cd53a07
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8cd53a07

Branch: refs/heads/apiv2
Commit: 8cd53a076b579ebc3be1fbb26875321e66a41608
Parents: e30d638
Author: markrmiller <ma...@apache.org>
Authored: Fri Feb 19 14:59:46 2016 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Fri Feb 19 14:59:46 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                          |  3 +++
 .../java/org/apache/solr/update/SolrCmdDistributor.java   |  8 ++++++--
 .../solr/update/processor/DistributedUpdateProcessor.java | 10 ++++++++--
 3 files changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8cd53a07/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f64f552..035a1f6 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -188,6 +188,9 @@ Bug Fixes
 * SOLR-8695: Ensure ZK watchers are not triggering our watch logic on connection events and
   make this handling more consistent. (Scott Blum via Mark Miller)
 
+* SOLR-8633: DistributedUpdateProcess processCommit/deleteByQuery call finish on DUP and 
+  SolrCmdDistributor, which violates the lifecycle and can cause bugs. (hossman via Mark Miller)
+
 Optimizations
 ----------------------
 * SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8cd53a07/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
index 0244b0e..d9b6478 100644
--- a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
+++ b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
@@ -55,7 +55,8 @@ public class SolrCmdDistributor {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   
   private StreamingSolrClients clients;
-  
+  private boolean finished = false; // see finish()
+
   private int retryPause = 500;
   private int maxRetriesOnForward = MAX_RETRIES_ON_FORWARD;
   
@@ -86,6 +87,9 @@ public class SolrCmdDistributor {
   
   public void finish() {    
     try {
+      assert ! finished : "lifecycle sanity check";
+      finished = true;
+      
       blockAndDoRetries();
     } finally {
       clients.shutdown();
@@ -227,7 +231,7 @@ public class SolrCmdDistributor {
     
   }
 
-  private void blockAndDoRetries() {
+  public void blockAndDoRetries() {
     clients.blockUntilFinished();
     
     // wait for any async commits to complete

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8cd53a07/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
index d0e72db..8815c3f 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
@@ -221,6 +221,9 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
   
   public static final String COMMIT_END_POINT = "commit_end_point";
   public static final String LOG_REPLAY = "log_replay";
+
+  // used to assert we don't call finish more than once, see finish()
+  private boolean finished = false;
   
   private final SolrQueryRequest req;
   private final SolrQueryResponse rsp;
@@ -1373,7 +1376,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
       }
 
       if (someReplicas)  {
-        cmdDistrib.finish();
+        cmdDistrib.blockAndDoRetries();
       }
     }
 
@@ -1618,7 +1621,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
             zkController.getBaseUrl(), req.getCore().getName()));
         if (nodes != null) {
           cmdDistrib.distribCommit(cmd, nodes, params);
-          finish();
+          cmdDistrib.blockAndDoRetries();
         }
       }
     }
@@ -1645,6 +1648,9 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
   
   @Override
   public void finish() throws IOException {
+    assert ! finished : "lifecycle sanity check";
+    finished = true;
+    
     if (zkEnabled) doFinish();
     
     if (next != null && nodes == null) next.finish();


[05/53] [abbrv] lucene-solr git commit: LUCENE-7037: Switch all exceptions tests to expectThrows()

Posted by no...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java
index a20edae..44b5b75 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java
@@ -102,12 +102,10 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     // Index doc values are single-valued so we should not
     // be able to add same field more than once:
     doc.add(f);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
       fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
     DirectoryReader r = w.getReader();
     w.close();
@@ -126,12 +124,9 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     // Index doc values are single-valued so we should not
     // be able to add same field more than once:
     doc.add(new BinaryDocValuesField("field", new BytesRef("blah")));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
     DirectoryReader r = w.getReader();
     w.close();
@@ -150,12 +145,10 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     // Index doc values are single-valued so we should not
     // be able to add same field more than once:
     doc.add(new SortedDocValuesField("field", new BytesRef("hello")));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     DirectoryReader r = w.getReader();
     assertEquals(17, getOnlySegmentReader(r).getNumericDocValues("field").get(0));
     r.close();
@@ -232,12 +225,10 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     Document doc = new Document();
     doc.add(new NumericDocValuesField("foo", 0));
     doc.add(new SortedDocValuesField("foo", new BytesRef("hello")));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     IndexReader ir = w.getReader();
     assertEquals(1, ir.numDocs());
     ir.close();
@@ -253,14 +244,12 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     doc.add(new NumericDocValuesField("foo", 0));
     w.addDocument(doc);
 
-    doc = new Document();
-    doc.add(new SortedDocValuesField("foo", new BytesRef("hello")));
-    try {
-      w.addDocument(doc);
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    Document doc2 = new Document();
+    doc2.add(new SortedDocValuesField("foo", new BytesRef("hello")));
+    expectThrows(IllegalArgumentException.class, () -> {
+      w.addDocument(doc2);
+    });
+
     IndexReader ir = w.getReader();
     assertEquals(1, ir.numDocs());
     ir.close();
@@ -281,16 +270,10 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     iwriter.addDocument(doc);
     
     doc.add(new SortedDocValuesField("dv", new BytesRef("bar!")));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       iwriter.addDocument(doc);
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected
-      if (VERBOSE) {
-        System.out.println("hit exc:");
-        expected.printStackTrace(System.out);
-      }
-    }
+    });
+
     IndexReader ir = iwriter.getReader();
     assertEquals(1, ir.numDocs());
     ir.close();
@@ -311,12 +294,9 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     iwriter.addDocument(doc);
     
     doc.add(new BinaryDocValuesField("dv", new BytesRef("bar!")));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       iwriter.addDocument(doc);
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
     
     IndexReader ir = iwriter.getReader();
     assertEquals(1, ir.numDocs());
@@ -339,12 +319,10 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     iwriter.addDocument(doc);
     
     doc.add(new NumericDocValuesField("dv", 2));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       iwriter.addDocument(doc);
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
+
     IndexReader ir = iwriter.getReader();
     assertEquals(1, ir.numDocs());
     ir.close();
@@ -364,17 +342,15 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     doc.add(new SortedDocValuesField("dv", new BytesRef("just fine")));
     iwriter.addDocument(doc);
     
-    doc = new Document();
+    Document hugeDoc = new Document();
     byte bytes[] = new byte[100000];
     BytesRef b = new BytesRef(bytes);
     random().nextBytes(bytes);
-    doc.add(new SortedDocValuesField("dv", b));
-    try {
-      iwriter.addDocument(doc);
-      fail("did not get expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    hugeDoc.add(new SortedDocValuesField("dv", b));
+    expectThrows(IllegalArgumentException.class, () -> {
+      iwriter.addDocument(hugeDoc);
+    });
+
     IndexReader ir = iwriter.getReader();
     assertEquals(1, ir.numDocs());
     ir.close();
@@ -394,17 +370,15 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     doc.add(new SortedSetDocValuesField("dv", new BytesRef("just fine")));
     iwriter.addDocument(doc);
     
-    doc = new Document();
+    Document hugeDoc = new Document();
     byte bytes[] = new byte[100000];
     BytesRef b = new BytesRef(bytes);
     random().nextBytes(bytes);
-    doc.add(new SortedSetDocValuesField("dv", b));
-    try {
-      iwriter.addDocument(doc);
-      fail("did not get expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    hugeDoc.add(new SortedSetDocValuesField("dv", b));
+    expectThrows(IllegalArgumentException.class, () -> {
+      iwriter.addDocument(hugeDoc);
+    });
+
     IndexReader ir = iwriter.getReader();
     assertEquals(1, ir.numDocs());
     ir.close();
@@ -421,14 +395,12 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     w.addDocument(doc);
     w.commit();
 
-    doc = new Document();
-    doc.add(new SortedDocValuesField("foo", new BytesRef("hello")));
-    try {
-      w.addDocument(doc);
-      fail("did not get expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    Document doc2 = new Document();
+    doc2.add(new SortedDocValuesField("foo", new BytesRef("hello")));
+    expectThrows(IllegalArgumentException.class, () -> {
+      w.addDocument(doc2);
+    });
+
     w.close();
     dir.close();
   }
@@ -475,16 +447,14 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     w.addDocument(doc);
     w.close();
 
-    w = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
-    doc = new Document();
-    doc.add(new SortedDocValuesField("foo", new BytesRef("hello")));
-    try {
-      w.addDocument(doc);
-      fail("did not get expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    w.close();
+    IndexWriter w2 = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+    Document doc2 = new Document();
+    doc2.add(new SortedDocValuesField("foo", new BytesRef("hello")));
+    expectThrows(IllegalArgumentException.class, () -> {
+      w2.addDocument(doc2);
+    });
+
+    w2.close();
     dir.close();
   }
 
@@ -496,21 +466,19 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     w.addDocument(doc);
     w.close();
 
-    doc = new Document();
-    w = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
-    doc.add(new StringField("foo", "bar", Field.Store.NO));
-    doc.add(new BinaryDocValuesField("foo", new BytesRef("foo")));
-    try {
-      // NOTE: this case follows a different code path inside
-      // DefaultIndexingChain/FieldInfos, because the field (foo)
-      // is first added without DocValues:
-      w.addDocument(doc);
-      fail("did not get expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    w.forceMerge(1);
-    w.close();
+    Document doc2 = new Document();
+    IndexWriter w2 = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+    doc2.add(new StringField("foo", "bar", Field.Store.NO));
+    doc2.add(new BinaryDocValuesField("foo", new BytesRef("foo")));
+    // NOTE: this case follows a different code path inside
+    // DefaultIndexingChain/FieldInfos, because the field (foo)
+    // is first added without DocValues:
+    expectThrows(IllegalArgumentException.class, () -> {
+      w2.addDocument(doc2);
+    });
+
+    w2.forceMerge(1);
+    w2.close();
     dir.close();
   }
 
@@ -522,23 +490,21 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     w.addDocument(doc);
     w.close();
 
-    doc = new Document();
-    w = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
-    doc.add(new StringField("foo", "bar", Field.Store.NO));
-    doc.add(new BinaryDocValuesField("foo", new BytesRef("foo")));
-    try {
-      // NOTE: this case follows a different code path inside
-      // DefaultIndexingChain/FieldInfos, because the field (foo)
-      // is first added without DocValues:
-      w.addDocument(doc);
-      fail("did not get expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    Document doc2 = new Document();
+    IndexWriter w2 = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+    doc2.add(new StringField("foo", "bar", Field.Store.NO));
+    doc2.add(new BinaryDocValuesField("foo", new BytesRef("foo")));
+    // NOTE: this case follows a different code path inside
+    // DefaultIndexingChain/FieldInfos, because the field (foo)
+    // is first added without DocValues:
+    expectThrows(IllegalArgumentException.class, () -> {
+      w2.addDocument(doc2);
+    });
+
     // Also add another document so there is a segment to write here:
-    w.addDocument(new Document());
-    w.forceMerge(1);
-    w.close();
+    w2.addDocument(new Document());
+    w2.forceMerge(1);
+    w2.close();
     dir.close();
   }
 
@@ -606,20 +572,14 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     w2.addDocument(doc);
     w2.close();
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addIndexes(new Directory[] {dir2});
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
     DirectoryReader r = DirectoryReader.open(dir2);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       TestUtil.addIndexesSlowly(w, r);
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
     r.close();
     dir2.close();
@@ -634,14 +594,12 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     Document doc = new Document();
     doc.add(new NumericDocValuesField("dv", 0L));
     writer.addDocument(doc);
-    doc = new Document();
-    doc.add(new SortedDocValuesField("dv", new BytesRef("foo")));
-    try {
-      writer.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    Document doc2 = new Document();
+    doc2.add(new SortedDocValuesField("dv", new BytesRef("foo")));
+    expectThrows(IllegalArgumentException.class, () -> {
+      writer.addDocument(doc2);
+    });
+
     IndexReader ir = writer.getReader();
     assertEquals(1, ir.numDocs());
     ir.close();
@@ -659,16 +617,14 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     writer.close();
 
     conf = newIndexWriterConfig(new MockAnalyzer(random()));
-    writer = new IndexWriter(dir, conf);
-    doc = new Document();
-    doc.add(new SortedDocValuesField("dv", new BytesRef("foo")));
-    try {
-      writer.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    writer.close();
+    IndexWriter writer2 = new IndexWriter(dir, conf);
+    Document doc2 = new Document();
+    doc2.add(new SortedDocValuesField("dv", new BytesRef("foo")));
+    expectThrows(IllegalArgumentException.class, () -> {
+      writer2.addDocument(doc2);
+    });
+
+    writer2.close();
     dir.close();
   }
 
@@ -751,17 +707,14 @@ public class TestDocValuesIndexing extends LuceneTestCase {
 
     Directory dir2 = newDirectory();
     conf = newIndexWriterConfig(new MockAnalyzer(random()));
-    writer = new IndexWriter(dir2, conf);
+    IndexWriter writer2 = new IndexWriter(dir2, conf);
     doc = new Document();
     doc.add(new SortedDocValuesField("dv", new BytesRef("foo")));
-    writer.addDocument(doc);
-    try {
-      writer.addIndexes(dir);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    writer.close();
+    writer2.addDocument(doc);
+    expectThrows(IllegalArgumentException.class, () -> {
+      writer2.addIndexes(dir);
+    });
+    writer2.close();
 
     dir.close();
     dir2.close();
@@ -778,19 +731,17 @@ public class TestDocValuesIndexing extends LuceneTestCase {
 
     Directory dir2 = newDirectory();
     conf = newIndexWriterConfig(new MockAnalyzer(random()));
-    writer = new IndexWriter(dir2, conf);
+    IndexWriter writer2 = new IndexWriter(dir2, conf);
     doc = new Document();
     doc.add(new SortedDocValuesField("dv", new BytesRef("foo")));
-    writer.addDocument(doc);
+    writer2.addDocument(doc);
     DirectoryReader reader = DirectoryReader.open(dir);
-    try {
-      TestUtil.addIndexesSlowly(writer, reader);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    expectThrows(IllegalArgumentException.class, () -> {
+      TestUtil.addIndexesSlowly(writer2, reader);
+    });
+
     reader.close();
-    writer.close();
+    writer2.close();
 
     dir.close();
     dir2.close();
@@ -807,17 +758,15 @@ public class TestDocValuesIndexing extends LuceneTestCase {
 
     Directory dir2 = newDirectory();
     conf = newIndexWriterConfig(new MockAnalyzer(random()));
-    writer = new IndexWriter(dir2, conf);
-    writer.addIndexes(dir);
-    doc = new Document();
-    doc.add(new SortedDocValuesField("dv", new BytesRef("foo")));
-    try {
-      writer.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    writer.close();
+    IndexWriter writer2 = new IndexWriter(dir2, conf);
+    writer2.addIndexes(dir);
+    Document doc2 = new Document();
+    doc2.add(new SortedDocValuesField("dv", new BytesRef("foo")));
+    expectThrows(IllegalArgumentException.class, () -> {
+      writer2.addDocument(doc2);
+    });
+
+    writer2.close();
     dir2.close();
     dir.close();
   }
@@ -833,19 +782,17 @@ public class TestDocValuesIndexing extends LuceneTestCase {
 
     Directory dir2 = newDirectory();
     conf = newIndexWriterConfig(new MockAnalyzer(random()));
-    writer = new IndexWriter(dir2, conf);
+    IndexWriter writer2 = new IndexWriter(dir2, conf);
     DirectoryReader reader = DirectoryReader.open(dir);
-    TestUtil.addIndexesSlowly(writer, reader);
+    TestUtil.addIndexesSlowly(writer2, reader);
     reader.close();
-    doc = new Document();
-    doc.add(new SortedDocValuesField("dv", new BytesRef("foo")));
-    try {
-      writer.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
-    writer.close();
+    Document doc2 = new Document();
+    doc2.add(new SortedDocValuesField("dv", new BytesRef("foo")));
+    expectThrows(IllegalArgumentException.class, () -> {
+      writer2.addDocument(doc2);
+    });
+
+    writer2.close();
     dir2.close();
     dir.close();
   }
@@ -890,14 +837,12 @@ public class TestDocValuesIndexing extends LuceneTestCase {
     writer.addDocument(doc);
     writer.commit();
     
-    doc = new Document();
-    doc.add(new BinaryDocValuesField("f", new BytesRef("mock")));
-    try {
-      writer.addDocument(doc);
-      fail("should not have succeeded to add a field with different DV type than what already exists");
-    } catch (IllegalArgumentException e) {
-      writer.rollback();
-    }
+    Document doc2 = new Document();
+    doc2.add(new BinaryDocValuesField("f", new BytesRef("mock")));
+    expectThrows(IllegalArgumentException.class, () -> {
+      writer.addDocument(doc2);
+    });
+    writer.rollback();
     
     dir.close();
   }
@@ -919,12 +864,10 @@ public class TestDocValuesIndexing extends LuceneTestCase {
         }
       });
     doc.add(field);
-    try {
+    expectThrows(RuntimeException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (RuntimeException re) {
-      // expected
-    }
+    });
+
     w.addDocument(new Document());
     w.close();
     dir.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java b/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java
index fb8493a..fc3884a 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java
@@ -83,21 +83,19 @@ public class TestExceedMaxTermLength extends LuceneTestCase {
       }
       doc.add(f);
       
-      try {
+      IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(doc);
-        fail("Did not get an exception from adding a monster term");
-      } catch (IllegalArgumentException e) {
-        final String maxLengthMsg = String.valueOf(IndexWriter.MAX_TERM_LENGTH);
-        final String msg = e.getMessage();
-        assertTrue("IllegalArgumentException didn't mention 'immense term': " + msg,
-                   msg.contains("immense term"));
-        assertTrue("IllegalArgumentException didn't mention max length ("+maxLengthMsg+"): " + msg,
-                   msg.contains(maxLengthMsg));
-        assertTrue("IllegalArgumentException didn't mention field name ("+name+"): " + msg,
-                   msg.contains(name));
-        assertTrue("IllegalArgumentException didn't mention original message: " + msg,
-            msg.contains("bytes can be at most") && msg.contains("in length; got"));
-      }
+      });
+      String maxLengthMsg = String.valueOf(IndexWriter.MAX_TERM_LENGTH);
+      String msg = expected.getMessage();
+      assertTrue("IllegalArgumentException didn't mention 'immense term': " + msg,
+                 msg.contains("immense term"));
+      assertTrue("IllegalArgumentException didn't mention max length ("+maxLengthMsg+"): " + msg,
+                 msg.contains(maxLengthMsg));
+      assertTrue("IllegalArgumentException didn't mention field name ("+name+"): " + msg,
+                 msg.contains(name));
+      assertTrue("IllegalArgumentException didn't mention original message: " + msg,
+                 msg.contains("bytes can be at most") && msg.contains("in length; got"));
     } finally {
       w.close();
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java b/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java
index 1aa6eea..36c9e0d 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java
@@ -133,16 +133,12 @@ public class TestExitableDirectoryReader extends LuceneTestCase {
     directoryReader = DirectoryReader.open(directory);
     exitableDirectoryReader = new ExitableDirectoryReader(directoryReader, new QueryTimeoutImpl(1));
     reader = new TestReader(exitableDirectoryReader);
-    searcher = new IndexSearcher(reader);
-    try {
-      searcher.search(query, 10);
-      fail("This query should have led to an ExitingReaderException!");
-    } catch (ExitingReaderException ex) {
-      // Do nothing, we expect this!
-    } finally {
-      reader.close();
-      exitableDirectoryReader.close();
-    }
+    IndexSearcher slowSearcher = new IndexSearcher(reader);
+    expectThrows(ExitingReaderException.class, () -> {
+      slowSearcher.search(query, 10);
+    });
+    reader.close();
+    exitableDirectoryReader.close();
    
     // Set maximum time out and expect the query to complete. 
     // Not checking the validity of the result, all we are bothered about in this test is the timing out.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexInput.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexInput.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexInput.java
index 73ba64a..d5e5d92 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexInput.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexInput.java
@@ -143,22 +143,16 @@ public class TestIndexInput extends LuceneTestCase {
     assertEquals("\u0000",is.readString());
     assertEquals("Lu\u0000ce\u0000ne",is.readString());
     
-    try {
+    Exception expected = expectThrows(expectedEx, () -> {
       is.readVInt();
-      fail("Should throw " + expectedEx.getName());
-    } catch (Exception e) {
-      assertTrue(e.getMessage().startsWith("Invalid vInt"));
-      assertTrue(expectedEx.isInstance(e));
-    }
+    });
+    assertTrue(expected.getMessage().startsWith("Invalid vInt"));
     assertEquals(1, is.readVInt()); // guard value
     
-    try {
+    expected = expectThrows(expectedEx, () -> {
       is.readVLong();
-      fail("Should throw " + expectedEx.getName());
-    } catch (Exception e) {
-      assertTrue(e.getMessage().startsWith("Invalid vLong"));
-      assertTrue(expectedEx.isInstance(e));
-    }
+    });
+    assertTrue(expected.getMessage().startsWith("Invalid vLong"));
     assertEquals(1L, is.readVLong()); // guard value
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexReaderClose.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexReaderClose.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexReaderClose.java
index b89679c..6b22fd7 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexReaderClose.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexReaderClose.java
@@ -68,22 +68,20 @@ public class TestIndexReaderClose extends LuceneTestCase {
       if (!faultySet && !throwOnClose) {
         reader.addReaderClosedListener(new FaultyListener());
       }
-      try {
+
+      IllegalStateException expected = expectThrows(IllegalStateException.class, () -> {
         reader.close();
-        fail("expected Exception");
-      } catch (IllegalStateException ex) {
-        if (throwOnClose) {
-          assertEquals("BOOM!", ex.getMessage());
-        } else {
-          assertEquals("GRRRRRRRRRRRR!", ex.getMessage());
-        }
+      });
+
+      if (throwOnClose) {
+        assertEquals("BOOM!", expected.getMessage());
+      } else {
+        assertEquals("GRRRRRRRRRRRR!", expected.getMessage());
       }
 
-      try {
+      expectThrows(AlreadyClosedException.class, () -> {
         reader.fields();
-        fail("we are closed");
-      } catch (AlreadyClosedException ex) {
-      }
+      });
 
       if (random().nextBoolean()) {
         reader.close(); // call it again

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
index 6e466e5..7461618 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
@@ -229,20 +229,16 @@ public class TestIndexWriter extends LuceneTestCase {
 
   public void testChangesAfterClose() throws IOException {
     Directory dir = newDirectory();
+    IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
 
-    IndexWriter writer = null;
-
-    writer  = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
     addDoc(writer);
 
     // close
     writer.close();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       addDoc(writer);
-      fail("did not hit AlreadyClosedException");
-    } catch (AlreadyClosedException e) {
-      // expected
-    }
+    });
+
     dir.close();
   }
 
@@ -801,12 +797,10 @@ public class TestIndexWriter extends LuceneTestCase {
     IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
     Document doc = new Document();
     doc.add(new TextField("field", tokens));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iea) {
-      // expected
-    }
+    });
+
     w.close();
     dir.close();
   }
@@ -1564,21 +1558,18 @@ public class TestIndexWriter extends LuceneTestCase {
 
     char[] chars = new char[DocumentsWriterPerThread.MAX_TERM_LENGTH_UTF8];
     Arrays.fill(chars, 'x');
-    Document doc = new Document();
+    Document hugeDoc = new Document();
     final String bigTerm = new String(chars);
 
     // This contents produces a too-long term:
     String contents = "abc xyz x" + bigTerm + " another term";
-    doc.add(new TextField("content", contents, Field.Store.NO));
-    try {
-      w.addDocument(doc);
-      fail("should have hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    hugeDoc.add(new TextField("content", contents, Field.Store.NO));
+    expectThrows(IllegalArgumentException.class, () -> {
+      w.addDocument(hugeDoc);
+    });
 
     // Make sure we can add another normal document
-    doc = new Document();
+    Document doc = new Document();
     doc.add(new TextField("content", "abc bbb ccc", Field.Store.NO));
     w.addDocument(doc);
 
@@ -1612,22 +1603,22 @@ public class TestIndexWriter extends LuceneTestCase {
     IndexWriterConfig iwc = newIndexWriterConfig();
     iwc.setCodec(TestUtil.getDefaultCodec());
 
-    w = new RandomIndexWriter(random(), dir, iwc);
+    RandomIndexWriter w2 = new RandomIndexWriter(random(), dir, iwc);
 
     contentField.setStringValue("other");
-    w.addDocument(doc);
+    w2.addDocument(doc);
 
     contentField.setStringValue("term");
-    w.addDocument(doc);
+    w2.addDocument(doc);
 
     contentField.setStringValue(bigTerm);
-    w.addDocument(doc);
+    w2.addDocument(doc);
 
     contentField.setStringValue("zzz");
-    w.addDocument(doc);
+    w2.addDocument(doc);
 
-    reader = w.getReader();
-    w.close();
+    reader = w2.getReader();
+    w2.close();
     assertEquals(1, reader.docFreq(new Term("content", bigTerm)));
 
     reader.close();
@@ -1689,12 +1680,10 @@ public class TestIndexWriter extends LuceneTestCase {
     Directory d = newFSDirectory(createTempDir("TestIndexWriter.testWhetherDeleteAllDeletesWriteLock"), SimpleFSLockFactory.INSTANCE);
     RandomIndexWriter w1 = new RandomIndexWriter(random(), d);
     w1.deleteAll();
-    try {
+    expectThrows(LockObtainFailedException.class, () -> {
       new RandomIndexWriter(random(), d, newIndexWriterConfig(null));
-      fail("should not be able to create another writer");
-    } catch (LockObtainFailedException lofe) {
-      // expected
-    }
+    });
+
     w1.close();
     d.close();
   }
@@ -1742,12 +1731,9 @@ public class TestIndexWriter extends LuceneTestCase {
                                     new IndexWriterConfig(new MockAnalyzer(random())));
 
     w.prepareCommit();
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       w.close();
-      fail("should have hit exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
     w.commit();
     w.close();
     IndexReader r = DirectoryReader.open(dir);
@@ -1969,19 +1955,21 @@ public class TestIndexWriter extends LuceneTestCase {
     Directory dir = newDirectory();
     IndexWriterConfig iwConf = newIndexWriterConfig(null);
     RandomIndexWriter iw = new RandomIndexWriter(random(), dir, iwConf);
+
     // add 3 good docs
     for (int i = 0; i < 3; i++) {
       Document doc = new Document();
       doc.add(new StringField("id", Integer.toString(i), Field.Store.NO));
       iw.addDocument(doc);
     }
+
     // add broken doc
-    try {
+    expectThrows(NullPointerException.class, () -> {
       Document broke = new Document();
       broke.add(newTextField("test", "broken", Field.Store.NO));
       iw.addDocument(broke);
-      fail();
-    } catch (NullPointerException expected) {}
+    });
+
     // ensure good docs are still ok
     IndexReader ir = iw.getReader();
     assertEquals(3, ir.numDocs());
@@ -1993,20 +1981,23 @@ public class TestIndexWriter extends LuceneTestCase {
   public void testNullDocument() throws IOException {
     Directory dir = newDirectory();
     RandomIndexWriter iw = new RandomIndexWriter(random(), dir);
+
     // add 3 good docs
     for (int i = 0; i < 3; i++) {
       Document doc = new Document();
       doc.add(new StringField("id", Integer.toString(i), Field.Store.NO));
       iw.addDocument(doc);
     }
+
     // add broken doc
-    try {
+    expectThrows(NullPointerException.class, () -> {
       iw.addDocument(null);
-      fail();
-    } catch (NullPointerException expected) {}
+    });
+
     // ensure good docs are still ok
     IndexReader ir = iw.getReader();
     assertEquals(3, ir.numDocs());
+
     ir.close();
     iw.close();
     dir.close();
@@ -2015,20 +2006,23 @@ public class TestIndexWriter extends LuceneTestCase {
   public void testNullDocuments() throws IOException {
     Directory dir = newDirectory();
     RandomIndexWriter iw = new RandomIndexWriter(random(), dir);
+
     // add 3 good docs
     for (int i = 0; i < 3; i++) {
       Document doc = new Document();
       doc.add(new StringField("id", Integer.toString(i), Field.Store.NO));
       iw.addDocument(doc);
     }
+
     // add broken doc block
-    try {
+    expectThrows(NullPointerException.class, () -> {
       iw.addDocuments(null);
-      fail();
-    } catch (NullPointerException expected) {}
+    });
+
     // ensure good docs are still ok
     IndexReader ir = iw.getReader();
     assertEquals(3, ir.numDocs());
+
     ir.close();
     iw.close();
     dir.close();
@@ -2133,7 +2127,7 @@ public class TestIndexWriter extends LuceneTestCase {
   public void testIterableThrowsException2() throws IOException {
     Directory dir = newDirectory();
     IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
-    try {
+    Exception expected = expectThrows(Exception.class, () -> {
       w.addDocuments(new Iterable<Document>() {
         @Override
         public Iterator<Document> iterator() {
@@ -2154,10 +2148,9 @@ public class TestIndexWriter extends LuceneTestCase {
           };
         }
       });
-    } catch (Exception e) {
-      assertNotNull(e.getMessage());
-      assertEquals("boom", e.getMessage());
-    }
+    });
+    assertEquals("boom", expected.getMessage());
+
     w.close();
     IOUtils.close(dir);
   }
@@ -2358,12 +2351,10 @@ public class TestIndexWriter extends LuceneTestCase {
     Document doc = new Document();
     doc.add(new SortedDocValuesField("dv", new BytesRef("foo!")));
     doc.add(new SortedDocValuesField("dv", new BytesRef("bar!")));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       iwriter.addDocument(doc);
-      fail("didn't hit expected exception");
-    } catch (IllegalArgumentException expected) {
-      // expected
-    }
+    });
+
     iwriter.commit();
     assertFalse(iwriter.hasUncommittedChanges());
     iwriter.close();
@@ -2733,19 +2724,15 @@ public class TestIndexWriter extends LuceneTestCase {
       assertTrue(dir.checkPendingDeletions());
 
       // make sure we get NFSF if we try to delete and already-pending-delete file:
-      try {
+      expectThrows(NoSuchFileException.class, () -> {
         dir.deleteFile("segments_1");
-        fail("didn't hit exception");
-      } catch (NoSuchFileException nfse) {
-        // expected
-      }
+      });
+
+      IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
+        new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random())));
+      });
+      assertTrue(expected.getMessage().contains("still has pending deleted files; cannot initialize IndexWriter"));
 
-      iwc = new IndexWriterConfig(new MockAnalyzer(random()));
-      try {
-        w = new IndexWriter(dir, iwc);
-      } catch (IllegalArgumentException iae) {
-        assertTrue(iae.getMessage().contains("still has pending deleted files; cannot initialize IndexWriter"));
-      }
       in.close();
     }
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
index 5ae0e69..ae07641 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
@@ -486,12 +486,10 @@ public class TestIndexWriterCommit extends LuceneTestCase {
     // new index.
     Directory dir = newDirectory();
     IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
-    try {
+    expectThrows(IndexNotFoundException.class, () -> {
       DirectoryReader.listCommits(dir);
-      fail("listCommits should have thrown an exception over empty index");
-    } catch (IndexNotFoundException e) {
-      // that's expected !
-    }
+    });
+
     // No changes still should generate a commit, because it's a new index.
     writer.close();
     assertEquals("expected 1 commits!", 1, DirectoryReader.listCommits(dir).size());
@@ -673,15 +671,14 @@ public class TestIndexWriterCommit extends LuceneTestCase {
     Directory dir = newDirectory();
     IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
     w.addDocument(new Document());
+
     w.prepareCommit();
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       w.close();
-      fail("didn't hit exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
     w.commit();
     w.close();
+
     DirectoryReader r = DirectoryReader.open(dir);
     assertEquals(1, r.maxDoc());
     r.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
index 3d85f0c..2ffdce7 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java
@@ -142,12 +142,9 @@ public class TestIndexWriterConfig extends LuceneTestCase {
     new RandomIndexWriter(random(), dir, conf).close();
 
     // this should fail
-    try {
+    expectThrows(IllegalStateException.class, () -> {
       assertNotNull(new RandomIndexWriter(random(), dir, conf));
-      fail("should have hit AlreadySetException");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
+    });
 
     dir.close();
   }
@@ -213,96 +210,66 @@ public class TestIndexWriterConfig extends LuceneTestCase {
     assertEquals(KeepOnlyLastCommitDeletionPolicy.class, conf.getIndexDeletionPolicy().getClass());
     conf.setIndexDeletionPolicy(new SnapshotDeletionPolicy(null));
     assertEquals(SnapshotDeletionPolicy.class, conf.getIndexDeletionPolicy().getClass());
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       conf.setIndexDeletionPolicy(null);
-      fail();
-    } catch (IllegalArgumentException e) {
-      // ok
-    }
+    });
 
     // Test MergeScheduler
     assertEquals(ConcurrentMergeScheduler.class, conf.getMergeScheduler().getClass());
     conf.setMergeScheduler(new SerialMergeScheduler());
     assertEquals(SerialMergeScheduler.class, conf.getMergeScheduler().getClass());
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       conf.setMergeScheduler(null);
-      fail();
-    } catch (IllegalArgumentException e) {
-      // ok
-    }
+    });
 
     // Test Similarity: 
     // we shouldnt assert what the default is, just that it's not null.
     assertTrue(IndexSearcher.getDefaultSimilarity() == conf.getSimilarity());
     conf.setSimilarity(new MySimilarity());
     assertEquals(MySimilarity.class, conf.getSimilarity().getClass());
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       conf.setSimilarity(null);
-      fail();
-    } catch (IllegalArgumentException e) {
-      // ok
-    }
+    });
 
     // Test IndexingChain
     assertTrue(DocumentsWriterPerThread.defaultIndexingChain == conf.getIndexingChain());
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       conf.setMaxBufferedDeleteTerms(0);
-      fail("should not have succeeded to set maxBufferedDeleteTerms to 0");
-    } catch (IllegalArgumentException e) {
-      // this is expected
-    }
+    });
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       conf.setMaxBufferedDocs(1);
-      fail("should not have succeeded to set maxBufferedDocs to 1");
-    } catch (IllegalArgumentException e) {
-      // this is expected
-    }
+    });
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       // Disable both MAX_BUF_DOCS and RAM_SIZE_MB
       conf.setMaxBufferedDocs(4);
       conf.setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
       conf.setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH);
-      fail("should not have succeeded to disable maxBufferedDocs when ramBufferSizeMB is disabled as well");
-    } catch (IllegalArgumentException e) {
-      // this is expected
-    }
+    });
 
     conf.setRAMBufferSizeMB(IndexWriterConfig.DEFAULT_RAM_BUFFER_SIZE_MB);
     conf.setMaxBufferedDocs(IndexWriterConfig.DEFAULT_MAX_BUFFERED_DOCS);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       conf.setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
-      fail("should not have succeeded to disable ramBufferSizeMB when maxBufferedDocs is disabled as well");
-    } catch (IllegalArgumentException e) {
-      // this is expected
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       conf.setRAMPerThreadHardLimitMB(2048);
-      fail("should not have succeeded to set RAMPerThreadHardLimitMB to >= 2048");
-    } catch (IllegalArgumentException e) {
-      // this is expected
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       conf.setRAMPerThreadHardLimitMB(0);
-      fail("should not have succeeded to set RAMPerThreadHardLimitMB to 0");
-    } catch (IllegalArgumentException e) {
-      // this is expected
-    }
+    });
     
     // Test MergePolicy
     assertEquals(TieredMergePolicy.class, conf.getMergePolicy().getClass());
     conf.setMergePolicy(new LogDocMergePolicy());
     assertEquals(LogDocMergePolicy.class, conf.getMergePolicy().getClass());
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       conf.setMergePolicy(null);
-      fail();
-    } catch (IllegalArgumentException e) {
-      // ok
-    }
+    });
   }
 
   public void testLiveChangeToCFS() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
index 27295bf..14dac59 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
@@ -838,23 +838,18 @@ public class TestIndexWriterDelete extends LuceneTestCase {
     // case, creation of the cfs file happens next so we
     // need the doc (to test that it's okay that we don't
     // lose deletes if failing while creating the cfs file)
-    boolean failed = false;
-    try {
-      if (VERBOSE) {
-        System.out.println("TEST: now commit for failure");
-      }
+
+    if (VERBOSE) {
+      System.out.println("TEST: now commit for failure");
+    }
+    RuntimeException expected = expectThrows(RuntimeException.class, () -> {
       modifier.commit();
-    } catch (RuntimeException ioe) {
-      // expected
-      if (VERBOSE) {
-        System.out.println("TEST: hit exc:");
-        ioe.printStackTrace(System.out);
-      }
-      failed = true;
+    });
+    if (VERBOSE) {
+      System.out.println("TEST: hit exc:");
+      expected.printStackTrace(System.out);
     }
 
-    assertTrue(failed);
-
     // The commit above failed, so we need to retry it (which will
     // succeed, because the failure is a one-shot)
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
index 07c78dc..4992338 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
@@ -377,13 +377,12 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     Document doc = new Document();
     doc.add(newTextField("field", "a field", Field.Store.YES));
     w.addDocument(doc);
+
     testPoint.doFail = true;
-    try {
+    expectThrows(RuntimeException.class, () -> {
       w.addDocument(doc);
-      fail("did not hit exception");
-    } catch (RuntimeException re) {
-      // expected
-    }
+    });
+
     w.close();
     dir.close();
   }
@@ -418,12 +417,10 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     Document crashDoc = new Document();
     crashDoc.add(newTextField("crash", "do it on token 4", Field.Store.YES));
     doCrash.set(true);
-    try {
+    expectThrows(IOException.class, () -> {
       w.addDocument(crashDoc);
-      fail("did not hit expected exception");
-    } catch (IOException ioe) {
-      // expected
-    }
+    });
+
     w.addDocument(doc);
     w.close();
     dir.close();
@@ -508,17 +505,15 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
 
     IndexWriter writer = new IndexWriter(dir, conf);
 
-    Document doc = new Document();
+    Document brokenDoc = new Document();
     String contents = "aa bb cc dd ee ff gg hh ii jj kk";
-    doc.add(newTextField("content", contents, Field.Store.NO));
-    try {
-      writer.addDocument(doc);
-      fail("did not hit expected exception");
-    } catch (Exception e) {
-    }
+    brokenDoc.add(newTextField("content", contents, Field.Store.NO));
+    expectThrows(Exception.class, () -> {
+      writer.addDocument(brokenDoc);
+    });
 
     // Make sure we can add another normal document
-    doc = new Document();
+    Document doc = new Document();
     doc.add(newTextField("content", "aa bb cc dd", Field.Store.NO));
     writer.addDocument(doc);
 
@@ -604,17 +599,18 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     doc.add(newTextField("content", contents, Field.Store.NO));
     boolean hitError = false;
     writer.addDocument(doc);
-    try {
+
+    expectThrows(IOException.class, () -> {
       writer.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IOException ioe) {
-      // only one flush should fail:
-      assertFalse(hitError);
-      hitError = true;
-      assertTrue(writer.deleter.isClosed());
-      assertTrue(writer.isClosed());
-    }
+    });
+
+    // only one flush should fail:
+    assertFalse(hitError);
+    hitError = true;
+    assertTrue(writer.deleter.isClosed());
+    assertTrue(writer.isClosed());
     assertFalse(DirectoryReader.indexExists(dir));
+
     dir.close();
   }
 
@@ -750,17 +746,15 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
                     writer.addDocument(doc);
                     doc.add(newField("crash", "this should crash after 4 terms", DocCopyIterator.custom5));
                     doc.add(newField("other", "this will not get indexed", DocCopyIterator.custom5));
-                    try {
+                    expectThrows(IOException.class, () -> {
                       writer.addDocument(doc);
-                      fail("did not hit expected exception");
-                    } catch (IOException ioe) {
-                    }
+                    });
 
                     if (0 == finalI) {
-                      doc = new Document();
-                      doc.add(newField("contents", "here are some contents", DocCopyIterator.custom5));
-                      writer.addDocument(doc);
-                      writer.addDocument(doc);
+                      Document extraDoc = new Document();
+                      extraDoc.add(newField("contents", "here are some contents", DocCopyIterator.custom5));
+                      writer.addDocument(extraDoc);
+                      writer.addDocument(extraDoc);
                     }
                   }
                 } catch (Throwable t) {
@@ -956,14 +950,10 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
       doc.add(newTextField("field", "a field", Field.Store.YES));
       w.addDocument(doc);
       dir.failOn(failure);
-      try {
+      expectThrows(RuntimeException.class, () -> {
         w.close();
-        fail();
-      } catch (IOException ioe) {
-        fail("expected only RuntimeException");
-      } catch (RuntimeException re) {
-        // Expected
-      }
+      });
+
       assertTrue("failOnCommit=" + failure.failOnCommit + " failOnDeleteFile=" + failure.failOnDeleteFile, failure.failOnCommit && failure.failOnDeleteFile);
       w.rollback();
       String files[] = dir.listAll();
@@ -1040,11 +1030,9 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
         public void close() {}
       }));
 
-    try {
+    expectThrows(OutOfMemoryError.class, () -> {
       writer.close();
-      fail("OutOfMemoryError expected");
-    }
-    catch (final OutOfMemoryError expected) {}
+    });
 
     // throws IllegalStateEx w/o bug fix
     writer.close();
@@ -1076,23 +1064,19 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
       }));
     writer.addDocument(new Document());
 
-    try {
+    expectThrows(OutOfMemoryError.class, () -> {
       writer.commit();
-      fail("OutOfMemoryError expected");
-    }
-    catch (final OutOfMemoryError expected) {}
+    });
 
     try {
       writer.close();
-    } catch (IllegalStateException ise) {
-      // expected
+    } catch (IllegalArgumentException ok) {
+      // ok
     }
 
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       writer.addDocument(new Document());
-    } catch (AlreadyClosedException ace) {
-      // expected
-    }
+    });
 
     // IW should have done rollback() during close, since it hit OOME, and so no index should exist:
     assertFalse(DirectoryReader.indexExists(dir));
@@ -1121,12 +1105,9 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
 
     addDoc(w);
     testPoint.doFail = true;
-    try {
+    expectThrows(RuntimeException.class, () -> {
       w.rollback();
-      fail("did not hit intentional RuntimeException");
-    } catch (RuntimeException re) {
-      // expected
-    }
+    });
 
     testPoint.doFail = false;
     w.rollback();
@@ -1162,11 +1143,9 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     out.close();
     in.close();
 
-    try {
+    expectThrows(CorruptIndexException.class, () -> {
       DirectoryReader.open(dir);
-      fail("didn't get expected checksum error");
-    } catch (CorruptIndexException expected) {
-    }
+    });
 
     dir.close();
   }
@@ -1207,15 +1186,10 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
       out.close();
       dir.deleteFile(fileNameIn);
 
-      IndexReader reader = null;
-      try {
-        reader = DirectoryReader.open(dir);
-        fail("reader did not hit IOException on opening a corrupt index");
-      } catch (Exception e) {
-      }
-      if (reader != null) {
-        reader.close();
-      }
+      expectThrows(Exception.class, () -> {
+        DirectoryReader.open(dir);
+      });
+
       dir.close();
   }
 
@@ -1262,15 +1236,10 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
 
     assertTrue("failed to find cfs file to remove: ", corrupted);
 
-    IndexReader reader = null;
-    try {
-      reader = DirectoryReader.open(dir);
-      fail("reader did not hit IOException on opening a corrupt index");
-    } catch (Exception e) {
-    }
-    if (reader != null) {
-      reader.close();
-    }
+    expectThrows(Exception.class, () -> {
+      DirectoryReader.open(dir);
+    });
+
     dir.close();
   }
 
@@ -1398,14 +1367,11 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
         f.setTokenStream(new CrashingFilter("crash", tokenizer));
       }
     }
-    try {
+
+    IOException expected = expectThrows(IOException.class, () -> {
       w.addDocuments(docs);
-      // BUG: CrashingFilter didn't
-      fail("did not hit expected exception");
-    } catch (IOException ioe) {
-      // expected
-      assertEquals(CRASH_FAIL_MESSAGE, ioe.getMessage());
-    }
+    });
+    assertEquals(CRASH_FAIL_MESSAGE, expected.getMessage());
 
     final int numDocs2 = random().nextInt(25);
     for(int docCount=0;docCount<numDocs2;docCount++) {
@@ -1475,14 +1441,10 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
       }
     }
 
-    try {
+    IOException expected = expectThrows(IOException.class, () -> {
       w.updateDocuments(new Term("subid", "subs"), docs);
-      // BUG: CrashingFilter didn't
-      fail("did not hit expected exception");
-    } catch (IOException ioe) {
-      // expected
-      assertEquals(CRASH_FAIL_MESSAGE, ioe.getMessage());
-    }
+    });
+    assertEquals(CRASH_FAIL_MESSAGE, expected.getMessage());
 
     final int numDocs4 = random().nextInt(25);
     for(int docCount=0;docCount<numDocs4;docCount++) {
@@ -1512,13 +1474,13 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     // add good document
     Document doc = new Document();
     iw.addDocument(doc);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       // set to null value
       String value = null;
       doc.add(new StoredField("foo", value));
       iw.addDocument(doc);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {}
+    });
+
     assertNull(iw.getTragicException());
     iw.close();
     // make sure we see our good doc
@@ -1538,12 +1500,12 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     Field theField = new StoredField("foo", "hello", StoredField.TYPE);
     doc.add(theField);
     iw.addDocument(doc);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       // set to null value
       theField.setStringValue(null);
       iw.addDocument(doc);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {}
+    });
+
     assertNull(iw.getTragicException());
     iw.close();
     // make sure we see our good doc
@@ -1562,14 +1524,14 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     Document doc = new Document();
     iw.addDocument(doc);
 
-    try {
+    expectThrows(NullPointerException.class, () -> {
       // set to null value
       byte v[] = null;
       Field theField = new StoredField("foo", v);
       doc.add(theField);
       iw.addDocument(doc);
-      fail("didn't get expected exception");
-    } catch (NullPointerException expected) {}
+    });
+
     assertNull(iw.getTragicException());
     iw.close();
     // make sure we see our good doc
@@ -1589,13 +1551,13 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     Field theField = new StoredField("foo", new BytesRef("hello").bytes);
     doc.add(theField);
     iw.addDocument(doc);
-    try {
+    expectThrows(NullPointerException.class, () -> {
       // set to null value
       byte v[] = null;
       theField.setBytesValue(v);
       iw.addDocument(doc);
-      fail("didn't get expected exception");
-    } catch (NullPointerException expected) {}
+    });
+
     assertNull(iw.getTragicException());
     iw.close();
     // make sure we see our good doc
@@ -1614,14 +1576,15 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     Document doc = new Document();
     iw.addDocument(doc);
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       // set to null value
       BytesRef v = null;
       Field theField = new StoredField("foo", v);
       doc.add(theField);
       iw.addDocument(doc);
       fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {}
+    });
+
     assertNull(iw.getTragicException());
     iw.close();
     // make sure we see our good doc
@@ -1641,13 +1604,14 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     Field theField = new StoredField("foo", new BytesRef("hello"));
     doc.add(theField);
     iw.addDocument(doc);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       // set to null value
       BytesRef v = null;
       theField.setBytesValue(v);
       iw.addDocument(doc);
       fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {}
+    });
+
     assertNull(iw.getTragicException());
     iw.close();
     // make sure we see our good doc
@@ -1674,12 +1638,12 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     // add good document
     Document doc = new Document();
     iw.addDocument(doc);
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       doc.add(newTextField("foo", "bar", Field.Store.NO));
       doc.add(newTextField("foo", "bar", Field.Store.NO));
       iw.addDocument(doc);
-      fail("didn't get expected exception");
-    } catch (IllegalArgumentException expected) {}
+    });
+
     assertNull(iw.getTragicException());
     iw.close();
 
@@ -1716,11 +1680,9 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     iw.addDocument(new Document());
     iw.close();
     uoe.doFail = true;
-    try {
+    expectThrows(UnsupportedOperationException.class, () -> {
       new IndexWriter(d, newIndexWriterConfig(null));
-      fail("should have gotten a UOE");
-    } catch (UnsupportedOperationException expected) {
-    }
+    });
 
     uoe.doFail = false;
     d.close();
@@ -1736,8 +1698,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
     doc.add(new TextField("field2", "sometext", Field.Store.NO));
     doc.add(new StringField("foo", "bar", Field.Store.NO));
     iw.addDocument(doc); // add an 'ok' document
-    try {
-      doc = new Document();
+    expectThrows(UnsupportedOperationException.class, () -> {
       // try to boost with norms omitted
       List<IndexableField> list = new ArrayList<>();
       list.add(new IndexableField() {
@@ -1782,10 +1743,8 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
         }
       });
       iw.addDocument(list);
-      fail("didn't get any exception, boost silently discarded");
-    } catch (UnsupportedOperationException expected) {
-      // expected
-    }
+    });
+
     DirectoryReader ir = DirectoryReader.open(iw);
     assertEquals(1, ir.numDocs());
     assertEquals("sometext", ir.document(0).get("field1"));
@@ -2146,12 +2105,12 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
         return true;
       }
     }, ft));
-    try {
+
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       iw.addDocument(doc);
-      fail("didn't hit exception");
-    } catch (IllegalArgumentException expected) {
-      assertTrue(expected.getMessage().contains("too many tokens"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("too many tokens"));
+
     iw.close();
     dir.close();
   }
@@ -2201,12 +2160,10 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
       iw.prepareCommit();
     }
     
-    try {
+    RuntimeException expected = expectThrows(RuntimeException.class, () -> {
       iw.rollback();
-      fail();
-    } catch (RuntimeException expected) {
-      assertEquals("BOOM!", expected.getMessage());
-    }
+    });
+    assertEquals("BOOM!", expected.getMessage());
     
     r.close();
     
@@ -2275,6 +2232,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
       try {
         iw.rollback();
       } catch (FakeIOException expected) {
+        // ok, we randomly hit exc here
       }
       
       r.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
index e63894f..5ee9520 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
@@ -97,13 +97,11 @@ public class TestIndexWriterFromReader extends LuceneTestCase {
 
     IndexWriterConfig iwc = newIndexWriterConfig();
     iwc.setIndexCommit(r.getIndexCommit());
-    try {
+
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new IndexWriter(dir, iwc);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertEquals("cannot use IndexWriterConfig.setIndexCommit() when index has no commit", iae.getMessage());
-    }
+    });
+    assertEquals("cannot use IndexWriterConfig.setIndexCommit() when index has no commit", expected.getMessage());
       
     r.close();
     dir.close();
@@ -123,13 +121,12 @@ public class TestIndexWriterFromReader extends LuceneTestCase {
 
     IndexWriterConfig iwc = newIndexWriterConfig();
     iwc.setIndexCommit(r.getIndexCommit());
-    try {
+
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new IndexWriter(dir, iwc);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertTrue(iae.getMessage().contains("the provided reader is stale: its prior commit file"));
-    }
+    });
+    assertTrue(expected.getMessage().contains("the provided reader is stale: its prior commit file"));
+
     r.close();
     dir.close();
   }
@@ -151,13 +148,11 @@ public class TestIndexWriterFromReader extends LuceneTestCase {
 
     IndexWriterConfig iwc = newIndexWriterConfig();
     iwc.setIndexCommit(r.getIndexCommit());
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new IndexWriter(dir, iwc);
-      fail("did not hit expected exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertTrue(iae.getMessage().contains("the provided reader is stale: its prior commit file"));      
-    }
+    });
+    assertTrue(expected.getMessage().contains("the provided reader is stale: its prior commit file"));      
+
     r.close();
     dir.close();
   }
@@ -351,13 +346,11 @@ public class TestIndexWriterFromReader extends LuceneTestCase {
     IndexWriterConfig iwc = newIndexWriterConfig();
     iwc.setOpenMode(IndexWriterConfig.OpenMode.CREATE);
     iwc.setIndexCommit(r.getIndexCommit());
-    try {
+    IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
       new IndexWriter(dir, iwc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-      assertEquals("cannot use IndexWriterConfig.setIndexCommit() with OpenMode.CREATE", iae.getMessage());
-    }
+    });
+    assertEquals("cannot use IndexWriterConfig.setIndexCommit() with OpenMode.CREATE", expected.getMessage());
+
     IOUtils.close(r, dir);
   }
 
@@ -375,12 +368,10 @@ public class TestIndexWriterFromReader extends LuceneTestCase {
 
     IndexWriterConfig iwc = newIndexWriterConfig();
     iwc.setIndexCommit(commit);
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       new IndexWriter(dir, iwc);
-      fail("did not hit exception");
-    } catch (AlreadyClosedException ace) {
-      // expected
-    }
+    });
+
     IOUtils.close(r, dir);
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMaxDocs.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMaxDocs.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMaxDocs.java
index 665faae..4fd7550 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMaxDocs.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMaxDocs.java
@@ -94,12 +94,10 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       }
 
       // 11th document should fail:
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.close();
       dir.close();
     } finally {
@@ -117,12 +115,10 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       }
 
       // 11th document should fail:
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocuments(Collections.singletonList(new Document()));
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.close();
       dir.close();
     } finally {
@@ -140,12 +136,10 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       }
 
       // 11th document should fail:
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.updateDocument(new Term("field", "foo"), new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.close();
       dir.close();
     } finally {
@@ -163,12 +157,10 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       }
 
       // 11th document should fail:
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.updateDocuments(new Term("field", "foo"), Collections.singletonList(new Document()));
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.close();
       dir.close();
     } finally {
@@ -202,12 +194,10 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       }
 
       // 11th document should fail:
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.close();
       dir.close();
     } finally {
@@ -248,12 +238,10 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       }
 
       // 11th document should fail:
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.close();
       dir.close();
     } finally {
@@ -274,20 +262,16 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       Directory dir2 = newDirectory();
       IndexWriter w2 = new IndexWriter(dir2, new IndexWriterConfig(null));
       w2.addDocument(new Document());
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w2.addIndexes(new Directory[] {dir});
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       assertEquals(1, w2.maxDoc());
       DirectoryReader ir = DirectoryReader.open(dir);
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         TestUtil.addIndexesSlowly(w2, ir);
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w2.close();
       ir.close();
       dir.close();
@@ -362,12 +346,10 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
     Arrays.fill(subReaders, ir);
     subReaders[subReaders.length-1] = ir2;
 
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new MultiReader(subReaders);
-      fail("didn't hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
+
     ir.close();
     ir2.close();
     dir.close();
@@ -472,12 +454,9 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
   }
 
   public void testTooLargeMaxDocs() throws Exception {
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       IndexWriter.setMaxDocs(Integer.MAX_VALUE);
-      fail("didn't hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
   }
 
   // LUCENE-6299
@@ -487,20 +466,16 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       Directory dir = newDirectory();
       IndexWriter w = new IndexWriter(dir, new IndexWriterConfig(null));
       w.addDocument(new Document());
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.deleteAll();
       w.addDocument(new Document());
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.close();
       dir.close();
     } finally {
@@ -517,21 +492,17 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       w.addDocument(new Document());
       w.getReader().close();
       w.addDocument(new Document());
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.deleteAll();
       w.addDocument(new Document());
       w.addDocument(new Document());
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.close();
       dir.close();
     } finally {
@@ -548,21 +519,17 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       w.addDocument(new Document());
       w.commit();
       w.addDocument(new Document());
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.deleteAll();
       w.addDocument(new Document());
       w.addDocument(new Document());
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.close();
       dir.close();
     } finally {
@@ -601,22 +568,18 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
         thread.join();
       }
 
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.deleteAll();
       for(int i=0;i<limit;i++) {
         w.addDocument(new Document());
       }        
-      try {
+      expectThrows(IllegalArgumentException.class, () -> {
         w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
+      });
+
       w.close();
       dir.close();
     } finally {
@@ -632,24 +595,21 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       IndexWriter w = new IndexWriter(dir, new IndexWriterConfig(null));
       w.addDocument(new Document());
       w.close();
-      w = new IndexWriter(dir, new IndexWriterConfig(null));
-      w.addDocument(new Document());
-      try {
-        w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
-      w.deleteAll();
-      w.addDocument(new Document());
-      w.addDocument(new Document());
-      try {
-        w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
-      w.close();
+
+      IndexWriter w2 = new IndexWriter(dir, new IndexWriterConfig(null));
+      w2.addDocument(new Document());
+      expectThrows(IllegalArgumentException.class, () -> {
+        w2.addDocument(new Document());
+      });
+
+      w2.deleteAll();
+      w2.addDocument(new Document());
+      w2.addDocument(new Document());
+      expectThrows(IllegalArgumentException.class, () -> {
+        w2.addDocument(new Document());
+      });
+
+      w2.close();
       dir.close();
     } finally {
       restoreIndexWriterMaxDocs();
@@ -664,14 +624,12 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
       IndexWriter w = new IndexWriter(dir, new IndexWriterConfig(null));
       w.addDocument(new Document());
       w.close();
-      w = new IndexWriter(dir, new IndexWriterConfig(null));
-      try {
-        w.addDocument(new Document());
-        fail("didn't hit exception");
-      } catch (IllegalArgumentException iae) {
-        // expected
-      }
-      w.close();
+      IndexWriter w2 = new IndexWriter(dir, new IndexWriterConfig(null));
+      expectThrows(IllegalArgumentException.class, () -> {
+        w2.addDocument(new Document());
+      });
+
+      w2.close();
       dir.close();
     } finally {
       restoreIndexWriterMaxDocs();
@@ -687,11 +645,10 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
     w.close();
 
     setIndexWriterMaxDocs(1);
-    try {       
-      DirectoryReader.open(dir);
-      fail("didn't hit exception");
-    } catch (CorruptIndexException cie) {
-      // expected
+    try {
+      expectThrows(CorruptIndexException.class, () -> {
+        DirectoryReader.open(dir);
+      });
     } finally {
       restoreIndexWriterMaxDocs();
     }
@@ -708,11 +665,10 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase {
     w.close();
 
     setIndexWriterMaxDocs(1);
-    try {       
-      new IndexWriter(dir, new IndexWriterConfig(null));
-      fail("didn't hit exception");
-    } catch (CorruptIndexException cie) {
-      // expected
+    try {
+      expectThrows(CorruptIndexException.class, () -> {
+        new IndexWriter(dir, new IndexWriterConfig(null));
+      });
     } finally {
       restoreIndexWriterMaxDocs();
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
index d03de7e..2d5680c 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
@@ -287,12 +287,9 @@ public class TestIndexWriterMergePolicy extends LuceneTestCase {
     lmp.setMaxCFSSegmentSizeMB(Long.MAX_VALUE/1024/1024.);
     assertEquals(Long.MAX_VALUE/1024/1024., lmp.getMaxCFSSegmentSizeMB(), EPSILON*Long.MAX_VALUE);
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       lmp.setMaxCFSSegmentSizeMB(-2.0);
-      fail("Didn't throw IllegalArgumentException");
-    } catch (IllegalArgumentException iae) {
-      // pass
-    }
+    });
     
     // TODO: Add more checks for other non-double setters!
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
index eecb3bd..b7d0b29 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
@@ -523,21 +523,16 @@ public class TestIndexWriterOnDiskFull extends LuceneTestCase {
     ftdm.setDoFail();
     dir.failOn(ftdm);
 
-    try {
+    expectThrows(IOException.class, () -> {
       w.commit();
-      fail("fake disk full IOExceptions not hit");
-    } catch (IOException ioe) {
-      // expected
-      assertTrue(ftdm.didFail1 || ftdm.didFail2);
-    }
+    });
+    assertTrue(ftdm.didFail1 || ftdm.didFail2);
+
     TestUtil.checkIndex(dir);
     ftdm.clearDoFail();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       w.addDocument(doc);
-      fail("writer was not closed by merge exception");
-    } catch (AlreadyClosedException ace) {
-      // expected
-    }
+    });
 
     dir.close();
   }
@@ -556,13 +551,12 @@ public class TestIndexWriterOnDiskFull extends LuceneTestCase {
     final Document doc = new Document();
     FieldType customType = new FieldType(TextField.TYPE_STORED);
     doc.add(newField("field", "aaa bbb ccc ddd eee fff ggg hhh iii jjj", customType));
-    try {
+    expectThrows(IOException.class, () -> {
       writer.addDocument(doc);
-      fail("did not hit disk full");
-    } catch (IOException ioe) {
-      assertTrue(writer.deleter.isClosed());
-      assertTrue(writer.isClosed());
-    }
+    });
+    assertTrue(writer.deleter.isClosed());
+    assertTrue(writer.isClosed());
+
     dir.close();
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java
index 173128e..584e03c 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java
@@ -709,12 +709,11 @@ public class TestIndexWriterReader extends LuceneTestCase {
     Query q = new TermQuery(new Term("indexname", "test"));
     IndexSearcher searcher = newSearcher(r);
     assertEquals(100, searcher.search(q, 10).totalHits);
-    try {
+
+    expectThrows(AlreadyClosedException.class, () -> {
       DirectoryReader.openIfChanged(r);
-      fail("failed to hit AlreadyClosedException");
-    } catch (AlreadyClosedException ace) {
-      // expected
-    }
+    });
+
     r.close();
     dir1.close();
   }
@@ -1112,14 +1111,9 @@ public class TestIndexWriterReader extends LuceneTestCase {
     // other NRT reader, since it is already marked closed!
     for (int i = 0; i < 2; i++) {
       shouldFail.set(true);
-      try {
+      expectThrows(FakeIOException.class, () -> {
         writer.getReader().close();
-      } catch (FakeIOException e) {
-        // expected
-        if (VERBOSE) {
-          System.out.println("hit expected fake IOE");
-        }
-      }
+      });
     }
     
     writer.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java
index 72029cb..34c5a52 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java
@@ -365,22 +365,20 @@ public class TestIndexWriterWithThreads extends LuceneTestCase {
 
     dir.failOn(failure);
     failure.setDoFail();
-    try {
+    expectThrows(IOException.class, () -> {
       writer.addDocument(doc);
       writer.addDocument(doc);
       writer.commit();
-      fail("did not hit exception");
-    } catch (IOException ioe) {
-    }
+    });
+
     failure.clearDoFail();
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       writer.addDocument(doc);
       writer.commit();
       writer.close();
-    } catch (AlreadyClosedException ace) {
-      // OK: abort closes the writer
-      assertTrue(writer.deleter.isClosed());
-    }
+    });
+
+    assertTrue(writer.deleter.isClosed());
     dir.close();
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestMaxPosition.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMaxPosition.java b/lucene/core/src/test/org/apache/lucene/index/TestMaxPosition.java
index f8c7ceb..c65082c 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestMaxPosition.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestMaxPosition.java
@@ -45,12 +45,9 @@ public class TestMaxPosition extends LuceneTestCase {
       t2.setPayload(new BytesRef(new byte[] { 0x1 } ));
     }
     doc.add(new TextField("foo", new CannedTokenStream(new Token[] {t1, t2})));
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       iw.addDocument(doc);
-      fail("did not hit exception");
-    } catch (IllegalArgumentException iae) {
-      // expected
-    }
+    });
 
     // Document should not be visible:
     IndexReader r = DirectoryReader.open(iw);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java
index 3366646..727f6ff 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java
@@ -421,19 +421,13 @@ public class TestNumericDocValuesUpdates extends LuceneTestCase {
     writer.commit();
     writer.addDocument(doc); // in-memory document
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       writer.updateNumericDocValue(new Term("key", "doc"), "ndv", 17L);
-      fail("should not have allowed creating new fields through update");
-    } catch (IllegalArgumentException e) {
-      // ok
-    }
+    });
     
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       writer.updateNumericDocValue(new Term("key", "doc"), "foo", 17L);
-      fail("should not have allowed updating an existing field to numeric-dv");
-    } catch (IllegalArgumentException e) {
-      // ok
-    }
+    });
     
     writer.close();
     dir.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java b/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
index 741c143..807c704 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
@@ -306,17 +306,15 @@ public class TestOmitTf extends LuceneTestCase {
     TermQuery q4 = new TermQuery(d);
 
     PhraseQuery pq = new PhraseQuery(a.field(), a.bytes(), c.bytes());
-    try {
+    Exception expected = expectThrows(Exception.class, () -> {
       searcher.search(pq, 10);
-      fail("did not hit expected exception");
-    } catch (Exception e) {
-      Throwable cause = e;
-      // If the searcher uses an executor service, the IAE is wrapped into other exceptions
-      while (cause.getCause() != null) {
-        cause = cause.getCause();
-      }
-      assertTrue("Expected an IAE, got " + cause, cause instanceof IllegalStateException);
+    });
+    Throwable cause = expected;
+    // If the searcher uses an executor service, the IAE is wrapped into other exceptions
+    while (cause.getCause() != null) {
+      cause = cause.getCause();
     }
+    assertTrue("Expected an IAE, got " + cause, cause instanceof IllegalStateException);
         
     searcher.search(q1,
                     new CountingHitCollector() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/189e985b/lucene/core/src/test/org/apache/lucene/index/TestParallelCompositeReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestParallelCompositeReader.java b/lucene/core/src/test/org/apache/lucene/index/TestParallelCompositeReader.java
index e7d735c..7078380 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestParallelCompositeReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestParallelCompositeReader.java
@@ -203,19 +203,13 @@ public class TestParallelCompositeReader extends LuceneTestCase {
     ir1.close();
 
     assertEquals("refCount of synthetic subreader should be unchanged", 1, psub.getRefCount());
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       psub.document(0);
-      fail("Subreader should be already closed because inner reader was closed!");
-    } catch (AlreadyClosedException e) {
-      // pass
-    }
+    });
     
-    try {
+    expectThrows(AlreadyClosedException.class, () -> {
       pr.document(0);
-      fail("ParallelCompositeReader should be already closed because inner reader was closed!");
-    } catch (AlreadyClosedException e) {
-      // pass
-    }
+    });
     
     // noop:
     pr.close();
@@ -238,18 +232,15 @@ public class TestParallelCompositeReader extends LuceneTestCase {
     
     DirectoryReader ir1 = DirectoryReader.open(dir1),
         ir2 = DirectoryReader.open(dir2);
-    try {
+
+    expectThrows(IllegalArgumentException.class, () -> {
       new ParallelCompositeReader(ir1, ir2);
-      fail("didn't get expected exception: indexes don't have same number of documents");
-    } catch (IllegalArgumentException e) {
-      // expected exception
-    }
-    try {
+    });
+
+    expectThrows(IllegalArgumentException.class, () -> {
       new ParallelCompositeReader(random().nextBoolean(), ir1, ir2);
-      fail("didn't get expected exception: indexes don't have same number of documents");
-    } catch (IllegalArgumentException e) {
-      // expected exception
-    }
+    });
+
     assertEquals(1, ir1.getRefCount());
     assertEquals(1, ir2.getRefCount());
     ir1.close();
@@ -267,18 +258,14 @@ public class TestParallelCompositeReader extends LuceneTestCase {
     DirectoryReader ir1 = DirectoryReader.open(dir1),
         ir2 = DirectoryReader.open(dir2);
     CompositeReader[] readers = new CompositeReader[] {ir1, ir2};
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new ParallelCompositeReader(readers);
-      fail("didn't get expected exception: indexes don't have same subreader structure");
-    } catch (IllegalArgumentException e) {
-      // expected exception
-    }
-    try {
+    });
+
+    expectThrows(IllegalArgumentException.class, () -> {
       new ParallelCompositeReader(random().nextBoolean(), readers, readers);
-      fail("didn't get expected exception: indexes don't have same subreader structure");
-    } catch (IllegalArgumentException e) {
-      // expected exception
-    }
+    });
+
     assertEquals(1, ir1.getRefCount());
     assertEquals(1, ir2.getRefCount());
     ir1.close();
@@ -296,18 +283,15 @@ public class TestParallelCompositeReader extends LuceneTestCase {
     CompositeReader ir1 = new MultiReader(DirectoryReader.open(dir1), SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dir1))),
         ir2 = new MultiReader(DirectoryReader.open(dir2), DirectoryReader.open(dir2));
     CompositeReader[] readers = new CompositeReader[] {ir1, ir2};
-    try {
+
+    expectThrows(IllegalArgumentException.class, () -> {
       new ParallelCompositeReader(readers);
-      fail("didn't get expected exception: indexes don't have same subreader structure");
-    } catch (IllegalArgumentException e) {
-      // expected exception
-    }
-    try {
+    });
+
+    expectThrows(IllegalArgumentException.class, () -> {
       new ParallelCompositeReader(random().nextBoolean(), readers, readers);
-      fail("didn't get expected exception: indexes don't have same subreader structure");
-    } catch (IllegalArgumentException e) {
-      // expected exception
-    }
+    });
+
     assertEquals(1, ir1.getRefCount());
     assertEquals(1, ir2.getRefCount());
     ir1.close();
@@ -373,14 +357,11 @@ public class TestParallelCompositeReader extends LuceneTestCase {
     pr.close();
     
     // no main readers
-    try {
+    expectThrows(IllegalArgumentException.class, () -> {
       new ParallelCompositeReader(true,
         new CompositeReader[0],
         new CompositeReader[] {ir1});
-      fail("didn't get expected exception: need a non-empty main-reader array");
-    } catch (IllegalArgumentException iae) {
-      // pass
-    }
+    });
     
     dir1.close();
     dir2.close();


[17/53] [abbrv] lucene-solr git commit: SOLR-8588: Update CHANGES.txt

Posted by no...@apache.org.
SOLR-8588: Update CHANGES.txt


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f9127a91
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f9127a91
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f9127a91

Branch: refs/heads/apiv2
Commit: f9127a919ac212c4a5c36e66fb0d0c15a7867c0e
Parents: b2475bf
Author: jbernste <jb...@apache.org>
Authored: Fri Feb 19 20:07:29 2016 -0500
Committer: jbernste <jb...@apache.org>
Committed: Fri Feb 19 20:07:29 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f9127a91/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index a57f8e5..25c3a50 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -147,6 +147,8 @@ New Features
 
 * SOLR-8502: Improve Solr JDBC Driver to support SQL Clients like DBVisualizer (Kevin Risden, Joel Bernstein)
 
+* SOLR-8588: Add TopicStream to the streaming API to support publish/subscribe messaging (Joel Bernstein, Kevin Risden)
+
 Bug Fixes
 ----------------------
 * SOLR-8386: Add field option in the new admin UI schema page loads up even when no schemaFactory has been


[52/53] [abbrv] lucene-solr git commit: SOLR-8029: Merging changes from master

Posted by no...@apache.org.
SOLR-8029: Merging changes from master


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ddeb53dd
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ddeb53dd
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ddeb53dd

Branch: refs/heads/apiv2
Commit: ddeb53dd91cb9370f0f22a4ccdcf33f1e267bf79
Parents: 5893631 9ce2d0d
Author: Noble Paul <no...@apache.org>
Authored: Wed Feb 24 11:38:50 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Wed Feb 24 11:38:50 2016 +0530

----------------------------------------------------------------------
 .../dot.settings/org.eclipse.jdt.ui.prefs       |    3 +-
 dev-tools/git/HELP.txt                          |   14 +
 .../idea/.idea/copyright/profiles_settings.xml  |    2 +-
 dev-tools/idea/lucene/sandbox/sandbox.iml       |    1 +
 dev-tools/idea/solr/core/src/java/solr-core.iml |    3 +
 dev-tools/maven/lucene/sandbox/pom.xml.template |    7 +
 dev-tools/maven/lucene/spatial/pom.xml.template |   13 +
 .../maven/solr/core/src/java/pom.xml.template   |    5 +
 dev-tools/scripts/addVersion.py                 |   10 +-
 dev-tools/scripts/buildAndPushRelease.py        |   42 +-
 dev-tools/scripts/scriptutil.py                 |   21 +-
 dev-tools/scripts/smokeTestRelease.py           |   96 +-
 lucene/CHANGES.txt                              |   69 +
 lucene/JRE_VERSION_MIGRATION.txt                |    2 +-
 .../lucene/analysis/ar/ArabicAnalyzer.java      |    4 +-
 .../analysis/ar/ArabicNormalizationFilter.java  |    4 +-
 .../ar/ArabicNormalizationFilterFactory.java    |    4 +-
 .../lucene/analysis/ar/ArabicNormalizer.java    |    4 +-
 .../lucene/analysis/ar/ArabicStemFilter.java    |    4 +-
 .../analysis/ar/ArabicStemFilterFactory.java    |    4 +-
 .../lucene/analysis/ar/ArabicStemmer.java       |    6 +-
 .../lucene/analysis/bg/BulgarianAnalyzer.java   |    4 +-
 .../lucene/analysis/bg/BulgarianStemFilter.java |    4 +-
 .../analysis/bg/BulgarianStemFilterFactory.java |    4 +-
 .../lucene/analysis/bg/BulgarianStemmer.java    |    4 +-
 .../lucene/analysis/br/BrazilianAnalyzer.java   |    4 +-
 .../lucene/analysis/br/BrazilianStemFilter.java |    4 +-
 .../analysis/br/BrazilianStemFilterFactory.java |    4 +-
 .../lucene/analysis/br/BrazilianStemmer.java    |    8 +-
 .../lucene/analysis/ca/CatalanAnalyzer.java     |    4 +-
 .../analysis/charfilter/BaseCharFilter.java     |    1 -
 .../charfilter/HTMLStripCharFilter.java         |    3 +-
 .../charfilter/HTMLStripCharFilter.jflex        |    3 +-
 .../charfilter/HTMLStripCharFilterFactory.java  |    4 +-
 .../analysis/charfilter/MappingCharFilter.java  |    1 -
 .../charfilter/MappingCharFilterFactory.java    |    4 +-
 .../analysis/charfilter/NormalizeCharMap.java   |    1 -
 .../apache/lucene/analysis/cjk/CJKAnalyzer.java |    4 +-
 .../lucene/analysis/cjk/CJKBigramFilter.java    |    4 +-
 .../analysis/cjk/CJKBigramFilterFactory.java    |    4 +-
 .../lucene/analysis/cjk/CJKWidthFilter.java     |    4 +-
 .../analysis/cjk/CJKWidthFilterFactory.java     |    4 +-
 .../lucene/analysis/ckb/SoraniAnalyzer.java     |    4 +-
 .../analysis/ckb/SoraniNormalizationFilter.java |    4 +-
 .../ckb/SoraniNormalizationFilterFactory.java   |    4 +-
 .../lucene/analysis/ckb/SoraniNormalizer.java   |    4 +-
 .../lucene/analysis/ckb/SoraniStemFilter.java   |    4 +-
 .../analysis/ckb/SoraniStemFilterFactory.java   |    4 +-
 .../lucene/analysis/ckb/SoraniStemmer.java      |    4 +-
 .../analysis/commongrams/CommonGramsFilter.java |    1 -
 .../commongrams/CommonGramsFilterFactory.java   |    4 +-
 .../CommonGramsQueryFilterFactory.java          |    4 +-
 .../compound/CompoundWordTokenFilterBase.java   |    4 +-
 .../DictionaryCompoundWordTokenFilter.java      |    4 +-
 ...ictionaryCompoundWordTokenFilterFactory.java |    4 +-
 .../HyphenationCompoundWordTokenFilter.java     |    4 +-
 ...phenationCompoundWordTokenFilterFactory.java |    4 +-
 .../compound/hyphenation/ByteVector.java        |    7 +-
 .../compound/hyphenation/CharVector.java        |    7 +-
 .../analysis/compound/hyphenation/Hyphen.java   |    7 +-
 .../compound/hyphenation/Hyphenation.java       |    7 +-
 .../compound/hyphenation/HyphenationTree.java   |    7 +-
 .../compound/hyphenation/PatternConsumer.java   |    7 +-
 .../compound/hyphenation/PatternParser.java     |    7 +-
 .../compound/hyphenation/TernaryTree.java       |    7 +-
 .../analysis/core/DecimalDigitFilter.java       |    4 +-
 .../core/DecimalDigitFilterFactory.java         |    4 +-
 .../lucene/analysis/core/KeywordAnalyzer.java   |    4 +-
 .../lucene/analysis/core/KeywordTokenizer.java  |    4 +-
 .../analysis/core/KeywordTokenizerFactory.java  |    4 +-
 .../lucene/analysis/core/LetterTokenizer.java   |    4 +-
 .../analysis/core/LetterTokenizerFactory.java   |    4 +-
 .../lucene/analysis/core/LowerCaseFilter.java   |    4 +-
 .../analysis/core/LowerCaseFilterFactory.java   |    4 +-
 .../analysis/core/LowerCaseTokenizer.java       |    4 +-
 .../core/LowerCaseTokenizerFactory.java         |    4 +-
 .../lucene/analysis/core/SimpleAnalyzer.java    |    4 +-
 .../lucene/analysis/core/StopAnalyzer.java      |    4 +-
 .../apache/lucene/analysis/core/StopFilter.java |    4 +-
 .../lucene/analysis/core/StopFilterFactory.java |    4 +-
 .../lucene/analysis/core/TypeTokenFilter.java   |    4 +-
 .../analysis/core/TypeTokenFilterFactory.java   |    4 +-
 .../core/UnicodeWhitespaceAnalyzer.java         |    4 +-
 .../core/UnicodeWhitespaceTokenizer.java        |    4 +-
 .../lucene/analysis/core/UpperCaseFilter.java   |    4 +-
 .../analysis/core/UpperCaseFilterFactory.java   |    4 +-
 .../analysis/core/WhitespaceAnalyzer.java       |    4 +-
 .../analysis/core/WhitespaceTokenizer.java      |    4 +-
 .../core/WhitespaceTokenizerFactory.java        |    4 +-
 .../lucene/analysis/custom/CustomAnalyzer.java  |    4 +-
 .../lucene/analysis/cz/CzechAnalyzer.java       |    4 +-
 .../lucene/analysis/cz/CzechStemFilter.java     |   20 +-
 .../analysis/cz/CzechStemFilterFactory.java     |    4 +-
 .../apache/lucene/analysis/cz/CzechStemmer.java |    4 +-
 .../lucene/analysis/da/DanishAnalyzer.java      |    4 +-
 .../lucene/analysis/de/GermanAnalyzer.java      |    6 +-
 .../analysis/de/GermanLightStemFilter.java      |    4 +-
 .../de/GermanLightStemFilterFactory.java        |    4 +-
 .../lucene/analysis/de/GermanLightStemmer.java  |    4 +-
 .../analysis/de/GermanMinimalStemFilter.java    |    4 +-
 .../de/GermanMinimalStemFilterFactory.java      |    4 +-
 .../analysis/de/GermanMinimalStemmer.java       |    4 +-
 .../analysis/de/GermanNormalizationFilter.java  |    4 +-
 .../de/GermanNormalizationFilterFactory.java    |    4 +-
 .../lucene/analysis/de/GermanStemFilter.java    |    4 +-
 .../analysis/de/GermanStemFilterFactory.java    |    4 +-
 .../lucene/analysis/de/GermanStemmer.java       |   12 +-
 .../lucene/analysis/el/GreekAnalyzer.java       |   14 +-
 .../analysis/el/GreekLowerCaseFilter.java       |   14 +-
 .../el/GreekLowerCaseFilterFactory.java         |    4 +-
 .../lucene/analysis/el/GreekStemFilter.java     |    4 +-
 .../analysis/el/GreekStemFilterFactory.java     |    4 +-
 .../apache/lucene/analysis/el/GreekStemmer.java |   12 +-
 .../lucene/analysis/en/EnglishAnalyzer.java     |    4 +-
 .../analysis/en/EnglishMinimalStemFilter.java   |    4 +-
 .../en/EnglishMinimalStemFilterFactory.java     |    4 +-
 .../analysis/en/EnglishMinimalStemmer.java      |    4 +-
 .../analysis/en/EnglishPossessiveFilter.java    |    4 +-
 .../en/EnglishPossessiveFilterFactory.java      |    4 +-
 .../apache/lucene/analysis/en/KStemFilter.java  |    4 +-
 .../lucene/analysis/en/KStemFilterFactory.java  |    4 +-
 .../org/apache/lucene/analysis/en/KStemmer.java |    1 -
 .../lucene/analysis/en/PorterStemFilter.java    |    4 +-
 .../analysis/en/PorterStemFilterFactory.java    |    4 +-
 .../lucene/analysis/en/PorterStemmer.java       |    7 +-
 .../lucene/analysis/es/SpanishAnalyzer.java     |    4 +-
 .../analysis/es/SpanishLightStemFilter.java     |    4 +-
 .../es/SpanishLightStemFilterFactory.java       |    4 +-
 .../lucene/analysis/es/SpanishLightStemmer.java |    4 +-
 .../lucene/analysis/eu/BasqueAnalyzer.java      |    4 +-
 .../lucene/analysis/fa/PersianAnalyzer.java     |    4 +-
 .../lucene/analysis/fa/PersianCharFilter.java   |    4 +-
 .../analysis/fa/PersianCharFilterFactory.java   |    4 +-
 .../analysis/fa/PersianNormalizationFilter.java |    4 +-
 .../fa/PersianNormalizationFilterFactory.java   |    4 +-
 .../lucene/analysis/fa/PersianNormalizer.java   |    4 +-
 .../lucene/analysis/fi/FinnishAnalyzer.java     |    4 +-
 .../analysis/fi/FinnishLightStemFilter.java     |    4 +-
 .../fi/FinnishLightStemFilterFactory.java       |    4 +-
 .../lucene/analysis/fi/FinnishLightStemmer.java |    4 +-
 .../lucene/analysis/fr/FrenchAnalyzer.java      |    4 +-
 .../analysis/fr/FrenchLightStemFilter.java      |    4 +-
 .../fr/FrenchLightStemFilterFactory.java        |    4 +-
 .../lucene/analysis/fr/FrenchLightStemmer.java  |    4 +-
 .../analysis/fr/FrenchMinimalStemFilter.java    |    4 +-
 .../fr/FrenchMinimalStemFilterFactory.java      |    4 +-
 .../analysis/fr/FrenchMinimalStemmer.java       |    4 +-
 .../lucene/analysis/ga/IrishAnalyzer.java       |    4 +-
 .../analysis/ga/IrishLowerCaseFilter.java       |    4 +-
 .../ga/IrishLowerCaseFilterFactory.java         |    4 +-
 .../lucene/analysis/gl/GalicianAnalyzer.java    |    4 +-
 .../analysis/gl/GalicianMinimalStemFilter.java  |    4 +-
 .../gl/GalicianMinimalStemFilterFactory.java    |    4 +-
 .../analysis/gl/GalicianMinimalStemmer.java     |    4 +-
 .../lucene/analysis/gl/GalicianStemFilter.java  |    4 +-
 .../analysis/gl/GalicianStemFilterFactory.java  |    4 +-
 .../lucene/analysis/gl/GalicianStemmer.java     |    4 +-
 .../lucene/analysis/hi/HindiAnalyzer.java       |    4 +-
 .../analysis/hi/HindiNormalizationFilter.java   |    4 +-
 .../hi/HindiNormalizationFilterFactory.java     |    4 +-
 .../lucene/analysis/hi/HindiNormalizer.java     |    4 +-
 .../lucene/analysis/hi/HindiStemFilter.java     |    4 +-
 .../analysis/hi/HindiStemFilterFactory.java     |    4 +-
 .../apache/lucene/analysis/hi/HindiStemmer.java |    4 +-
 .../lucene/analysis/hu/HungarianAnalyzer.java   |    4 +-
 .../analysis/hu/HungarianLightStemFilter.java   |    4 +-
 .../hu/HungarianLightStemFilterFactory.java     |    4 +-
 .../analysis/hu/HungarianLightStemmer.java      |    4 +-
 .../lucene/analysis/hunspell/Dictionary.java    |    4 +-
 .../analysis/hunspell/HunspellStemFilter.java   |    4 +-
 .../hunspell/HunspellStemFilterFactory.java     |    4 +-
 .../analysis/hunspell/ISO8859_14Decoder.java    |    4 +-
 .../lucene/analysis/hunspell/Stemmer.java       |    4 +-
 .../lucene/analysis/hy/ArmenianAnalyzer.java    |    4 +-
 .../lucene/analysis/id/IndonesianAnalyzer.java  |    4 +-
 .../analysis/id/IndonesianStemFilter.java       |    4 +-
 .../id/IndonesianStemFilterFactory.java         |    4 +-
 .../lucene/analysis/id/IndonesianStemmer.java   |    4 +-
 .../analysis/in/IndicNormalizationFilter.java   |    4 +-
 .../in/IndicNormalizationFilterFactory.java     |    4 +-
 .../lucene/analysis/in/IndicNormalizer.java     |    4 +-
 .../lucene/analysis/it/ItalianAnalyzer.java     |    4 +-
 .../analysis/it/ItalianLightStemFilter.java     |    4 +-
 .../it/ItalianLightStemFilterFactory.java       |    4 +-
 .../lucene/analysis/it/ItalianLightStemmer.java |    4 +-
 .../lucene/analysis/lt/LithuanianAnalyzer.java  |    4 +-
 .../lucene/analysis/lv/LatvianAnalyzer.java     |    4 +-
 .../lucene/analysis/lv/LatvianStemFilter.java   |    4 +-
 .../analysis/lv/LatvianStemFilterFactory.java   |    4 +-
 .../lucene/analysis/lv/LatvianStemmer.java      |    8 +-
 .../miscellaneous/ASCIIFoldingFilter.java       |    6 +-
 .../ASCIIFoldingFilterFactory.java              |    4 +-
 .../miscellaneous/CapitalizationFilter.java     |    4 +-
 .../CapitalizationFilterFactory.java            |    4 +-
 .../miscellaneous/CodepointCountFilter.java     |    4 +-
 .../CodepointCountFilterFactory.java            |    4 +-
 .../miscellaneous/DateRecognizerFilter.java     |    4 +-
 .../DateRecognizerFilterFactory.java            |    4 +-
 .../miscellaneous/EmptyTokenStream.java         |    4 +-
 .../miscellaneous/FingerprintFilter.java        |    4 +-
 .../miscellaneous/FingerprintFilterFactory.java |    4 +-
 .../miscellaneous/HyphenatedWordsFilter.java    |    4 +-
 .../HyphenatedWordsFilterFactory.java           |    4 +-
 .../analysis/miscellaneous/KeepWordFilter.java  |    1 -
 .../miscellaneous/KeepWordFilterFactory.java    |    4 +-
 .../miscellaneous/KeywordMarkerFilter.java      |    4 +-
 .../KeywordMarkerFilterFactory.java             |    4 +-
 .../miscellaneous/KeywordRepeatFilter.java      |    4 +-
 .../KeywordRepeatFilterFactory.java             |    4 +-
 .../analysis/miscellaneous/LengthFilter.java    |    4 +-
 .../miscellaneous/LengthFilterFactory.java      |    4 +-
 .../miscellaneous/LimitTokenCountAnalyzer.java  |    4 +-
 .../miscellaneous/LimitTokenCountFilter.java    |    4 +-
 .../LimitTokenCountFilterFactory.java           |    4 +-
 .../miscellaneous/LimitTokenOffsetFilter.java   |    4 +-
 .../LimitTokenOffsetFilterFactory.java          |    4 +-
 .../miscellaneous/LimitTokenPositionFilter.java |    2 +-
 .../LimitTokenPositionFilterFactory.java        |    2 +-
 .../PatternKeywordMarkerFilter.java             |    4 +-
 .../miscellaneous/PerFieldAnalyzerWrapper.java  |    4 +-
 .../PrefixAndSuffixAwareTokenFilter.java        |    4 +-
 .../miscellaneous/PrefixAwareTokenFilter.java   |    4 +-
 .../RemoveDuplicatesTokenFilter.java            |    1 -
 .../RemoveDuplicatesTokenFilterFactory.java     |    4 +-
 .../ScandinavianFoldingFilter.java              |    4 +-
 .../ScandinavianFoldingFilterFactory.java       |    4 +-
 .../ScandinavianNormalizationFilter.java        |    4 +-
 .../ScandinavianNormalizationFilterFactory.java |    4 +-
 .../miscellaneous/SetKeywordMarkerFilter.java   |    2 +-
 .../miscellaneous/StemmerOverrideFilter.java    |    4 +-
 .../StemmerOverrideFilterFactory.java           |    4 +-
 .../analysis/miscellaneous/TrimFilter.java      |    1 -
 .../miscellaneous/TrimFilterFactory.java        |    4 +-
 .../miscellaneous/TruncateTokenFilter.java      |    4 +-
 .../TruncateTokenFilterFactory.java             |    4 +-
 .../miscellaneous/WordDelimiterFilter.java      |    6 +-
 .../WordDelimiterFilterFactory.java             |    4 +-
 .../miscellaneous/WordDelimiterIterator.java    |    4 +-
 .../analysis/ngram/EdgeNGramFilterFactory.java  |    4 +-
 .../analysis/ngram/EdgeNGramTokenFilter.java    |    4 +-
 .../analysis/ngram/EdgeNGramTokenizer.java      |    4 +-
 .../ngram/EdgeNGramTokenizerFactory.java        |    4 +-
 .../analysis/ngram/NGramFilterFactory.java      |    4 +-
 .../lucene/analysis/ngram/NGramTokenFilter.java |    4 +-
 .../lucene/analysis/ngram/NGramTokenizer.java   |    4 +-
 .../analysis/ngram/NGramTokenizerFactory.java   |    4 +-
 .../lucene/analysis/nl/DutchAnalyzer.java       |    4 +-
 .../lucene/analysis/no/NorwegianAnalyzer.java   |    4 +-
 .../analysis/no/NorwegianLightStemFilter.java   |    4 +-
 .../no/NorwegianLightStemFilterFactory.java     |    4 +-
 .../analysis/no/NorwegianLightStemmer.java      |    4 +-
 .../analysis/no/NorwegianMinimalStemFilter.java |    4 +-
 .../no/NorwegianMinimalStemFilterFactory.java   |    4 +-
 .../analysis/no/NorwegianMinimalStemmer.java    |    4 +-
 .../analysis/path/PathHierarchyTokenizer.java   |    2 +-
 .../path/PathHierarchyTokenizerFactory.java     |    4 +-
 .../path/ReversePathHierarchyTokenizer.java     |    2 +-
 .../PatternCaptureGroupFilterFactory.java       |    4 +-
 .../pattern/PatternCaptureGroupTokenFilter.java |    4 +-
 .../pattern/PatternReplaceCharFilter.java       |    1 -
 .../PatternReplaceCharFilterFactory.java        |    4 +-
 .../analysis/pattern/PatternReplaceFilter.java  |    1 -
 .../pattern/PatternReplaceFilterFactory.java    |    4 +-
 .../analysis/pattern/PatternTokenizer.java      |    1 -
 .../pattern/PatternTokenizerFactory.java        |    4 +-
 .../analysis/payloads/AbstractEncoder.java      |    8 +-
 .../payloads/DelimitedPayloadTokenFilter.java   |    2 +-
 .../DelimitedPayloadTokenFilterFactory.java     |    4 +-
 .../lucene/analysis/payloads/FloatEncoder.java  |    8 +-
 .../analysis/payloads/IdentityEncoder.java      |    2 +-
 .../analysis/payloads/IntegerEncoder.java       |    2 +-
 .../payloads/NumericPayloadTokenFilter.java     |    2 +-
 .../NumericPayloadTokenFilterFactory.java       |    4 +-
 .../analysis/payloads/PayloadEncoder.java       |    8 +-
 .../lucene/analysis/payloads/PayloadHelper.java |    2 +-
 .../payloads/TokenOffsetPayloadTokenFilter.java |    2 +-
 .../TokenOffsetPayloadTokenFilterFactory.java   |    4 +-
 .../payloads/TypeAsPayloadTokenFilter.java      |    2 +-
 .../TypeAsPayloadTokenFilterFactory.java        |    4 +-
 .../lucene/analysis/pt/PortugueseAnalyzer.java  |    4 +-
 .../analysis/pt/PortugueseLightStemFilter.java  |    4 +-
 .../pt/PortugueseLightStemFilterFactory.java    |    4 +-
 .../analysis/pt/PortugueseLightStemmer.java     |    4 +-
 .../pt/PortugueseMinimalStemFilter.java         |    4 +-
 .../pt/PortugueseMinimalStemFilterFactory.java  |    4 +-
 .../analysis/pt/PortugueseMinimalStemmer.java   |    4 +-
 .../analysis/pt/PortugueseStemFilter.java       |    4 +-
 .../pt/PortugueseStemFilterFactory.java         |    4 +-
 .../lucene/analysis/pt/PortugueseStemmer.java   |    4 +-
 .../lucene/analysis/pt/RSLPStemmerBase.java     |    4 +-
 .../query/QueryAutoStopWordAnalyzer.java        |    2 +-
 .../analysis/reverse/ReverseStringFilter.java   |    1 -
 .../reverse/ReverseStringFilterFactory.java     |    4 +-
 .../lucene/analysis/ro/RomanianAnalyzer.java    |    4 +-
 .../lucene/analysis/ru/RussianAnalyzer.java     |    4 +-
 .../analysis/ru/RussianLightStemFilter.java     |    4 +-
 .../ru/RussianLightStemFilterFactory.java       |    4 +-
 .../lucene/analysis/ru/RussianLightStemmer.java |    4 +-
 .../shingle/ShingleAnalyzerWrapper.java         |    4 +-
 .../lucene/analysis/shingle/ShingleFilter.java  |    4 +-
 .../analysis/shingle/ShingleFilterFactory.java  |    4 +-
 .../analysis/sinks/TeeSinkTokenFilter.java      |    4 +-
 .../analysis/snowball/SnowballFilter.java       |    4 +-
 .../snowball/SnowballPorterFilterFactory.java   |    4 +-
 .../analysis/sr/SerbianNormalizationFilter.java |    4 +-
 .../sr/SerbianNormalizationFilterFactory.java   |    4 +-
 .../sr/SerbianNormalizationRegularFilter.java   |    4 +-
 .../analysis/standard/ClassicAnalyzer.java      |    4 +-
 .../lucene/analysis/standard/ClassicFilter.java |    4 +-
 .../analysis/standard/ClassicFilterFactory.java |    4 +-
 .../analysis/standard/ClassicTokenizer.java     |    1 -
 .../standard/ClassicTokenizerFactory.java       |    4 +-
 .../analysis/standard/ClassicTokenizerImpl.java |    3 +-
 .../standard/ClassicTokenizerImpl.jflex         |    3 +-
 .../analysis/standard/StandardAnalyzer.java     |    4 +-
 .../analysis/standard/StandardFilter.java       |    4 +-
 .../standard/StandardFilterFactory.java         |    4 +-
 .../analysis/standard/StandardTokenizer.java    |    1 -
 .../standard/StandardTokenizerFactory.java      |    4 +-
 .../standard/StandardTokenizerImpl.java         |    3 +-
 .../standard/StandardTokenizerImpl.jflex        |    3 +-
 .../standard/UAX29URLEmailAnalyzer.java         |    4 +-
 .../standard/UAX29URLEmailTokenizer.java        |    4 +-
 .../standard/UAX29URLEmailTokenizerFactory.java |    4 +-
 .../standard/UAX29URLEmailTokenizerImpl.java    |    3 +-
 .../standard/UAX29URLEmailTokenizerImpl.jflex   |    3 +-
 .../lucene/analysis/sv/SwedishAnalyzer.java     |    4 +-
 .../analysis/sv/SwedishLightStemFilter.java     |    4 +-
 .../sv/SwedishLightStemFilterFactory.java       |    4 +-
 .../lucene/analysis/sv/SwedishLightStemmer.java |    4 +-
 .../analysis/synonym/SolrSynonymParser.java     |    4 +-
 .../lucene/analysis/synonym/SynonymFilter.java  |    9 +-
 .../analysis/synonym/SynonymFilterFactory.java  |    4 +-
 .../lucene/analysis/synonym/SynonymMap.java     |    4 +-
 .../analysis/synonym/WordnetSynonymParser.java  |    4 +-
 .../apache/lucene/analysis/th/ThaiAnalyzer.java |   14 +-
 .../lucene/analysis/th/ThaiTokenizer.java       |    4 +-
 .../analysis/th/ThaiTokenizerFactory.java       |    4 +-
 .../lucene/analysis/tr/ApostropheFilter.java    |    4 +-
 .../analysis/tr/ApostropheFilterFactory.java    |    4 +-
 .../lucene/analysis/tr/TurkishAnalyzer.java     |    4 +-
 .../analysis/tr/TurkishLowerCaseFilter.java     |    4 +-
 .../tr/TurkishLowerCaseFilterFactory.java       |    4 +-
 .../analysis/util/AbstractAnalysisFactory.java  |    4 +-
 .../lucene/analysis/util/AnalysisSPILoader.java |    4 +-
 .../lucene/analysis/util/CharArrayIterator.java |    4 +-
 .../lucene/analysis/util/CharArrayMap.java      |    4 +-
 .../lucene/analysis/util/CharArraySet.java      |    4 +-
 .../lucene/analysis/util/CharFilterFactory.java |    4 +-
 .../lucene/analysis/util/CharTokenizer.java     |    4 +-
 .../lucene/analysis/util/CharacterUtils.java    |    4 +-
 .../analysis/util/ClasspathResourceLoader.java  |    4 +-
 .../lucene/analysis/util/ElisionFilter.java     |    4 +-
 .../analysis/util/ElisionFilterFactory.java     |    4 +-
 .../analysis/util/FilesystemResourceLoader.java |    4 +-
 .../analysis/util/FilteringTokenFilter.java     |    4 +-
 .../analysis/util/MultiTermAwareComponent.java  |    4 +-
 .../lucene/analysis/util/OpenStringBuilder.java |    4 +-
 .../lucene/analysis/util/ResourceLoader.java    |    4 +-
 .../analysis/util/ResourceLoaderAware.java      |    1 -
 .../lucene/analysis/util/RollingCharBuffer.java |    6 +-
 .../analysis/util/SegmentingTokenizerBase.java  |    4 +-
 .../lucene/analysis/util/StemmerUtil.java       |    4 +-
 .../analysis/util/StopwordAnalyzerBase.java     |    1 -
 .../analysis/util/TokenFilterFactory.java       |    4 +-
 .../lucene/analysis/util/TokenizerFactory.java  |    4 +-
 .../lucene/analysis/util/UnicodeProps.java      |    6 +-
 .../lucene/analysis/util/WordlistLoader.java    |    4 +-
 .../analysis/wikipedia/WikipediaTokenizer.java  |    1 -
 .../wikipedia/WikipediaTokenizerFactory.java    |    4 +-
 .../wikipedia/WikipediaTokenizerImpl.java       |    3 +-
 .../wikipedia/WikipediaTokenizerImpl.jflex      |    3 +-
 .../collation/CollationAttributeFactory.java    |    4 +-
 .../collation/CollationDocValuesField.java      |    4 +-
 .../lucene/collation/CollationKeyAnalyzer.java  |    4 +-
 .../CollatedTermAttributeImpl.java              |    4 +-
 .../org/tartarus/snowball/SnowballProgram.java  |    4 +-
 .../lucene/analysis/ar/TestArabicAnalyzer.java  |    4 +-
 .../lucene/analysis/ar/TestArabicFilters.java   |   28 +-
 .../ar/TestArabicNormalizationFilter.java       |    4 +-
 .../analysis/ar/TestArabicStemFilter.java       |    4 +-
 .../analysis/bg/TestBulgarianAnalyzer.java      |    4 +-
 .../bg/TestBulgarianStemFilterFactory.java      |   12 +-
 .../analysis/bg/TestBulgarianStemmer.java       |    4 +-
 .../analysis/br/TestBrazilianAnalyzer.java      |    4 +-
 .../br/TestBrazilianStemFilterFactory.java      |   12 +-
 .../lucene/analysis/ca/TestCatalanAnalyzer.java |    4 +-
 .../charfilter/HTMLStripCharFilterTest.java     |    4 +-
 .../TestHTMLStripCharFilterFactory.java         |   12 +-
 .../charfilter/TestMappingCharFilter.java       |    1 -
 .../TestMappingCharFilterFactory.java           |   37 +-
 .../lucene/analysis/cjk/TestCJKAnalyzer.java    |    4 +-
 .../analysis/cjk/TestCJKBigramFilter.java       |    4 +-
 .../cjk/TestCJKBigramFilterFactory.java         |   11 +-
 .../lucene/analysis/cjk/TestCJKWidthFilter.java |    4 +-
 .../analysis/cjk/TestCJKWidthFilterFactory.java |   12 +-
 .../lucene/analysis/ckb/TestSoraniAnalyzer.java |    4 +-
 .../ckb/TestSoraniNormalizationFilter.java      |    4 +-
 .../TestSoraniNormalizationFilterFactory.java   |   12 +-
 .../analysis/ckb/TestSoraniStemFilter.java      |    4 +-
 .../ckb/TestSoraniStemFilterFactory.java        |   12 +-
 .../TestCommonGramsFilterFactory.java           |   12 +-
 .../TestCommonGramsQueryFilterFactory.java      |   12 +-
 .../compound/TestCompoundWordTokenFilter.java   |    4 +-
 ...ictionaryCompoundWordTokenFilterFactory.java |   12 +-
 ...phenationCompoundWordTokenFilterFactory.java |   12 +-
 .../core/TestAllAnalyzersHaveFactories.java     |    4 +-
 .../lucene/analysis/core/TestAnalyzers.java     |    4 +-
 .../analysis/core/TestBugInSomething.java       |  112 +-
 .../analysis/core/TestDecimalDigitFilter.java   |    4 +-
 .../core/TestDecimalDigitFilterFactory.java     |   12 +-
 .../analysis/core/TestDuelingAnalyzers.java     |    4 +-
 .../lucene/analysis/core/TestFactories.java     |    4 +-
 .../analysis/core/TestKeywordAnalyzer.java      |    4 +-
 .../lucene/analysis/core/TestRandomChains.java  |    4 +-
 .../lucene/analysis/core/TestStopAnalyzer.java  |    4 +-
 .../lucene/analysis/core/TestStopFilter.java    |   15 +-
 .../analysis/core/TestStopFilterFactory.java    |   40 +-
 .../analysis/core/TestTypeTokenFilter.java      |    4 +-
 .../core/TestTypeTokenFilterFactory.java        |   20 +-
 .../core/TestUnicodeWhitespaceTokenizer.java    |    4 +-
 .../analysis/custom/TestCustomAnalyzer.java     |   91 +-
 .../lucene/analysis/cz/TestCzechAnalyzer.java   |    4 +-
 .../analysis/cz/TestCzechStemFilterFactory.java |   12 +-
 .../lucene/analysis/cz/TestCzechStemmer.java    |    4 +-
 .../lucene/analysis/da/TestDanishAnalyzer.java  |    4 +-
 .../lucene/analysis/de/TestGermanAnalyzer.java  |    4 +-
 .../analysis/de/TestGermanLightStemFilter.java  |    4 +-
 .../de/TestGermanLightStemFilterFactory.java    |   12 +-
 .../de/TestGermanMinimalStemFilter.java         |    4 +-
 .../de/TestGermanMinimalStemFilterFactory.java  |   12 +-
 .../de/TestGermanNormalizationFilter.java       |    4 +-
 .../TestGermanNormalizationFilterFactory.java   |   12 +-
 .../analysis/de/TestGermanStemFilter.java       |    4 +-
 .../de/TestGermanStemFilterFactory.java         |   12 +-
 .../lucene/analysis/el/GreekAnalyzerTest.java   |   14 +-
 .../el/TestGreekLowerCaseFilterFactory.java     |   12 +-
 .../analysis/el/TestGreekStemFilterFactory.java |   12 +-
 .../lucene/analysis/el/TestGreekStemmer.java    |    4 +-
 .../lucene/analysis/en/TestEnglishAnalyzer.java |    4 +-
 .../en/TestEnglishMinimalStemFilter.java        |    4 +-
 .../en/TestEnglishMinimalStemFilterFactory.java |   12 +-
 .../analysis/en/TestKStemFilterFactory.java     |   12 +-
 .../apache/lucene/analysis/en/TestKStemmer.java |    4 +-
 .../analysis/en/TestPorterStemFilter.java       |    4 +-
 .../en/TestPorterStemFilterFactory.java         |   12 +-
 .../lucene/analysis/es/TestSpanishAnalyzer.java |    4 +-
 .../analysis/es/TestSpanishLightStemFilter.java |    4 +-
 .../es/TestSpanishLightStemFilterFactory.java   |   12 +-
 .../lucene/analysis/eu/TestBasqueAnalyzer.java  |    4 +-
 .../lucene/analysis/fa/TestPersianAnalyzer.java |    4 +-
 .../analysis/fa/TestPersianCharFilter.java      |    4 +-
 .../fa/TestPersianNormalizationFilter.java      |    4 +-
 .../TestPersianNormalizationFilterFactory.java  |   12 +-
 .../lucene/analysis/fi/TestFinnishAnalyzer.java |    4 +-
 .../analysis/fi/TestFinnishLightStemFilter.java |    4 +-
 .../fi/TestFinnishLightStemFilterFactory.java   |   12 +-
 .../lucene/analysis/fr/TestFrenchAnalyzer.java  |    4 +-
 .../analysis/fr/TestFrenchLightStemFilter.java  |    4 +-
 .../fr/TestFrenchLightStemFilterFactory.java    |   12 +-
 .../fr/TestFrenchMinimalStemFilter.java         |    4 +-
 .../fr/TestFrenchMinimalStemFilterFactory.java  |   12 +-
 .../lucene/analysis/ga/TestIrishAnalyzer.java   |    4 +-
 .../analysis/ga/TestIrishLowerCaseFilter.java   |    4 +-
 .../ga/TestIrishLowerCaseFilterFactory.java     |   12 +-
 .../analysis/gl/TestGalicianAnalyzer.java       |    4 +-
 .../gl/TestGalicianMinimalStemFilter.java       |    4 +-
 .../TestGalicianMinimalStemFilterFactory.java   |   12 +-
 .../analysis/gl/TestGalicianStemFilter.java     |    4 +-
 .../gl/TestGalicianStemFilterFactory.java       |   12 +-
 .../lucene/analysis/hi/TestHindiAnalyzer.java   |   14 +-
 .../lucene/analysis/hi/TestHindiFilters.java    |   28 +-
 .../lucene/analysis/hi/TestHindiNormalizer.java |    4 +-
 .../lucene/analysis/hi/TestHindiStemmer.java    |    4 +-
 .../analysis/hu/TestHungarianAnalyzer.java      |    4 +-
 .../hu/TestHungarianLightStemFilter.java        |    4 +-
 .../hu/TestHungarianLightStemFilterFactory.java |   12 +-
 .../analysis/hunspell/StemmerTestBase.java      |    4 +-
 .../analysis/hunspell/Test64kAffixes.java       |    8 +-
 .../analysis/hunspell/TestAllDictionaries.java  |   10 +-
 .../analysis/hunspell/TestAllDictionaries2.java |   10 +-
 .../analysis/hunspell/TestAlternateCasing.java  |    4 +-
 .../analysis/hunspell/TestCaseInsensitive.java  |    4 +-
 .../analysis/hunspell/TestCaseSensitive.java    |    4 +-
 .../lucene/analysis/hunspell/TestCircumfix.java |    4 +-
 .../analysis/hunspell/TestComplexPrefix.java    |    4 +-
 .../lucene/analysis/hunspell/TestCondition.java |    4 +-
 .../analysis/hunspell/TestCondition2.java       |    8 +-
 .../lucene/analysis/hunspell/TestConv.java      |    8 +-
 .../analysis/hunspell/TestDependencies.java     |    4 +-
 .../analysis/hunspell/TestDictionary.java       |   28 +-
 .../analysis/hunspell/TestDoubleEscape.java     |    4 +-
 .../lucene/analysis/hunspell/TestEscaped.java   |    4 +-
 .../lucene/analysis/hunspell/TestFlagLong.java  |    4 +-
 .../lucene/analysis/hunspell/TestFlagNum.java   |    4 +-
 .../lucene/analysis/hunspell/TestFullStrip.java |    4 +-
 .../lucene/analysis/hunspell/TestHomonyms.java  |    4 +-
 .../hunspell/TestHunspellStemFilter.java        |   10 +-
 .../hunspell/TestHunspellStemFilterFactory.java |   12 +-
 .../lucene/analysis/hunspell/TestIgnore.java    |    4 +-
 .../lucene/analysis/hunspell/TestKeepCase.java  |    4 +-
 .../lucene/analysis/hunspell/TestMorph.java     |    4 +-
 .../analysis/hunspell/TestMorphAlias.java       |    4 +-
 .../lucene/analysis/hunspell/TestMorphData.java |    4 +-
 .../lucene/analysis/hunspell/TestNeedAffix.java |    4 +-
 .../analysis/hunspell/TestOnlyInCompound.java   |    4 +-
 .../hunspell/TestOptionalCondition.java         |    4 +-
 .../lucene/analysis/hunspell/TestSpaces.java    |    4 +-
 .../lucene/analysis/hunspell/TestStemmer.java   |    4 +-
 .../hunspell/TestStrangeOvergeneration.java     |    4 +-
 .../lucene/analysis/hunspell/TestTwoFold.java   |    4 +-
 .../analysis/hunspell/TestTwoSuffixes.java      |    4 +-
 .../lucene/analysis/hunspell/TestZeroAffix.java |    4 +-
 .../analysis/hunspell/TestZeroAffix2.java       |    4 +-
 .../analysis/hy/TestArmenianAnalyzer.java       |    4 +-
 .../analysis/id/TestIndonesianAnalyzer.java     |    4 +-
 .../id/TestIndonesianStemFilterFactory.java     |   12 +-
 .../analysis/id/TestIndonesianStemmer.java      |    4 +-
 .../lucene/analysis/in/TestIndicNormalizer.java |    4 +-
 .../lucene/analysis/it/TestItalianAnalyzer.java |    4 +-
 .../analysis/it/TestItalianLightStemFilter.java |    4 +-
 .../it/TestItalianLightStemFilterFactory.java   |   12 +-
 .../analysis/lt/TestLithuanianAnalyzer.java     |    4 +-
 .../analysis/lt/TestLithuanianStemming.java     |    4 +-
 .../lucene/analysis/lv/TestLatvianAnalyzer.java |    4 +-
 .../lv/TestLatvianStemFilterFactory.java        |   12 +-
 .../lucene/analysis/lv/TestLatvianStemmer.java  |    4 +-
 .../DateRecognizerFilterFactoryTest.java        |   21 +-
 .../miscellaneous/DateRecognizerFilterTest.java |   14 +-
 .../miscellaneous/TestASCIIFoldingFilter.java   |    4 +-
 .../miscellaneous/TestCapitalizationFilter.java |    1 -
 .../TestCapitalizationFilterFactory.java        |   22 +-
 .../miscellaneous/TestCodepointCountFilter.java |    4 +-
 .../TestCodepointCountFilterFactory.java        |   20 +-
 .../miscellaneous/TestEmptyTokenStream.java     |    4 +-
 .../miscellaneous/TestFingerprintFilter.java    |    4 +-
 .../TestFingerprintFilterFactory.java           |   12 +-
 .../TestHyphenatedWordsFilter.java              |    1 -
 .../miscellaneous/TestKeepFilterFactory.java    |   12 +-
 .../miscellaneous/TestKeepWordFilter.java       |    1 -
 .../miscellaneous/TestKeywordMarkerFilter.java  |   32 +-
 .../TestKeywordMarkerFilterFactory.java         |   12 +-
 .../miscellaneous/TestKeywordRepeatFilter.java  |    4 +-
 .../miscellaneous/TestLengthFilter.java         |    4 +-
 .../miscellaneous/TestLengthFilterFactory.java  |   20 +-
 .../TestLimitTokenCountAnalyzer.java            |    4 +-
 .../TestLimitTokenCountFilter.java              |    4 +-
 .../TestLimitTokenCountFilterFactory.java       |   22 +-
 .../TestLimitTokenOffsetFilter.java             |    4 +-
 .../TestLimitTokenOffsetFilterFactory.java      |   22 +-
 .../TestLimitTokenPositionFilter.java           |    2 +-
 .../TestLimitTokenPositionFilterFactory.java    |   20 +-
 .../TestPerFieldAnalyzerWrapper.java            |   32 +-
 .../TestPrefixAndSuffixAwareTokenFilter.java    |    4 +-
 .../TestPrefixAwareTokenFilter.java             |    4 +-
 .../TestRemoveDuplicatesTokenFilter.java        |    1 -
 .../TestRemoveDuplicatesTokenFilterFactory.java |   12 +-
 .../TestScandinavianFoldingFilter.java          |    4 +-
 .../TestScandinavianFoldingFilterFactory.java   |   23 +-
 .../TestScandinavianNormalizationFilter.java    |    4 +-
 ...tScandinavianNormalizationFilterFactory.java |   26 +-
 .../TestStemmerOverrideFilter.java              |    2 +-
 .../TestStemmerOverrideFilterFactory.java       |   12 +-
 .../analysis/miscellaneous/TestTrimFilter.java  |    1 -
 .../miscellaneous/TestTrimFilterFactory.java    |   12 +-
 .../miscellaneous/TestTruncateTokenFilter.java  |    4 +-
 .../TestTruncateTokenFilterFactory.java         |   20 +-
 .../miscellaneous/TestWordDelimiterFilter.java  |    1 -
 .../ngram/EdgeNGramTokenFilterTest.java         |   28 +-
 .../analysis/ngram/EdgeNGramTokenizerTest.java  |   28 +-
 .../analysis/ngram/NGramTokenFilterTest.java    |   20 +-
 .../analysis/ngram/NGramTokenizerTest.java      |   21 +-
 .../lucene/analysis/ngram/TestNGramFilters.java |   36 +-
 .../lucene/analysis/nl/TestDutchAnalyzer.java   |    4 +-
 .../analysis/no/TestNorwegianAnalyzer.java      |    4 +-
 .../no/TestNorwegianLightStemFilter.java        |    4 +-
 .../no/TestNorwegianLightStemFilterFactory.java |   12 +-
 .../no/TestNorwegianMinimalStemFilter.java      |    4 +-
 .../TestNorwegianMinimalStemFilterFactory.java  |   12 +-
 .../path/TestPathHierarchyTokenizer.java        |    4 +-
 .../path/TestReversePathHierarchyTokenizer.java |    4 +-
 .../TestPatternCaptureGroupTokenFilter.java     |    4 +-
 .../pattern/TestPatternReplaceCharFilter.java   |    1 -
 .../TestPatternReplaceCharFilterFactory.java    |   12 +-
 .../pattern/TestPatternReplaceFilter.java       |    1 -
 .../TestPatternReplaceFilterFactory.java        |   12 +-
 .../analysis/pattern/TestPatternTokenizer.java  |    1 -
 .../pattern/TestPatternTokenizerFactory.java    |   12 +-
 .../DelimitedPayloadTokenFilterTest.java        |    2 +-
 .../payloads/NumericPayloadTokenFilterTest.java |   14 +-
 .../TestDelimitedPayloadTokenFilterFactory.java |   12 +-
 .../TokenOffsetPayloadTokenFilterTest.java      |   15 +-
 .../payloads/TypeAsPayloadTokenFilterTest.java  |   17 +-
 .../analysis/pt/TestPortugueseAnalyzer.java     |    4 +-
 .../pt/TestPortugueseLightStemFilter.java       |    4 +-
 .../TestPortugueseLightStemFilterFactory.java   |   12 +-
 .../pt/TestPortugueseMinimalStemFilter.java     |    4 +-
 .../TestPortugueseMinimalStemFilterFactory.java |   12 +-
 .../analysis/pt/TestPortugueseStemFilter.java   |    4 +-
 .../pt/TestPortugueseStemFilterFactory.java     |   12 +-
 .../query/QueryAutoStopWordAnalyzerTest.java    |    2 +-
 .../reverse/TestReverseStringFilter.java        |    1 -
 .../reverse/TestReverseStringFilterFactory.java |   12 +-
 .../analysis/ro/TestRomanianAnalyzer.java       |    4 +-
 .../lucene/analysis/ru/TestRussianAnalyzer.java |    4 +-
 .../analysis/ru/TestRussianLightStemFilter.java |    4 +-
 .../ru/TestRussianLightStemFilterFactory.java   |   12 +-
 .../shingle/ShingleAnalyzerWrapperTest.java     |    4 +-
 .../analysis/shingle/ShingleFilterTest.java     |    4 +-
 .../shingle/TestShingleFilterFactory.java       |   12 +-
 .../analysis/sinks/TestTeeSinkTokenFilter.java  |   14 +-
 .../lucene/analysis/snowball/TestSnowball.java  |    4 +-
 .../TestSnowballPorterFilterFactory.java        |   23 +-
 .../analysis/snowball/TestSnowballVocab.java    |    4 +-
 .../sr/TestSerbianNormalizationFilter.java      |    4 +-
 .../TestSerbianNormalizationFilterFactory.java  |   12 +-
 .../TestSerbianNormalizationRegularFilter.java  |    4 +-
 .../analysis/standard/TestClassicAnalyzer.java  |    4 +-
 .../analysis/standard/TestStandardAnalyzer.java |    4 +-
 .../standard/TestStandardFactories.java         |   68 +-
 .../standard/TestUAX29URLEmailAnalyzer.java     |    4 +-
 .../standard/TestUAX29URLEmailTokenizer.java    |   32 +-
 .../TestUAX29URLEmailTokenizerFactory.java      |   22 +-
 .../standard/WordBreakTestUnicode_6_3_0.java    |    4 +-
 .../lucene/analysis/sv/TestSwedishAnalyzer.java |    4 +-
 .../analysis/sv/TestSwedishLightStemFilter.java |    4 +-
 .../sv/TestSwedishLightStemFilterFactory.java   |   12 +-
 .../synonym/BaseSynonymParserTestCase.java      |    4 +-
 .../analysis/synonym/TestMultiWordSynonyms.java |    4 +-
 .../analysis/synonym/TestSolrSynonymParser.java |   39 +-
 .../synonym/TestSynonymFilterFactory.java       |   38 +-
 .../analysis/synonym/TestSynonymMapFilter.java  |   10 +-
 .../synonym/TestWordnetSynonymParser.java       |    1 -
 .../lucene/analysis/th/TestThaiAnalyzer.java    |    4 +-
 .../analysis/th/TestThaiTokenizerFactory.java   |   12 +-
 .../analysis/tr/TestApostropheFilter.java       |    4 +-
 .../tr/TestApostropheFilterFactory.java         |   12 +-
 .../lucene/analysis/tr/TestTurkishAnalyzer.java |    4 +-
 .../analysis/tr/TestTurkishLowerCaseFilter.java |    4 +-
 .../tr/TestTurkishLowerCaseFilterFactory.java   |   12 +-
 .../util/BaseTokenStreamFactoryTestCase.java    |    4 +-
 .../analysis/util/StringMockResourceLoader.java |    4 +-
 .../analysis/util/TestAnalysisSPILoader.java    |   88 +-
 .../analysis/util/TestCharArrayIterator.java    |   11 +-
 .../lucene/analysis/util/TestCharArrayMap.java  |   11 +-
 .../lucene/analysis/util/TestCharArraySet.java  |   30 +-
 .../analysis/util/TestCharTokenizers.java       |    4 +-
 .../analysis/util/TestCharacterUtils.java       |   26 +-
 .../lucene/analysis/util/TestElision.java       |    4 +-
 .../analysis/util/TestElisionFilterFactory.java |   12 +-
 .../util/TestFilesystemResourceLoader.java      |   49 +-
 .../analysis/util/TestRollingCharBuffer.java    |    4 +-
 .../util/TestSegmentingTokenizerBase.java       |    4 +-
 .../analysis/util/TestWordlistLoader.java       |    4 +-
 .../TestWikipediaTokenizerFactory.java          |   12 +-
 .../wikipedia/WikipediaTokenizerTest.java       |    1 -
 .../collation/TestCollationDocValuesField.java  |    4 +-
 .../collation/TestCollationKeyAnalyzer.java     |    4 +-
 .../standard/GenerateJflexTLDMacros.java        |   16 +-
 lucene/analysis/icu/src/data/uax29/Khmer.rbbi   |   61 -
 .../icu/src/data/utr30/DiacriticFolding.txt     |    6 +-
 .../icu/src/data/utr30/NativeDigitFolding.txt   |   10 +
 .../lucene/analysis/icu/ICUFoldingFilter.java   |    4 +-
 .../analysis/icu/ICUFoldingFilterFactory.java   |    4 +-
 .../analysis/icu/ICUNormalizer2CharFilter.java  |    4 +-
 .../icu/ICUNormalizer2CharFilterFactory.java    |    4 +-
 .../analysis/icu/ICUNormalizer2Filter.java      |    4 +-
 .../icu/ICUNormalizer2FilterFactory.java        |    4 +-
 .../lucene/analysis/icu/ICUTransformFilter.java |    4 +-
 .../analysis/icu/ICUTransformFilterFactory.java |    4 +-
 .../icu/segmentation/BreakIteratorWrapper.java  |    4 +-
 .../icu/segmentation/CharArrayIterator.java     |    4 +-
 .../segmentation/CompositeBreakIterator.java    |    4 +-
 .../segmentation/DefaultICUTokenizerConfig.java |   11 +-
 .../analysis/icu/segmentation/ICUTokenizer.java |    4 +-
 .../icu/segmentation/ICUTokenizerConfig.java    |    4 +-
 .../icu/segmentation/ICUTokenizerFactory.java   |    4 +-
 .../icu/segmentation/ScriptIterator.java        |    5 +-
 .../icu/tokenattributes/ScriptAttribute.java    |    4 +-
 .../tokenattributes/ScriptAttributeImpl.java    |    4 +-
 .../collation/ICUCollationAttributeFactory.java |    4 +-
 .../collation/ICUCollationDocValuesField.java   |    4 +-
 .../collation/ICUCollationKeyAnalyzer.java      |    4 +-
 .../ICUCollatedTermAttributeImpl.java           |    4 +-
 lucene/analysis/icu/src/java/overview.html      |    2 +-
 .../analysis/icu/segmentation/Default.brk       |  Bin 34320 -> 35264 bytes
 .../lucene/analysis/icu/segmentation/Khmer.brk  |  Bin 17296 -> 0 bytes
 .../org/apache/lucene/analysis/icu/utr30.nrm    |  Bin 53728 -> 53840 bytes
 .../analysis/icu/TestICUFoldingFilter.java      |    4 +-
 .../icu/TestICUFoldingFilterFactory.java        |   12 +-
 .../icu/TestICUNormalizer2CharFilter.java       |    4 +-
 .../TestICUNormalizer2CharFilterFactory.java    |   12 +-
 .../analysis/icu/TestICUNormalizer2Filter.java  |    4 +-
 .../icu/TestICUNormalizer2FilterFactory.java    |   12 +-
 .../analysis/icu/TestICUTransformFilter.java    |    4 +-
 .../icu/TestICUTransformFilterFactory.java      |   12 +-
 .../icu/segmentation/TestCharArrayIterator.java |   11 +-
 .../icu/segmentation/TestICUTokenizer.java      |    7 +-
 .../icu/segmentation/TestICUTokenizerCJK.java   |    4 +-
 .../segmentation/TestICUTokenizerFactory.java   |   12 +-
 .../segmentation/TestWithCJKBigramFilter.java   |    4 +-
 .../TestICUCollationDocValuesField.java         |    4 +-
 .../collation/TestICUCollationKeyAnalyzer.java  |    4 +-
 .../analysis/icu/GenerateUTR30DataFiles.java    |    4 +-
 .../lucene/analysis/icu/RBBIRuleCompiler.java   |    4 +-
 .../lucene/analysis/ja/GraphvizFormatter.java   |    4 +-
 .../lucene/analysis/ja/JapaneseAnalyzer.java    |    4 +-
 .../analysis/ja/JapaneseBaseFormFilter.java     |    4 +-
 .../ja/JapaneseBaseFormFilterFactory.java       |    4 +-
 .../ja/JapaneseIterationMarkCharFilter.java     |    4 +-
 .../JapaneseIterationMarkCharFilterFactory.java |    4 +-
 .../analysis/ja/JapaneseKatakanaStemFilter.java |    4 +-
 .../ja/JapaneseKatakanaStemFilterFactory.java   |    4 +-
 .../analysis/ja/JapaneseNumberFilter.java       |    4 +-
 .../ja/JapaneseNumberFilterFactory.java         |    4 +-
 .../ja/JapanesePartOfSpeechStopFilter.java      |    4 +-
 .../JapanesePartOfSpeechStopFilterFactory.java  |    4 +-
 .../analysis/ja/JapaneseReadingFormFilter.java  |    4 +-
 .../ja/JapaneseReadingFormFilterFactory.java    |    4 +-
 .../lucene/analysis/ja/JapaneseTokenizer.java   |    7 +-
 .../analysis/ja/JapaneseTokenizerFactory.java   |    4 +-
 .../org/apache/lucene/analysis/ja/Token.java    |    4 +-
 .../analysis/ja/dict/BinaryDictionary.java      |    4 +-
 .../analysis/ja/dict/CharacterDefinition.java   |    4 +-
 .../analysis/ja/dict/ConnectionCosts.java       |    4 +-
 .../lucene/analysis/ja/dict/Dictionary.java     |    4 +-
 .../analysis/ja/dict/TokenInfoDictionary.java   |    4 +-
 .../lucene/analysis/ja/dict/TokenInfoFST.java   |    4 +-
 .../analysis/ja/dict/UnknownDictionary.java     |    4 +-
 .../lucene/analysis/ja/dict/UserDictionary.java |    4 +-
 .../ja/tokenattributes/BaseFormAttribute.java   |    4 +-
 .../tokenattributes/BaseFormAttributeImpl.java  |    4 +-
 .../ja/tokenattributes/InflectionAttribute.java |    4 +-
 .../InflectionAttributeImpl.java                |    4 +-
 .../tokenattributes/PartOfSpeechAttribute.java  |    4 +-
 .../PartOfSpeechAttributeImpl.java              |    4 +-
 .../ja/tokenattributes/ReadingAttribute.java    |    4 +-
 .../tokenattributes/ReadingAttributeImpl.java   |    4 +-
 .../apache/lucene/analysis/ja/util/CSVUtil.java |    4 +-
 .../lucene/analysis/ja/util/ToStringUtil.java   |    4 +-
 .../analysis/ja/StringMockResourceLoader.java   |    4 +-
 .../lucene/analysis/ja/TestExtendedMode.java    |    4 +-
 .../analysis/ja/TestJapaneseAnalyzer.java       |    4 +-
 .../analysis/ja/TestJapaneseBaseFormFilter.java |    4 +-
 .../ja/TestJapaneseBaseFormFilterFactory.java   |   12 +-
 .../ja/TestJapaneseIterationMarkCharFilter.java |    4 +-
 ...tJapaneseIterationMarkCharFilterFactory.java |   12 +-
 .../ja/TestJapaneseKatakanaStemFilter.java      |    4 +-
 .../TestJapaneseKatakanaStemFilterFactory.java  |   12 +-
 .../analysis/ja/TestJapaneseNumberFilter.java   |    4 +-
 .../ja/TestJapaneseNumberFilterFactory.java     |   12 +-
 ...stJapanesePartOfSpeechStopFilterFactory.java |   12 +-
 .../ja/TestJapaneseReadingFormFilter.java       |    4 +-
 .../TestJapaneseReadingFormFilterFactory.java   |   12 +-
 .../analysis/ja/TestJapaneseTokenizer.java      |    4 +-
 .../ja/TestJapaneseTokenizerFactory.java        |   12 +-
 .../lucene/analysis/ja/TestSearchMode.java      |    4 +-
 .../ja/dict/TestTokenInfoDictionary.java        |    4 +-
 .../analysis/ja/dict/UserDictionaryTest.java    |    4 +-
 .../analysis/ja/util/TestToStringUtil.java      |    4 +-
 .../ja/util/BinaryDictionaryWriter.java         |    4 +-
 .../ja/util/CharacterDefinitionWriter.java      |    4 +-
 .../ja/util/ConnectionCostsBuilder.java         |    4 +-
 .../analysis/ja/util/ConnectionCostsWriter.java |    4 +-
 .../analysis/ja/util/DictionaryBuilder.java     |    4 +-
 .../ja/util/TokenInfoDictionaryBuilder.java     |    4 +-
 .../ja/util/TokenInfoDictionaryWriter.java      |    4 +-
 .../ja/util/UnknownDictionaryBuilder.java       |    4 +-
 .../ja/util/UnknownDictionaryWriter.java        |    4 +-
 .../analysis/ja/dict/UnknownDictionaryTest.java |    4 +-
 .../analysis/morfologik/MorfologikAnalyzer.java |    3 +-
 .../analysis/morfologik/MorfologikFilter.java   |    4 +-
 .../morfologik/MorfologikFilterFactory.java     |    4 +-
 .../MorphosyntacticTagsAttribute.java           |    3 +-
 .../MorphosyntacticTagsAttributeImpl.java       |    3 +-
 .../morfologik/TestMorfologikAnalyzer.java      |    4 +-
 .../morfologik/TestMorfologikFilterFactory.java |   20 +-
 .../analysis/phonetic/BeiderMorseFilter.java    |    4 +-
 .../phonetic/BeiderMorseFilterFactory.java      |    4 +-
 .../phonetic/DaitchMokotoffSoundexFilter.java   |    2 +-
 .../DaitchMokotoffSoundexFilterFactory.java     |    2 +-
 .../phonetic/DoubleMetaphoneFilterFactory.java  |    4 +-
 .../analysis/phonetic/PhoneticFilter.java       |    1 -
 .../phonetic/PhoneticFilterFactory.java         |    4 +-
 .../phonetic/TestBeiderMorseFilter.java         |    4 +-
 .../phonetic/TestBeiderMorseFilterFactory.java  |   12 +-
 .../TestDaitchMokotoffSoundexFilter.java        |    2 +-
 .../TestDaitchMokotoffSoundexFilterFactory.java |   12 +-
 .../TestDoubleMetaphoneFilterFactory.java       |   12 +-
 .../analysis/phonetic/TestPhoneticFilter.java   |    1 -
 .../phonetic/TestPhoneticFilterFactory.java     |   36 +-
 .../analysis/cn/smart/AnalyzerProfile.java      |    1 -
 .../lucene/analysis/cn/smart/CharType.java      |    1 -
 .../analysis/cn/smart/HMMChineseTokenizer.java  |    4 +-
 .../cn/smart/HMMChineseTokenizerFactory.java    |    1 -
 .../analysis/cn/smart/SmartChineseAnalyzer.java |    1 -
 .../lucene/analysis/cn/smart/Utility.java       |    1 -
 .../lucene/analysis/cn/smart/WordSegmenter.java |    1 -
 .../lucene/analysis/cn/smart/WordType.java      |    1 -
 .../cn/smart/hhmm/AbstractDictionary.java       |    1 -
 .../analysis/cn/smart/hhmm/BiSegGraph.java      |    1 -
 .../cn/smart/hhmm/BigramDictionary.java         |    1 -
 .../analysis/cn/smart/hhmm/HHMMSegmenter.java   |    1 -
 .../lucene/analysis/cn/smart/hhmm/PathNode.java |    1 -
 .../lucene/analysis/cn/smart/hhmm/SegGraph.java |    1 -
 .../lucene/analysis/cn/smart/hhmm/SegToken.java |    1 -
 .../analysis/cn/smart/hhmm/SegTokenFilter.java  |    1 -
 .../analysis/cn/smart/hhmm/SegTokenPair.java    |    1 -
 .../analysis/cn/smart/hhmm/WordDictionary.java  |    1 -
 .../smart/TestHMMChineseTokenizerFactory.java   |   12 +-
 .../cn/smart/TestSmartChineseAnalyzer.java      |    1 -
 .../lucene/analysis/pl/PolishAnalyzer.java      |    4 +-
 .../lucene/analysis/stempel/StempelFilter.java  |   26 +-
 .../stempel/StempelPolishStemFilterFactory.java |    4 +-
 .../lucene/analysis/stempel/StempelStemmer.java |   26 +-
 .../lucene/analysis/pl/TestPolishAnalyzer.java  |    4 +-
 .../TestStempelPolishStemFilterFactory.java     |   12 +-
 .../lucene/analysis/uima/BaseUIMATokenizer.java |    4 +-
 .../analysis/uima/UIMAAnnotationsTokenizer.java |    4 +-
 .../uima/UIMAAnnotationsTokenizerFactory.java   |    4 +-
 .../lucene/analysis/uima/UIMABaseAnalyzer.java  |    4 +-
 .../analysis/uima/UIMATypeAwareAnalyzer.java    |    4 +-
 .../uima/UIMATypeAwareAnnotationsTokenizer.java |    4 +-
 ...IMATypeAwareAnnotationsTokenizerFactory.java |    4 +-
 .../lucene/analysis/uima/ae/AEProvider.java     |    4 +-
 .../analysis/uima/ae/AEProviderFactory.java     |    4 +-
 .../analysis/uima/ae/BasicAEProvider.java       |    4 +-
 .../uima/ae/OverridingParamsAEProvider.java     |    4 +-
 .../analysis/uima/UIMABaseAnalyzerTest.java     |    4 +-
 .../uima/UIMATypeAwareAnalyzerTest.java         |    4 +-
 .../analysis/uima/ae/AEProviderFactoryTest.java |    4 +-
 .../analysis/uima/ae/BasicAEProviderTest.java   |    4 +-
 .../uima/ae/OverridingParamsAEProviderTest.java |   18 +-
 .../analysis/uima/an/SampleEntityAnnotator.java |    4 +-
 .../analysis/uima/an/SamplePoSTagger.java       |    4 +-
 .../uima/an/SampleWSTokenizerAnnotator.java     |    4 +-
 .../org/apache/lucene/codecs/Placeholder.java   |    4 +-
 .../lucene/codecs/lucene50/Lucene50Codec.java   |    4 +-
 .../lucene50/Lucene50DocValuesConsumer.java     |    4 +-
 .../lucene50/Lucene50DocValuesFormat.java       |    4 +-
 .../lucene50/Lucene50DocValuesProducer.java     |   10 +-
 .../codecs/lucene50/Lucene50NormsFormat.java    |    4 +-
 .../codecs/lucene50/Lucene50NormsProducer.java  |    4 +-
 .../lucene/codecs/lucene53/Lucene53Codec.java   |    4 +-
 .../lucene/codecs/lucene54/Lucene54Codec.java   |    4 +-
 .../codecs/lucene50/Lucene50NormsConsumer.java  |    4 +-
 .../lucene/codecs/lucene50/Lucene50RWCodec.java |    4 +-
 .../codecs/lucene50/Lucene50RWNormsFormat.java  |    4 +-
 .../lucene50/TestLucene50DocValuesFormat.java   |    4 +-
 .../lucene50/TestLucene50NormsFormat.java       |    4 +-
 .../index/TestBackwardsCompatibility.java       |   16 +-
 .../lucene/index/TestMaxPositionInOldIndex.java |   26 +-
 .../org/apache/lucene/index/index.5.5.0-cfs.zip |  Bin 0 -> 24776 bytes
 .../apache/lucene/index/index.5.5.0-nocfs.zip   |  Bin 0 -> 13756 bytes
 lucene/benchmark/.gitignore                     |    2 +
 .../org/apache/lucene/benchmark/Constants.java  |   19 +-
 .../lucene/benchmark/byTask/Benchmark.java      |    4 +-
 .../lucene/benchmark/byTask/PerfRunData.java    |    4 +-
 .../byTask/feeds/AbstractQueryMaker.java        |   13 +-
 .../byTask/feeds/ContentItemsSource.java        |    4 +-
 .../benchmark/byTask/feeds/ContentSource.java   |    4 +-
 .../benchmark/byTask/feeds/DemoHTMLParser.java  |    4 +-
 .../byTask/feeds/DirContentSource.java          |    4 +-
 .../lucene/benchmark/byTask/feeds/DocData.java  |    4 +-
 .../lucene/benchmark/byTask/feeds/DocMaker.java |    4 +-
 .../byTask/feeds/EnwikiContentSource.java       |    4 +-
 .../byTask/feeds/EnwikiQueryMaker.java          |    4 +-
 .../benchmark/byTask/feeds/FacetSource.java     |    4 +-
 .../byTask/feeds/FileBasedQueryMaker.java       |   18 +-
 .../byTask/feeds/GeonamesLineParser.java        |    4 +-
 .../benchmark/byTask/feeds/HTMLParser.java      |    4 +-
 .../benchmark/byTask/feeds/LineDocSource.java   |    4 +-
 .../feeds/LongToEnglishContentSource.java       |    4 +-
 .../byTask/feeds/LongToEnglishQueryMaker.java   |    4 +-
 .../byTask/feeds/NoMoreDataException.java       |    4 +-
 .../benchmark/byTask/feeds/QueryMaker.java      |    4 +-
 .../byTask/feeds/RandomFacetSource.java         |    4 +-
 .../byTask/feeds/ReutersContentSource.java      |    4 +-
 .../byTask/feeds/ReutersQueryMaker.java         |    4 +-
 .../byTask/feeds/SimpleQueryMaker.java          |    4 +-
 .../feeds/SimpleSloppyPhraseQueryMaker.java     |    4 +-
 .../benchmark/byTask/feeds/SingleDocSource.java |    8 +-
 .../byTask/feeds/SortableSingleDocSource.java   |    4 +-
 .../benchmark/byTask/feeds/SpatialDocMaker.java |    4 +-
 .../byTask/feeds/SpatialFileQueryMaker.java     |    4 +-
 .../byTask/feeds/TrecContentSource.java         |    4 +-
 .../benchmark/byTask/feeds/TrecDocParser.java   |    4 +-
 .../benchmark/byTask/feeds/TrecFBISParser.java  |    4 +-
 .../benchmark/byTask/feeds/TrecFR94Parser.java  |    4 +-
 .../benchmark/byTask/feeds/TrecFTParser.java    |    4 +-
 .../benchmark/byTask/feeds/TrecGov2Parser.java  |    4 +-
 .../byTask/feeds/TrecLATimesParser.java         |    4 +-
 .../byTask/feeds/TrecParserByPath.java          |    4 +-
 .../benchmark/byTask/programmatic/Sample.java   |   15 +-
 .../lucene/benchmark/byTask/stats/Points.java   |    4 +-
 .../lucene/benchmark/byTask/stats/Report.java   |    4 +-
 .../benchmark/byTask/stats/TaskStats.java       |    4 +-
 .../benchmark/byTask/tasks/AddDocTask.java      |    4 +-
 .../byTask/tasks/AddFacetedDocTask.java         |    4 +-
 .../benchmark/byTask/tasks/AddIndexesTask.java  |    4 +-
 .../byTask/tasks/AnalyzerFactoryTask.java       |    4 +-
 .../byTask/tasks/BenchmarkHighlighter.java      |    4 +-
 .../benchmark/byTask/tasks/ClearStatsTask.java  |    8 +-
 .../benchmark/byTask/tasks/CloseIndexTask.java  |    4 +-
 .../benchmark/byTask/tasks/CloseReaderTask.java |    4 +-
 .../byTask/tasks/CloseTaxonomyIndexTask.java    |    4 +-
 .../byTask/tasks/CloseTaxonomyReaderTask.java   |    4 +-
 .../benchmark/byTask/tasks/CommitIndexTask.java |    4 +-
 .../byTask/tasks/CommitTaxonomyIndexTask.java   |    2 +-
 .../byTask/tasks/ConsumeContentSourceTask.java  |    4 +-
 .../benchmark/byTask/tasks/CreateIndexTask.java |    4 +-
 .../byTask/tasks/CreateTaxonomyIndexTask.java   |    4 +-
 .../benchmark/byTask/tasks/ForceMergeTask.java  |    4 +-
 .../byTask/tasks/NearRealtimeReaderTask.java    |    4 +-
 .../benchmark/byTask/tasks/NewAnalyzerTask.java |   13 +-
 .../byTask/tasks/NewCollationAnalyzerTask.java  |    4 +-
 .../benchmark/byTask/tasks/NewLocaleTask.java   |    4 +-
 .../benchmark/byTask/tasks/NewRoundTask.java    |    8 +-
 .../benchmark/byTask/tasks/OpenIndexTask.java   |    4 +-
 .../benchmark/byTask/tasks/OpenReaderTask.java  |    4 +-
 .../byTask/tasks/OpenTaxonomyIndexTask.java     |    4 +-
 .../byTask/tasks/OpenTaxonomyReaderTask.java    |    4 +-
 .../lucene/benchmark/byTask/tasks/PerfTask.java |    4 +-
 .../benchmark/byTask/tasks/PrintReaderTask.java |    4 +-
 .../lucene/benchmark/byTask/tasks/ReadTask.java |    4 +-
 .../benchmark/byTask/tasks/ReadTokensTask.java  |    4 +-
 .../byTask/tasks/ReopenReaderTask.java          |    2 +-
 .../benchmark/byTask/tasks/RepAllTask.java      |    4 +-
 .../byTask/tasks/RepSelectByPrefTask.java       |    4 +-
 .../byTask/tasks/RepSumByNameRoundTask.java     |    4 +-
 .../byTask/tasks/RepSumByNameTask.java          |    4 +-
 .../byTask/tasks/RepSumByPrefRoundTask.java     |    4 +-
 .../byTask/tasks/RepSumByPrefTask.java          |    4 +-
 .../benchmark/byTask/tasks/ReportTask.java      |   18 +-
 .../benchmark/byTask/tasks/ResetInputsTask.java |    8 +-
 .../byTask/tasks/ResetSystemEraseTask.java      |    8 +-
 .../byTask/tasks/ResetSystemSoftTask.java       |    8 +-
 .../byTask/tasks/RollbackIndexTask.java         |    4 +-
 .../benchmark/byTask/tasks/SearchTask.java      |    4 +-
 .../tasks/SearchTravRetHighlightTask.java       |    4 +-
 .../SearchTravRetLoadFieldSelectorTask.java     |   14 +-
 .../byTask/tasks/SearchTravRetTask.java         |    4 +-
 .../tasks/SearchTravRetVectorHighlightTask.java |    4 +-
 .../benchmark/byTask/tasks/SearchTravTask.java  |    4 +-
 .../byTask/tasks/SearchWithCollectorTask.java   |    2 +-
 .../byTask/tasks/SearchWithSortTask.java        |    2 +-
 .../benchmark/byTask/tasks/SetPropTask.java     |    8 +-
 .../benchmark/byTask/tasks/TaskSequence.java    |    4 +-
 .../benchmark/byTask/tasks/UpdateDocTask.java   |    4 +-
 .../lucene/benchmark/byTask/tasks/WaitTask.java |    4 +-
 .../lucene/benchmark/byTask/tasks/WarmTask.java |    4 +-
 .../byTask/tasks/WriteEnwikiLineDocTask.java    |   32 +-
 .../byTask/tasks/WriteLineDocTask.java          |    4 +-
 .../benchmark/byTask/utils/Algorithm.java       |    4 +-
 .../benchmark/byTask/utils/AnalyzerFactory.java |    4 +-
 .../lucene/benchmark/byTask/utils/Config.java   |    4 +-
 .../lucene/benchmark/byTask/utils/Format.java   |    4 +-
 .../benchmark/byTask/utils/StreamUtils.java     |    4 +-
 .../benchmark/quality/trec/QueryDriver.java     |    4 +-
 .../lucene/benchmark/utils/ExtractReuters.java  |   15 +-
 .../benchmark/utils/ExtractWikipedia.java       |    4 +-
 lucene/benchmark/src/test/conf/ConfLoader.java  |    3 +-
 .../lucene/benchmark/BenchmarkTestCase.java     |    4 +-
 .../benchmark/byTask/TestPerfTasksLogic.java    |   13 +-
 .../benchmark/byTask/TestPerfTasksParse.java    |    1 -
 .../benchmark/byTask/feeds/DocMakerTest.java    |    4 +-
 .../byTask/feeds/EnwikiContentSourceTest.java   |   11 +-
 .../byTask/feeds/LineDocSourceTest.java         |   11 +-
 .../benchmark/byTask/feeds/TestHtmlParser.java  |    4 +-
 .../byTask/feeds/TrecContentSourceTest.java     |   12 +-
 .../byTask/tasks/AddIndexesTaskTest.java        |    4 +-
 .../byTask/tasks/CommitIndexTaskTest.java       |    4 +-
 .../tasks/CountingHighlighterTestTask.java      |    1 -
 .../byTask/tasks/CountingSearchTestTask.java    |    1 -
 .../byTask/tasks/CreateIndexTaskTest.java       |    4 +-
 .../benchmark/byTask/tasks/PerfTaskTest.java    |    4 +-
 .../byTask/tasks/SearchWithSortTaskTest.java    |    4 +-
 .../tasks/WriteEnwikiLineDocTaskTest.java       |    4 +-
 .../byTask/tasks/WriteLineDocTaskTest.java      |    4 +-
 .../byTask/tasks/alt/AltPackageTaskTest.java    |   11 +-
 .../benchmark/byTask/tasks/alt/AltTestTask.java |    4 +-
 .../benchmark/byTask/utils/StreamUtilsTest.java |   18 +-
 .../benchmark/byTask/utils/TestConfig.java      |    4 +-
 .../benchmark/quality/TestQualityRun.java       |    4 +-
 .../CachingNaiveBayesClassifier.java            |   32 +-
 .../document/DocumentClassifier.java            |    4 +-
 .../KNearestNeighborDocumentClassifier.java     |    4 +-
 .../SimpleNaiveBayesDocumentClassifier.java     |    4 +-
 .../utils/ConfusionMatrixGenerator.java         |    4 +-
 .../classification/utils/DatasetSplitter.java   |    4 +-
 .../CachingNaiveBayesClassifierTest.java        |    4 +-
 .../DocumentClassificationTestBase.java         |    4 +-
 .../KNearestNeighborDocumentClassifierTest.java |    4 +-
 .../SimpleNaiveBayesDocumentClassifierTest.java |    4 +-
 .../utils/ConfusionMatrixGeneratorTest.java     |    4 +-
 .../classification/utils/DataSplitterTest.java  |    4 +-
 .../autoprefix/AutoPrefixPostingsFormat.java    |    4 +-
 .../codecs/blockterms/BlockTermsReader.java     |    4 +-
 .../codecs/blockterms/BlockTermsWriter.java     |    4 +-
 .../blockterms/FixedGapTermsIndexReader.java    |    4 +-
 .../blockterms/FixedGapTermsIndexWriter.java    |    4 +-
 .../codecs/blockterms/TermsIndexReaderBase.java |    4 +-
 .../codecs/blockterms/TermsIndexWriterBase.java |    4 +-
 .../blockterms/VariableGapTermsIndexReader.java |    4 +-
 .../blockterms/VariableGapTermsIndexWriter.java |    4 +-
 .../BlockTreeOrdsPostingsFormat.java            |    4 +-
 .../codecs/blocktreeords/FSTOrdsOutputs.java    |    6 +-
 .../blocktreeords/OrdsBlockTreeTermsReader.java |    4 +-
 .../blocktreeords/OrdsBlockTreeTermsWriter.java |    4 +-
 .../codecs/blocktreeords/OrdsFieldReader.java   |    4 +-
 .../blocktreeords/OrdsIntersectTermsEnum.java   |    4 +-
 .../OrdsIntersectTermsEnumFrame.java            |    4 +-
 .../blocktreeords/OrdsSegmentTermsEnum.java     |    4 +-
 .../OrdsSegmentTermsEnumFrame.java              |    4 +-
 .../lucene/codecs/bloom/BloomFilterFactory.java |    2 +-
 .../bloom/BloomFilteringPostingsFormat.java     |    7 +-
 .../codecs/bloom/DefaultBloomFilterFactory.java |    2 +-
 .../apache/lucene/codecs/bloom/FuzzySet.java    |    4 +-
 .../lucene/codecs/bloom/HashFunction.java       |    2 +-
 .../apache/lucene/codecs/bloom/MurmurHash2.java |    2 +-
 .../codecs/memory/DirectDocValuesConsumer.java  |    4 +-
 .../codecs/memory/DirectDocValuesFormat.java    |    4 +-
 .../codecs/memory/DirectDocValuesProducer.java  |    4 +-
 .../codecs/memory/DirectPostingsFormat.java     |    5 +-
 .../codecs/memory/FSTOrdPostingsFormat.java     |    6 +-
 .../lucene/codecs/memory/FSTOrdTermsReader.java |    4 +-
 .../lucene/codecs/memory/FSTOrdTermsWriter.java |    4 +-
 .../lucene/codecs/memory/FSTPostingsFormat.java |    6 +-
 .../lucene/codecs/memory/FSTTermOutputs.java    |    4 +-
 .../lucene/codecs/memory/FSTTermsReader.java    |    4 +-
 .../lucene/codecs/memory/FSTTermsWriter.java    |    4 +-
 .../codecs/memory/MemoryDocValuesConsumer.java  |    4 +-
 .../codecs/memory/MemoryDocValuesFormat.java    |    4 +-
 .../codecs/memory/MemoryDocValuesProducer.java  |    4 +-
 .../codecs/memory/MemoryPostingsFormat.java     |    7 +-
 .../codecs/simpletext/SimpleTextBKDReader.java  |    4 +-
 .../codecs/simpletext/SimpleTextCodec.java      |    4 +-
 .../simpletext/SimpleTextCompoundFormat.java    |    4 +-
 .../simpletext/SimpleTextDocValuesFormat.java   |    4 +-
 .../simpletext/SimpleTextDocValuesReader.java   |    4 +-
 .../simpletext/SimpleTextDocValuesWriter.java   |    4 +-
 .../simpletext/SimpleTextFieldInfosFormat.java  |    4 +-
 .../simpletext/SimpleTextFieldsReader.java      |    4 +-
 .../simpletext/SimpleTextFieldsWriter.java      |    4 +-
 .../simpletext/SimpleTextLiveDocsFormat.java    |    4 +-
 .../simpletext/SimpleTextNormsFormat.java       |    4 +-
 .../simpletext/SimpleTextPointFormat.java       |    4 +-
 .../simpletext/SimpleTextPointReader.java       |   28 +-
 .../simpletext/SimpleTextPointWriter.java       |   47 +-
 .../simpletext/SimpleTextPostingsFormat.java    |    4 +-
 .../simpletext/SimpleTextSegmentInfoFormat.java |    4 +-
 .../SimpleTextStoredFieldsFormat.java           |    4 +-
 .../SimpleTextStoredFieldsReader.java           |    4 +-
 .../SimpleTextStoredFieldsWriter.java           |    4 +-
 .../simpletext/SimpleTextTermVectorsFormat.java |    4 +-
 .../simpletext/SimpleTextTermVectorsReader.java |    4 +-
 .../simpletext/SimpleTextTermVectorsWriter.java |    4 +-
 .../codecs/simpletext/SimpleTextUtil.java       |    4 +-
 .../TestAutoPrefixPostingsFormat.java           |    4 +-
 .../codecs/autoprefix/TestAutoPrefixTerms.java  |   27 +-
 .../blockterms/TestFixedGapPostingsFormat.java  |    4 +-
 ...TestVarGapDocFreqIntervalPostingsFormat.java |    4 +-
 .../TestVarGapFixedIntervalPostingsFormat.java  |    4 +-
 .../codecs/blocktreeords/TestOrdsBlockTree.java |    4 +-
 .../codecs/bloom/TestBloomPostingsFormat.java   |    4 +-
 .../memory/TestDirectDocValuesFormat.java       |    4 +-
 .../codecs/memory/TestDirectPostingsFormat.java |    4 +-
 .../codecs/memory/TestFSTOrdPostingsFormat.java |    4 +-
 .../codecs/memory/TestFSTPostingsFormat.java    |    4 +-
 .../memory/TestMemoryDocValuesFormat.java       |    4 +-
 .../codecs/memory/TestMemoryPostingsFormat.java |    4 +-
 .../TestSimpleTextCompoundFormat.java           |    4 +-
 .../TestSimpleTextDocValuesFormat.java          |    4 +-
 .../TestSimpleTextFieldInfoFormat.java          |    4 +-
 .../simpletext/TestSimpleTextNormsFormat.java   |    4 +-
 .../simpletext/TestSimpleTextPointFormat.java   |   33 +
 .../TestSimpleTextPostingsFormat.java           |    4 +-
 .../TestSimpleTextSegmentInfoFormat.java        |    4 +-
 .../TestSimpleTextStoredFieldsFormat.java       |    4 +-
 .../TestSimpleTextTermVectorsFormat.java        |    4 +-
 lucene/common-build.xml                         |   35 +-
 .../java/org/apache/lucene/LucenePackage.java   |    4 +-
 .../org/apache/lucene/analysis/Analyzer.java    |    4 +-
 .../apache/lucene/analysis/AnalyzerWrapper.java |    4 +-
 .../lucene/analysis/CachingTokenFilter.java     |    4 +-
 .../org/apache/lucene/analysis/CharFilter.java  |    4 +-
 .../analysis/DelegatingAnalyzerWrapper.java     |    8 +-
 .../analysis/LegacyNumericTokenStream.java      |    8 +-
 .../lucene/analysis/ReusableStringReader.java   |    8 +-
 .../java/org/apache/lucene/analysis/Token.java  |    4 +-
 .../org/apache/lucene/analysis/TokenFilter.java |    4 +-
 .../org/apache/lucene/analysis/TokenStream.java |    4 +-
 .../lucene/analysis/TokenStreamToAutomaton.java |    4 +-
 .../org/apache/lucene/analysis/Tokenizer.java   |    4 +-
 .../tokenattributes/BytesTermAttribute.java     |    4 +-
 .../tokenattributes/BytesTermAttributeImpl.java |    4 +-
 .../tokenattributes/CharTermAttribute.java      |    4 +-
 .../tokenattributes/CharTermAttributeImpl.java  |   10 +-
 .../tokenattributes/FlagsAttribute.java         |    4 +-
 .../tokenattributes/FlagsAttributeImpl.java     |    4 +-
 .../tokenattributes/KeywordAttribute.java       |    4 +-
 .../tokenattributes/KeywordAttributeImpl.java   |    4 +-
 .../tokenattributes/OffsetAttribute.java        |    4 +-
 .../tokenattributes/OffsetAttributeImpl.java    |    4 +-
 .../PackedTokenAttributeImpl.java               |    4 +-
 .../tokenattributes/PayloadAttribute.java       |    4 +-
 .../tokenattributes/PayloadAttributeImpl.java   |    4 +-
 .../PositionIncrementAttribute.java             |    4 +-
 .../PositionIncrementAttributeImpl.java         |    4 +-
 .../PositionLengthAttribute.java                |    4 +-
 .../PositionLengthAttributeImpl.java            |    4 +-
 .../TermToBytesRefAttribute.java                |    4 +-
 .../analysis/tokenattributes/TypeAttribute.java |    4 +-
 .../tokenattributes/TypeAttributeImpl.java      |    4 +-
 .../apache/lucene/codecs/BlockTermState.java    |    2 +-
 .../java/org/apache/lucene/codecs/Codec.java    |    4 +-
 .../org/apache/lucene/codecs/CodecUtil.java     |   36 +-
 .../apache/lucene/codecs/CompoundFormat.java    |    4 +-
 .../apache/lucene/codecs/DocValuesConsumer.java |    4 +-
 .../apache/lucene/codecs/DocValuesFormat.java   |    4 +-
 .../apache/lucene/codecs/DocValuesProducer.java |    4 +-
 .../apache/lucene/codecs/FieldInfosFormat.java  |    4 +-
 .../apache/lucene/codecs/FieldsConsumer.java    |    4 +-
 .../apache/lucene/codecs/FieldsProducer.java    |    4 +-
 .../org/apache/lucene/codecs/FilterCodec.java   |    4 +-
 .../apache/lucene/codecs/LiveDocsFormat.java    |    4 +-
 .../lucene/codecs/MultiLevelSkipListReader.java |    4 +-
 .../lucene/codecs/MultiLevelSkipListWriter.java |    4 +-
 .../org/apache/lucene/codecs/NormsConsumer.java |    4 +-
 .../org/apache/lucene/codecs/NormsFormat.java   |    4 +-
 .../org/apache/lucene/codecs/NormsProducer.java |   18 +-
 .../org/apache/lucene/codecs/PointFormat.java   |    4 +-
 .../org/apache/lucene/codecs/PointReader.java   |    4 +-
 .../org/apache/lucene/codecs/PointWriter.java   |   10 +-
 .../apache/lucene/codecs/PostingsFormat.java    |    4 +-
 .../lucene/codecs/PostingsReaderBase.java       |    4 +-
 .../lucene/codecs/PostingsWriterBase.java       |    4 +-
 .../lucene/codecs/PushPostingsWriterBase.java   |    4 +-
 .../apache/lucene/codecs/SegmentInfoFormat.java |    4 +-
 .../lucene/codecs/StoredFieldsFormat.java       |    4 +-
 .../lucene/codecs/StoredFieldsReader.java       |   24 +-
 .../lucene/codecs/StoredFieldsWriter.java       |   24 +-
 .../org/apache/lucene/codecs/TermStats.java     |    4 +-
 .../apache/lucene/codecs/TermVectorsFormat.java |    4 +-
 .../apache/lucene/codecs/TermVectorsReader.java |    4 +-
 .../apache/lucene/codecs/TermVectorsWriter.java |    4 +-
 .../codecs/blocktree/AutoPrefixTermsWriter.java |    4 +-
 .../codecs/blocktree/BitSetPostingsEnum.java    |    4 +-
 .../codecs/blocktree/BitSetTermsEnum.java       |    4 +-
 .../codecs/blocktree/BlockTreeTermsReader.java  |    4 +-
 .../codecs/blocktree/BlockTreeTermsWriter.java  |    4 +-
 .../lucene/codecs/blocktree/FieldReader.java    |    4 +-
 .../codecs/blocktree/IntersectTermsEnum.java    |    4 +-
 .../blocktree/IntersectTermsEnumFrame.java      |    4 +-
 .../codecs/blocktree/SegmentTermsEnum.java      |    4 +-
 .../codecs/blocktree/SegmentTermsEnumFrame.java |    4 +-
 .../apache/lucene/codecs/blocktree/Stats.java   |    4 +-
 .../CompressingStoredFieldsFormat.java          |    4 +-
 .../CompressingStoredFieldsIndexReader.java     |    4 +-
 .../CompressingStoredFieldsIndexWriter.java     |    4 +-
 .../CompressingStoredFieldsReader.java          |    4 +-
 .../CompressingStoredFieldsWriter.java          |    4 +-
 .../CompressingTermVectorsFormat.java           |    4 +-
 .../CompressingTermVectorsReader.java           |    4 +-
 .../CompressingTermVectorsWriter.java           |    4 +-
 .../codecs/compressing/CompressionMode.java     |    4 +-
 .../lucene/codecs/compressing/Compressor.java   |    4 +-
 .../lucene/codecs/compressing/Decompressor.java |    4 +-
 .../GrowableByteArrayDataOutput.java            |    4 +-
 .../apache/lucene/codecs/compressing/LZ4.java   |    4 +-
 .../codecs/compressing/MatchingReaders.java     |    4 +-
 .../apache/lucene/codecs/lucene50/ForUtil.java  |    2 +-
 .../codecs/lucene50/Lucene50CompoundFormat.java |    4 +-
 .../codecs/lucene50/Lucene50CompoundReader.java |   32 +-
 .../lucene50/Lucene50FieldInfosFormat.java      |    4 +-
 .../codecs/lucene50/Lucene50LiveDocsFormat.java |    4 +-
 .../codecs/lucene50/Lucene50PostingsFormat.java |    6 +-
 .../codecs/lucene50/Lucene50PostingsReader.java |    4 +-
 .../codecs/lucene50/Lucene50PostingsWriter.java |    4 +-
 .../lucene50/Lucene50SegmentInfoFormat.java     |    4 +-
 .../codecs/lucene50/Lucene50SkipReader.java     |    4 +-
 .../codecs/lucene50/Lucene50SkipWriter.java     |    4 +-
 .../lucene50/Lucene50StoredFieldsFormat.java    |    4 +-
 .../lucene50/Lucene50TermVectorsFormat.java     |    4 +-
 .../codecs/lucene53/Lucene53NormsConsumer.java  |    4 +-
 .../codecs/lucene53/Lucene53NormsFormat.java    |    4 +-
 .../codecs/lucene53/Lucene53NormsProducer.java  |    4 +-
 .../lucene54/Lucene54DocValuesConsumer.java     |    4 +-
 .../lucene54/Lucene54DocValuesFormat.java       |    4 +-
 .../lucene54/Lucene54DocValuesProducer.java     |    5 +-
 .../lucene/codecs/lucene60/Lucene60Codec.java   |    4 +-
 .../lucene60/Lucene60FieldInfosFormat.java      |    4 +-
 .../codecs/lucene60/Lucene60PointFormat.java    |   11 +-
 .../codecs/lucene60/Lucene60PointReader.java    |   68 +-
 .../codecs/lucene60/Lucene60PointWriter.java    |   91 +-
 .../perfield/PerFieldDocValuesFormat.java       |    7 +-
 .../codecs/perfield/PerFieldPostingsFormat.java |    4 +-
 .../lucene/document/BinaryDocValuesField.java   |    4 +-
 .../org/apache/lucene/document/BinaryPoint.java |    6 +-
 .../lucene/document/CompressionTools.java       |    4 +-
 .../org/apache/lucene/document/DateTools.java   |    4 +-
 .../org/apache/lucene/document/Document.java    |    4 +-
 .../document/DocumentStoredFieldVisitor.java    |    4 +-
 .../lucene/document/DoubleDocValuesField.java   |    4 +-
 .../org/apache/lucene/document/DoublePoint.java |   48 +-
 .../java/org/apache/lucene/document/Field.java  |    4 +-
 .../org/apache/lucene/document/FieldType.java   |    4 +-
 .../lucene/document/FloatDocValuesField.java    |    4 +-
 .../org/apache/lucene/document/FloatPoint.java  |   48 +-
 .../org/apache/lucene/document/IntPoint.java    |   48 +-
 .../lucene/document/LegacyDoubleField.java      |    4 +-
 .../lucene/document/LegacyFloatField.java       |    4 +-
 .../apache/lucene/document/LegacyIntField.java  |    4 +-
 .../apache/lucene/document/LegacyLongField.java |    4 +-
 .../org/apache/lucene/document/LongPoint.java   |   48 +-
 .../lucene/document/NumericDocValuesField.java  |    4 +-
 .../lucene/document/SortedDocValuesField.java   |    4 +-
 .../document/SortedNumericDocValuesField.java   |    4 +-
 .../document/SortedSetDocValuesField.java       |    4 +-
 .../org/apache/lucene/document/StoredField.java |    4 +-
 .../org/apache/lucene/document/StringField.java |    4 +-
 .../org/apache/lucene/document/TextField.java   |    4 +-
 .../apache/lucene/index/AbortingException.java  |    4 +-
 .../apache/lucene/index/AutomatonTermsEnum.java |    4 +-
 .../lucene/index/BaseCompositeReader.java       |    4 +-
 .../apache/lucene/index/BinaryDocValues.java    |    4 +-
 .../index/BinaryDocValuesFieldUpdates.java      |    4 +-
 .../lucene/index/BinaryDocValuesWriter.java     |    4 +-
 .../java/org/apache/lucene/index/BitsSlice.java |    8 +-
 .../apache/lucene/index/BufferedUpdates.java    |   20 +-
 .../lucene/index/BufferedUpdatesStream.java     |    4 +-
 .../apache/lucene/index/ByteSliceReader.java    |    4 +-
 .../apache/lucene/index/ByteSliceWriter.java    |   10 +-
 .../org/apache/lucene/index/CheckIndex.java     |    4 +-
 .../apache/lucene/index/CoalescedUpdates.java   |    4 +-
 .../org/apache/lucene/index/CodecReader.java    |    4 +-
 .../apache/lucene/index/CompositeReader.java    |    4 +-
 .../lucene/index/CompositeReaderContext.java    |    4 +-
 .../lucene/index/ConcurrentMergeScheduler.java  |   10 +-
 .../lucene/index/CorruptIndexException.java     |    4 +-
 .../lucene/index/DefaultIndexingChain.java      |   33 +-
 .../apache/lucene/index/DirectoryReader.java    |   13 +-
 .../org/apache/lucene/index/DocConsumer.java    |    4 +-
 .../java/org/apache/lucene/index/DocValues.java |    4 +-
 .../lucene/index/DocValuesFieldUpdates.java     |    4 +-
 .../org/apache/lucene/index/DocValuesType.java  |    4 +-
 .../apache/lucene/index/DocValuesUpdate.java    |   16 +-
 .../apache/lucene/index/DocValuesWriter.java    |    4 +-
 .../apache/lucene/index/DocumentsWriter.java    |    4 +-
 .../index/DocumentsWriterDeleteQueue.java       |   27 +-
 .../index/DocumentsWriterFlushControl.java      |   10 +-
 .../lucene/index/DocumentsWriterFlushQueue.java |   28 +-
 .../lucene/index/DocumentsWriterPerThread.java  |   15 +-
 .../index/DocumentsWriterPerThreadPool.java     |    8 +-
 .../index/DocumentsWriterStallControl.java      |   10 +-
 .../lucene/index/ExitableDirectoryReader.java   |    4 +-
 .../java/org/apache/lucene/index/FieldInfo.java |    4 +-
 .../org/apache/lucene/index/FieldInfos.java     |    4 +-
 .../apache/lucene/index/FieldTermIterator.java  |    4 +-
 .../java/org/apache/lucene/index/Fields.java    |    4 +-
 .../apache/lucene/index/FilterCodecReader.java  |    4 +-
 .../lucene/index/FilterDirectoryReader.java     |    4 +-
 .../apache/lucene/index/FilterLeafReader.java   |    4 +-
 .../apache/lucene/index/FilteredTermsEnum.java  |    4 +-
 .../lucene/index/FlushByRamOrCountsPolicy.java  |   10 +-
 .../org/apache/lucene/index/FlushPolicy.java    |   10 +-
 .../org/apache/lucene/index/FreqProxFields.java |    4 +-
 .../lucene/index/FreqProxTermsWriter.java       |    4 +-
 .../index/FreqProxTermsWriterPerField.java      |   12 +-
 .../lucene/index/FrozenBufferedUpdates.java     |    5 +-
 .../org/apache/lucene/index/IndexCommit.java    |    5 +-
 .../lucene/index/IndexDeletionPolicy.java       |    4 +-
 .../apache/lucene/index/IndexFileDeleter.java   |  153 +--
 .../org/apache/lucene/index/IndexFileNames.java |    4 +-
 .../index/IndexFormatTooNewException.java       |    1 -
 .../index/IndexFormatTooOldException.java       |    1 -
 .../lucene/index/IndexNotFoundException.java    |    4 +-
 .../org/apache/lucene/index/IndexOptions.java   |    4 +-
 .../org/apache/lucene/index/IndexReader.java    |    8 +-
 .../apache/lucene/index/IndexReaderContext.java |    4 +-
 .../org/apache/lucene/index/IndexUpgrader.java  |    4 +-
 .../org/apache/lucene/index/IndexWriter.java    |   79 +-
 .../apache/lucene/index/IndexWriterConfig.java  |    4 +-
 .../org/apache/lucene/index/IndexableField.java |    4 +-
 .../apache/lucene/index/IndexableFieldType.java |    4 +-
 .../index/KeepOnlyLastCommitDeletionPolicy.java |    4 +-
 .../org/apache/lucene/index/LeafReader.java     |    4 +-
 .../apache/lucene/index/LeafReaderContext.java  |    4 +-
 .../lucene/index/LiveIndexWriterConfig.java     |    4 +-
 .../lucene/index/LogByteSizeMergePolicy.java    |    4 +-
 .../apache/lucene/index/LogDocMergePolicy.java  |    8 +-
 .../org/apache/lucene/index/LogMergePolicy.java |    4 +-
 .../apache/lucene/index/MappedMultiFields.java  |    4 +-
 .../lucene/index/MappingMultiPostingsEnum.java  |    4 +-
 .../org/apache/lucene/index/MergePolicy.java    |   10 +-
 .../apache/lucene/index/MergePolicyWrapper.java |   89 ++
 .../apache/lucene/index/MergeRateLimiter.java   |    4 +-
 .../org/apache/lucene/index/MergeScheduler.java |    4 +-
 .../org/apache/lucene/index/MergeState.java     |    4 +-
 .../org/apache/lucene/index/MergeTrigger.java   |    4 +-
 .../index/MergedPrefixCodedTermsIterator.java   |    4 +-
 .../java/org/apache/lucene/index/MultiBits.java |    8 +-
 .../org/apache/lucene/index/MultiDocValues.java |    4 +-
 .../org/apache/lucene/index/MultiFields.java    |    4 +-
 .../apache/lucene/index/MultiPointValues.java   |    8 +-
 .../apache/lucene/index/MultiPostingsEnum.java  |    4 +-
 .../org/apache/lucene/index/MultiReader.java    |    4 +-
 .../org/apache/lucene/index/MultiTerms.java     |    4 +-
 .../org/apache/lucene/index/MultiTermsEnum.java |    4 +-
 .../apache/lucene/index/NoDeletionPolicy.java   |    4 +-
 .../org/apache/lucene/index/NoMergePolicy.java  |   22 +-
 .../apache/lucene/index/NoMergeScheduler.java   |    4 +-
 .../apache/lucene/index/NormValuesWriter.java   |    4 +-
 .../apache/lucene/index/NumericDocValues.java   |    4 +-
 .../index/NumericDocValuesFieldUpdates.java     |   18 +-
 .../lucene/index/NumericDocValuesWriter.java    |    4 +-
 .../org/apache/lucene/index/OrdTermState.java   |    4 +-
 .../lucene/index/ParallelCompositeReader.java   |    4 +-
 .../apache/lucene/index/ParallelLeafReader.java |    4 +-
 .../lucene/index/ParallelPostingsArray.java     |    6 +-
 .../index/PersistentSnapshotDeletionPolicy.java |   29 +-
 .../org/apache/lucene/index/PointValues.java    |   32 +-
 .../apache/lucene/index/PointValuesWriter.java  |    8 +-
 .../org/apache/lucene/index/PostingsEnum.java   |    4 +-
 .../apache/lucene/index/PrefixCodedTerms.java   |   27 +-
 .../org/apache/lucene/index/QueryTimeout.java   |    4 +-
 .../apache/lucene/index/QueryTimeoutImpl.java   |    4 +-
 .../apache/lucene/index/RandomAccessOrds.java   |    4 +-
 .../org/apache/lucene/index/ReaderManager.java  |   12 +-
 .../org/apache/lucene/index/ReaderSlice.java    |    4 +-
 .../org/apache/lucene/index/ReaderUtil.java     |    4 +-
 .../apache/lucene/index/ReadersAndUpdates.java  |    4 +-
 .../apache/lucene/index/SegmentCommitInfo.java  |    4 +-
 .../apache/lucene/index/SegmentCoreReaders.java |    8 +-
 .../apache/lucene/index/SegmentDocValues.java   |    4 +-
 .../lucene/index/SegmentDocValuesProducer.java  |    4 +-
 .../org/apache/lucene/index/SegmentInfo.java    |    4 +-
 .../org/apache/lucene/index/SegmentInfos.java   |  381 +++---
 .../org/apache/lucene/index/SegmentMerger.java  |    4 +-
 .../apache/lucene/index/SegmentReadState.java   |    4 +-
 .../org/apache/lucene/index/SegmentReader.java  |    4 +-
 .../apache/lucene/index/SegmentWriteState.java  |    4 +-
 .../lucene/index/SerialMergeScheduler.java      |    4 +-
 .../lucene/index/SimpleMergedSegmentWarmer.java |    4 +-
 .../apache/lucene/index/SingleTermsEnum.java    |    4 +-
 .../index/SingletonSortedNumericDocValues.java  |    4 +-
 .../index/SingletonSortedSetDocValues.java      |    4 +-
 .../lucene/index/SlowCodecReaderWrapper.java    |    4 +-
 .../index/SlowCompositeReaderWrapper.java       |    4 +-
 .../lucene/index/SnapshotDeletionPolicy.java    |    4 +-
 .../apache/lucene/index/SortedDocValues.java    |    4 +-
 .../lucene/index/SortedDocValuesTermsEnum.java  |    4 +-
 .../lucene/index/SortedDocValuesWriter.java     |    6 +-
 .../lucene/index/SortedNumericDocValues.java    |    4 +-
 .../index/SortedNumericDocValuesWriter.java     |    4 +-
 .../apache/lucene/index/SortedSetDocValues.java |    4 +-
 .../index/SortedSetDocValuesTermsEnum.java      |    4 +-
 .../lucene/index/SortedSetDocValuesWriter.java  |    8 +-
 .../lucene/index/StandardDirectoryReader.java   |   38 +-
 .../apache/lucene/index/StoredFieldVisitor.java |    4 +-
 .../src/java/org/apache/lucene/index/Term.java  |    4 +-
 .../org/apache/lucene/index/TermContext.java    |    4 +-
 .../java/org/apache/lucene/index/TermState.java |    4 +-
 .../lucene/index/TermVectorsConsumer.java       |    4 +-
 .../index/TermVectorsConsumerPerField.java      |    5 +-
 .../src/java/org/apache/lucene/index/Terms.java |    4 +-
 .../java/org/apache/lucene/index/TermsEnum.java |    4 +-
 .../java/org/apache/lucene/index/TermsHash.java |    4 +-
 .../apache/lucene/index/TermsHashPerField.java  |    4 +-
 .../apache/lucene/index/TieredMergePolicy.java  |    8 +-
 .../lucene/index/TrackingIndexWriter.java       |    4 +-
 .../org/apache/lucene/index/TwoPhaseCommit.java |    8 +-
 .../apache/lucene/index/TwoPhaseCommitTool.java |    8 +-
 .../lucene/index/UpgradeIndexMergePolicy.java   |   34 +-
 .../apache/lucene/search/AutomatonQuery.java    |    4 +-
 .../apache/lucene/search/BlendedTermQuery.java  |    4 +-
 .../org/apache/lucene/search/BooleanClause.java |    4 +-
 .../org/apache/lucene/search/BooleanQuery.java  |    4 +-
 .../org/apache/lucene/search/BooleanScorer.java |    4 +-
 .../lucene/search/BooleanTopLevelScorers.java   |    4 +-
 .../org/apache/lucene/search/BooleanWeight.java |    4 +-
 .../apache/lucene/search/BoostAttribute.java    |    4 +-
 .../lucene/search/BoostAttributeImpl.java       |    4 +-
 .../org/apache/lucene/search/BoostQuery.java    |    4 +-
 .../org/apache/lucene/search/BulkScorer.java    |    4 +-
 .../apache/lucene/search/CachingCollector.java  |   10 +-
 .../lucene/search/CollectionStatistics.java     |   10 +-
 .../search/CollectionTerminatedException.java   |    4 +-
 .../org/apache/lucene/search/Collector.java     |    4 +-
 .../apache/lucene/search/CollectorManager.java  |    4 +-
 .../apache/lucene/search/ConjunctionDISI.java   |    4 +-
 .../apache/lucene/search/ConjunctionScorer.java |    4 +-
 .../lucene/search/ConstantScoreQuery.java       |    4 +-
 .../lucene/search/ConstantScoreScorer.java      |    4 +-
 .../lucene/search/ConstantScoreWeight.java      |    4 +-
 .../search/ControlledRealTimeReopenThread.java  |    4 +-
 .../apache/lucene/search/DisiPriorityQueue.java |    4 +-
 .../org/apache/lucene/search/DisiWrapper.java   |    4 +-
 .../search/DisjunctionDISIApproximation.java    |    2 +-
 .../lucene/search/DisjunctionMaxQuery.java      |   14 +-
 .../lucene/search/DisjunctionMaxScorer.java     |   14 +-
 .../apache/lucene/search/DisjunctionScorer.java |    4 +-
 .../lucene/search/DisjunctionSumScorer.java     |    4 +-
 .../java/org/apache/lucene/search/DocIdSet.java |    4 +-
 .../apache/lucene/search/DocIdSetIterator.java  |    4 +-
 .../apache/lucene/search/DocValuesDocIdSet.java |    2 +-
 .../lucene/search/DocValuesRewriteMethod.java   |    4 +-
 .../apache/lucene/search/ExactPhraseScorer.java |    4 +-
 .../apache/lucene/search/ExactPointQuery.java   |  153 ---
 .../org/apache/lucene/search/Explanation.java   |    4 +-
 .../org/apache/lucene/search/FakeScorer.java    |    4 +-
 .../apache/lucene/search/FieldComparator.java   |    4 +-
 .../lucene/search/FieldComparatorSource.java    |    4 +-
 .../java/org/apache/lucene/search/FieldDoc.java |    4 +-
 .../lucene/search/FieldValueHitQueue.java       |    4 +-
 .../apache/lucene/search/FieldValueQuery.java   |    4 +-
 .../apache/lucene/search/FilterCollector.java   |   12 +-
 .../lucene/search/FilterLeafCollector.java      |    4 +-
 .../org/apache/lucene/search/FilterScorer.java  |    4 +-
 .../lucene/search/FilteredDocIdSetIterator.java |    4 +-
 .../org/apache/lucene/search/FuzzyQuery.java    |    4 +-
 .../apache/lucene/search/FuzzyTermsEnum.java    |    4 +-
 .../java/org/apache/lucene/search/HitQueue.java |    4 +-
 .../org/apache/lucene/search/IndexSearcher.java |    4 +-
 .../org/apache/lucene/search/LRUQueryCache.java |    4 +-
 .../org/apache/lucene/search/LeafCollector.java |    4 +-
 .../lucene/search/LeafFieldComparator.java      |    4 +-
 .../lucene/search/LegacyNumericRangeQuery.java  |    4 +-
 .../apache/lucene/search/LiveFieldValues.java   |    4 +-
 .../apache/lucene/search/MatchAllDocsQuery.java |    4 +-
 .../apache/lucene/search/MatchNoDocsQuery.java  |    4 +-
 .../search/MaxNonCompetitiveBoostAttribute.java |    4 +-
 .../MaxNonCompetitiveBoostAttributeImpl.java    |    4 +-
 .../lucene/search/MinShouldMatchSumScorer.java  |    4 +-
 .../apache/lucene/search/MultiCollector.java    |    7 +-
 .../apache/lucene/search/MultiPhraseQuery.java  |    4 +-
 .../apache/lucene/search/MultiTermQuery.java    |    4 +-
 .../MultiTermQueryConstantScoreWrapper.java     |    4 +-
 .../java/org/apache/lucene/search/Multiset.java |    4 +-
 .../apache/lucene/search/NGramPhraseQuery.java  |    4 +-
 .../apache/lucene/search/PhrasePositions.java   |    4 +-
 .../org/apache/lucene/search/PhraseQuery.java   |    4 +-
 .../org/apache/lucene/search/PhraseQueue.java   |    4 +-
 .../apache/lucene/search/PointRangeQuery.java   |  495 ++++++-
 .../search/PositiveScoresOnlyCollector.java     |    4 +-
 .../org/apache/lucene/search/PrefixQuery.java   |    4 +-
 .../java/org/apache/lucene/search/Query.java    |    4 +-
 .../org/apache/lucene/search/QueryCache.java    |    4 +-
 .../lucene/search/QueryCachingPolicy.java       |    4 +-
 .../org/apache/lucene/search/QueryRescorer.java |    4 +-
 .../lucene/search/RandomAccessWeight.java       |    4 +-
 .../apache/lucene/search/ReferenceManager.java  |    4 +-
 .../org/apache/lucene/search/RegexpQuery.java   |    4 +-
 .../apache/lucene/search/ReqExclBulkScorer.java |    4 +-
 .../org/apache/lucene/search/ReqExclScorer.java |    4 +-
 .../apache/lucene/search/ReqOptSumScorer.java   |    2 +-
 .../java/org/apache/lucene/search/Rescorer.java |    4 +-
 .../search/ScoreCachingWrappingScorer.java      |    4 +-
 .../java/org/apache/lucene/search/ScoreDoc.java |    4 +-
 .../java/org/apache/lucene/search/Scorer.java   |    4 +-
 .../apache/lucene/search/ScoringRewrite.java    |    5 +-
 .../apache/lucene/search/SearcherFactory.java   |    4 +-
 .../lucene/search/SearcherLifetimeManager.java  |    4 +-
 .../apache/lucene/search/SearcherManager.java   |   12 +-
 .../apache/lucene/search/SimpleCollector.java   |    4 +-
 .../lucene/search/SimpleFieldComparator.java    |    4 +-
 .../lucene/search/SloppyPhraseScorer.java       |    4 +-
 .../src/java/org/apache/lucene/search/Sort.java |    4 +-
 .../org/apache/lucene/search/SortField.java     |    4 +-
 .../org/apache/lucene/search/SortRescorer.java  |    4 +-
 .../lucene/search/SortedNumericSelector.java    |    4 +-
 .../lucene/search/SortedNumericSortField.java   |    4 +-
 .../apache/lucene/search/SortedSetSelector.java |    4 +-
 .../lucene/search/SortedSetSortField.java       |    4 +-
 .../org/apache/lucene/search/SynonymQuery.java  |    4 +-
 .../lucene/search/TermCollectingRewrite.java    |    4 +-
 .../org/apache/lucene/search/TermQuery.java     |    4 +-
 .../apache/lucene/search/TermRangeQuery.java    |    4 +-
 .../org/apache/lucene/search/TermScorer.java    |    4 +-
 .../apache/lucene/search/TermStatistics.java    |    4 +-
 .../lucene/search/TimeLimitingCollector.java    |    4 +-
 .../java/org/apache/lucene/search/TopDocs.java  |    4 +-
 .../apache/lucene/search/TopDocsCollector.java  |    4 +-
 .../apache/lucene/search/TopFieldCollector.java |    4 +-
 .../org/apache/lucene/search/TopFieldDocs.java  |    4 +-
 .../lucene/search/TopScoreDocCollector.java     |    4 +-
 .../apache/lucene/search/TopTermsRewrite.java   |    4 +-
 .../lucene/search/TotalHitCountCollector.java   |    4 +-
 .../apache/lucene/search/TwoPhaseIterator.java  |    4 +-
 .../search/UsageTrackingQueryCachingPolicy.java |    4 +-
 .../java/org/apache/lucene/search/Weight.java   |    4 +-
 .../org/apache/lucene/search/WildcardQuery.java |    4 +-
 .../lucene/search/similarities/AfterEffect.java |    4 +-
 .../search/similarities/AfterEffectB.java       |    4 +-
 .../search/similarities/AfterEffectL.java       |    4 +-
 .../search/similarities/BM25Similarity.java     |    4 +-
 .../lucene/search/similarities/BasicModel.java  |    4 +-
 .../search/similarities/BasicModelBE.java       |    4 +-
 .../lucene/search/similarities/BasicModelD.java |    4 +-
 .../lucene/search/similarities/BasicModelG.java |    4 +-
 .../search/similarities/BasicModelIF.java       |    4 +-
 .../search/similarities/BasicModelIn.java       |    4 +-
 .../search/similarities/BasicModelIne.java      |    4 +-
 .../lucene/search/similarities/BasicModelP.java |    4 +-
 .../lucene/search/similarities/BasicStats.java  |    4 +-
 .../search/similarities/ClassicSimilarity.java  |    4 +-
 .../search/similarities/DFISimilarity.java      |    4 +-
 .../search/similarities/DFRSimilarity.java      |    4 +-
 .../search/similarities/Distribution.java       |    4 +-
 .../search/similarities/DistributionLL.java     |    4 +-
 .../search/similarities/DistributionSPL.java    |    4 +-
 .../search/similarities/IBSimilarity.java       |    4 +-
 .../search/similarities/Independence.java       |    4 +-
 .../similarities/IndependenceChiSquared.java    |    4 +-
 .../similarities/IndependenceSaturated.java     |    4 +-
 .../similarities/IndependenceStandardized.java  |    4 +-
 .../similarities/LMDirichletSimilarity.java     |    4 +-
 .../similarities/LMJelinekMercerSimilarity.java |    4 +-
 .../search/similarities/LMSimilarity.java       |    4 +-
 .../lucene/search/similarities/Lambda.java      |    4 +-
 .../lucene/search/similarities/LambdaDF.java    |    4 +-
 .../lucene/search/similarities/LambdaTTF.java   |    4 +-
 .../search/similarities/MultiSimilarity.java    |    4 +-
 .../search/similarities/Normalization.java      |    4 +-
 .../search/similarities/NormalizationH1.java    |    4 +-
 .../search/similarities/NormalizationH2.java    |    4 +-
 .../search/similarities/NormalizationH3.java    |    4 +-
 .../search/similarities/NormalizationZ.java     |    4 +-
 .../similarities/PerFieldSimilarityWrapper.java |    4 +-
 .../lucene/search/similarities/Similarity.java  |    4 +-
 .../search/similarities/SimilarityBase.java     |    4 +-
 .../search/similarities/TFIDFSimilarity.java    |    4 +-
 .../lucene/search/spans/ConjunctionSpans.java   |    4 +-
 .../lucene/search/spans/ContainSpans.java       |    4 +-
 .../search/spans/FieldMaskingSpanQuery.java     |    4 +-
 .../apache/lucene/search/spans/FilterSpans.java |    4 +-
 .../lucene/search/spans/NearSpansOrdered.java   |    4 +-
 .../lucene/search/spans/NearSpansUnordered.java |    4 +-
 .../search/spans/ScoringWrapperSpans.java       |    4 +-
 .../lucene/search/spans/SpanBoostQuery.java     |    4 +-
 .../lucene/search/spans/SpanCollector.java      |    4 +-
 .../lucene/search/spans/SpanContainQuery.java   |    4 +-
 .../search/spans/SpanContainingQuery.java       |    4 +-
 .../lucene/search/spans/SpanFirstQuery.java     |    4 +-
 .../search/spans/SpanMultiTermQueryWrapper.java |    4 +-
 .../lucene/search/spans/SpanNearQuery.java      |    4 +-
 .../lucene/search/spans/SpanNotQuery.java       |    4 +-
 .../apache/lucene/search/spans/SpanOrQuery.java |    4 +-
 .../search/spans/SpanPositionCheckQuery.java    |    2 +-
 .../lucene/search/spans/SpanPositionQueue.java  |    4 +-
 .../search/spans/SpanPositionRangeQuery.java    |    2 +-
 .../apache/lucene/search/spans/SpanQuery.java   |    4 +-
 .../apache/lucene/search/spans/SpanScorer.java  |    4 +-
 .../lucene/search/spans/SpanTermQuery.java      |    4 +-
 .../apache/lucene/search/spans/SpanWeight.java  |    4 +-
 .../lucene/search/spans/SpanWithinQuery.java    |    4 +-
 .../org/apache/lucene/search/spans/Spans.java   |    4 +-
 .../apache/lucene/search/spans/TermSpans.java   |   14 +-
 .../lucene/store/AlreadyClosedException.java    |    4 +-
 .../org/apache/lucene/store/BaseDirectory.java  |    4 +-
 .../apache/lucene/store/BufferedChecksum.java   |    4 +-
 .../store/BufferedChecksumIndexInput.java       |    4 +-
 .../apache/lucene/store/BufferedIndexInput.java |    4 +-
 .../apache/lucene/store/ByteArrayDataInput.java |    4 +-
 .../lucene/store/ByteArrayDataOutput.java       |    4 +-
 .../lucene/store/ByteArrayIndexInput.java       |  163 +++
 .../lucene/store/ByteBufferIndexInput.java      |    4 +-
 .../apache/lucene/store/ChecksumIndexInput.java |    8 +-
 .../java/org/apache/lucene/store/DataInput.java |    4 +-
 .../org/apache/lucene/store/DataOutput.java     |    4 +-
 .../java/org/apache/lucene/store/Directory.java |    7 +-
 .../org/apache/lucene/store/FSDirectory.java    |  159 ++-
 .../org/apache/lucene/store/FSLockFactory.java  |    4 +-
 .../lucene/store/FileSwitchDirectory.java       |   15 +-
 .../apache/lucene/store/FilterDirectory.java    |    4 +-
 .../java/org/apache/lucene/store/FlushInfo.java |    4 +-
 .../java/org/apache/lucene/store/IOContext.java |    4 +-
 .../org/apache/lucene/store/IndexInput.java     |    4 +-
 .../org/apache/lucene/store/IndexOutput.java    |    4 +-
 .../lucene/store/InputStreamDataInput.java      |    4 +-
 .../src/java/org/apache/lucene/store/Lock.java  |    4 +-
 .../org/apache/lucene/store/LockFactory.java    |    4 +-
 .../lucene/store/LockObtainFailedException.java |    1 -
 .../store/LockReleaseFailedException.java       |    1 -
 .../org/apache/lucene/store/LockStressTest.java |    4 +-
 .../store/LockValidatingDirectoryWrapper.java   |    4 +-
 .../apache/lucene/store/LockVerifyServer.java   |    4 +-
 .../org/apache/lucene/store/MMapDirectory.java  |  161 ++-
 .../java/org/apache/lucene/store/MergeInfo.java |    2 +-
 .../org/apache/lucene/store/NIOFSDirectory.java |   29 +-
 .../lucene/store/NRTCachingDirectory.java       |   14 +-
 .../lucene/store/NativeFSLockFactory.java       |    4 +-
 .../org/apache/lucene/store/NoLockFactory.java  |    4 +-
 .../lucene/store/OutputStreamDataOutput.java    |    4 +-
 .../lucene/store/OutputStreamIndexOutput.java   |    4 +-
 .../org/apache/lucene/store/RAMDirectory.java   |   13 +-
 .../java/org/apache/lucene/store/RAMFile.java   |    4 +-
 .../org/apache/lucene/store/RAMInputStream.java |    4 +-
 .../apache/lucene/store/RAMOutputStream.java    |    6 +-
 .../apache/lucene/store/RandomAccessInput.java  |    4 +-
 .../lucene/store/RateLimitedIndexOutput.java    |    4 +-
 .../org/apache/lucene/store/RateLimiter.java    |    4 +-
 .../apache/lucene/store/SimpleFSDirectory.java  |    5 +-
 .../lucene/store/SimpleFSLockFactory.java       |    4 +-
 .../lucene/store/SingleInstanceLockFactory.java |    4 +-
 .../lucene/store/SleepingLockWrapper.java       |    4 +-
 .../lucene/store/TrackingDirectoryWrapper.java  |    4 +-
 .../lucene/store/VerifyingLockFactory.java      |    4 +-
 .../org/apache/lucene/util/Accountable.java     |    4 +-
 .../org/apache/lucene/util/Accountables.java    |    4 +-
 .../lucene/util/ArrayInPlaceMergeSorter.java    |    4 +-
 .../apache/lucene/util/ArrayIntroSorter.java    |    4 +-
 .../org/apache/lucene/util/ArrayTimSorter.java  |    4 +-
 .../java/org/apache/lucene/util/ArrayUtil.java  |   23 +-
 .../java/org/apache/lucene/util/Attribute.java  |    4 +-
 .../apache/lucene/util/AttributeFactory.java    |    4 +-
 .../org/apache/lucene/util/AttributeImpl.java   |    4 +-
 .../apache/lucene/util/AttributeReflector.java  |    4 +-
 .../org/apache/lucene/util/AttributeSource.java |    4 +-
 .../org/apache/lucene/util/BitDocIdSet.java     |    4 +-
 .../src/java/org/apache/lucene/util/BitSet.java |    4 +-
 .../org/apache/lucene/util/BitSetIterator.java  |    4 +-
 .../java/org/apache/lucene/util/BitUtil.java    |    1 -
 .../src/java/org/apache/lucene/util/Bits.java   |    4 +-
 .../org/apache/lucene/util/ByteBlockPool.java   |    4 +-
 .../java/org/apache/lucene/util/BytesRef.java   |    4 +-
 .../org/apache/lucene/util/BytesRefArray.java   |   33 +-
 .../org/apache/lucene/util/BytesRefBuilder.java |    4 +-
 .../org/apache/lucene/util/BytesRefHash.java    |   19 +-
 .../apache/lucene/util/BytesRefIterator.java    |    4 +-
 .../java/org/apache/lucene/util/CharsRef.java   |    4 +-
 .../org/apache/lucene/util/CharsRefBuilder.java |    4 +-
 .../lucene/util/CloseableThreadLocal.java       |    4 +-
 .../org/apache/lucene/util/CollectionUtil.java  |    4 +-
 .../org/apache/lucene/util/CommandLineUtil.java |    4 +-
 .../java/org/apache/lucene/util/Constants.java  |    4 +-
 .../java/org/apache/lucene/util/Counter.java    |    8 +-
 .../org/apache/lucene/util/DocIdSetBuilder.java |    5 +-
 .../org/apache/lucene/util/FilterIterator.java  |   27 +-
 .../org/apache/lucene/util/FixedBitSet.java     |    4 +-
 .../util/FrequencyTrackingRingBuffer.java       |    4 +-
 .../java/org/apache/lucene/util/IOUtils.java    |   12 +-
 .../apache/lucene/util/InPlaceMergeSorter.java  |    4 +-
 .../java/org/apache/lucene/util/InfoStream.java |    4 +-
 .../apache/lucene/util/IntArrayDocIdSet.java    |    4 +-
 .../org/apache/lucene/util/IntBlockPool.java    |    4 +-
 .../org/apache/lucene/util/IntroSorter.java     |    4 +-
 .../java/org/apache/lucene/util/IntsRef.java    |    8 +-
 .../org/apache/lucene/util/IntsRefBuilder.java  |    4 +-
 .../org/apache/lucene/util/LSBRadixSorter.java  |    4 +-
 .../apache/lucene/util/LegacyNumericUtils.java  |   49 +-
 .../java/org/apache/lucene/util/LongBitSet.java |    4 +-
 .../java/org/apache/lucene/util/LongValues.java |    4 +-
 .../java/org/apache/lucene/util/LongsRef.java   |    8 +-
 .../java/org/apache/lucene/util/MapOfSets.java  |    4 +-
 .../java/org/apache/lucene/util/MathUtil.java   |    4 +-
 .../org/apache/lucene/util/MergedIterator.java  |    4 +-
 .../org/apache/lucene/util/MutableBits.java     |    4 +-
 .../org/apache/lucene/util/NamedSPILoader.java  |    4 +-
 .../apache/lucene/util/NamedThreadFactory.java  |    4 +-
 .../org/apache/lucene/util/NotDocIdSet.java     |    4 +-
 .../org/apache/lucene/util/NumericUtils.java    |   35 +-
 .../org/apache/lucene/util/OfflineSorter.java   |    4 +-
 .../java/org/apache/lucene/util/PagedBytes.java |    4 +-
 .../lucene/util/PrintStreamInfoStream.java      |    4 +-
 .../org/apache/lucene/util/PriorityQueue.java   |   10 +-
 .../org/apache/lucene/util/QueryBuilder.java    |    4 +-
 .../apache/lucene/util/RamUsageEstimator.java   |   45 +-
 .../util/RecyclingByteBlockAllocator.java       |    8 +-
 .../lucene/util/RecyclingIntBlockAllocator.java |   14 +-
 .../java/org/apache/lucene/util/RefCount.java   |   10 +-
 .../org/apache/lucene/util/RoaringDocIdSet.java |    4 +-
 .../org/apache/lucene/util/RollingBuffer.java   |    4 +-
 .../apache/lucene/util/SPIClassIterator.java    |    4 +-
 .../org/apache/lucene/util/SentinelIntSet.java  |    6 +-
 .../java/org/apache/lucene/util/SetOnce.java    |    8 +-
 .../java/org/apache/lucene/util/SloppyMath.java |   10 +-
 .../java/org/apache/lucene/util/SmallFloat.java |   14 +-
 .../src/java/org/apache/lucene/util/Sorter.java |    4 +-
 .../apache/lucene/util/SparseFixedBitSet.java   |    4 +-
 .../lucene/util/StrictStringTokenizer.java      |    4 +-
 .../org/apache/lucene/util/StringHelper.java    |    4 +-
 .../apache/lucene/util/SuppressForbidden.java   |    4 +-
 .../lucene/util/ThreadInterruptedException.java |    9 +-
 .../java/org/apache/lucene/util/TimSorter.java  |    4 +-
 .../org/apache/lucene/util/ToStringUtils.java   |    4 +-
 .../org/apache/lucene/util/UnicodeUtil.java     |    6 +-
 .../java/org/apache/lucene/util/Version.java    |    4 +-
 .../org/apache/lucene/util/VirtualMethod.java   |    4 +-
 .../org/apache/lucene/util/WeakIdentityMap.java |    4 +-
 .../apache/lucene/util/automaton/Automaton.java |    8 +-
 .../lucene/util/automaton/ByteRunAutomaton.java |    4 +-
 .../util/automaton/CharacterRunAutomaton.java   |    4 +-
 .../util/automaton/CompiledAutomaton.java       |    4 +-
 .../automaton/DaciukMihovAutomatonBuilder.java  |    4 +-
 .../util/automaton/FiniteStringsIterator.java   |    4 +-
 .../automaton/Lev1ParametricDescription.java    |    3 +-
 .../automaton/Lev1TParametricDescription.java   |    3 +-
 .../automaton/Lev2ParametricDescription.java    |    3 +-
 .../automaton/Lev2TParametricDescription.java   |    3 +-
 .../util/automaton/LevenshteinAutomata.java     |    4 +-
 .../automaton/LimitedFiniteStringsIterator.java |    4 +-
 .../lucene/util/automaton/SortedIntSet.java     |    6 +-
 .../TooComplexToDeterminizeException.java       |    4 +-
 .../lucene/util/automaton/Transition.java       |    4 +-
 .../lucene/util/automaton/UTF32ToUTF8.java      |    4 +-
 .../lucene/util/automaton/createLevAutomata.py  |   89 +-
 .../org/apache/lucene/util/bkd/BKDReader.java   |    6 +-
 .../org/apache/lucene/util/bkd/BKDWriter.java   |    7 +-
 .../apache/lucene/util/bkd/HeapPointReader.java |    4 +-
 .../apache/lucene/util/bkd/HeapPointWriter.java |    6 +-
 .../lucene/util/bkd/OfflinePointReader.java     |    7 +-
 .../lucene/util/bkd/OfflinePointWriter.java     |    9 +-
 .../org/apache/lucene/util/bkd/PointReader.java |    4 +-
 .../org/apache/lucene/util/bkd/PointWriter.java |    4 +-
 .../org/apache/lucene/util/fst/Builder.java     |    4 +-
 .../lucene/util/fst/ByteSequenceOutputs.java    |    4 +-
 .../apache/lucene/util/fst/BytesRefFSTEnum.java |    4 +-
 .../org/apache/lucene/util/fst/BytesStore.java  |    4 +-
 .../lucene/util/fst/CharSequenceOutputs.java    |    4 +-
 .../java/org/apache/lucene/util/fst/FST.java    |    4 +-
 .../org/apache/lucene/util/fst/FSTEnum.java     |    4 +-
 .../lucene/util/fst/ForwardBytesReader.java     |    4 +-
 .../lucene/util/fst/IntSequenceOutputs.java     |    4 +-
 .../apache/lucene/util/fst/IntsRefFSTEnum.java  |    4 +-
 .../org/apache/lucene/util/fst/NoOutputs.java   |    4 +-
 .../org/apache/lucene/util/fst/NodeHash.java    |    4 +-
 .../org/apache/lucene/util/fst/Outputs.java     |    4 +-
 .../org/apache/lucene/util/fst/PairOutputs.java |    4 +-
 .../lucene/util/fst/PositiveIntOutputs.java     |    4 +-
 .../lucene/util/fst/ReverseBytesReader.java     |    4 +-
 .../java/org/apache/lucene/util/fst/Util.java   |    4 +-
 .../util/packed/AbstractBlockPackedWriter.java  |    4 +-
 .../util/packed/AbstractPagedMutable.java       |    8 +-
 .../lucene/util/packed/BlockPackedReader.java   |    4 +-
 .../util/packed/BlockPackedReaderIterator.java  |    4 +-
 .../lucene/util/packed/BlockPackedWriter.java   |    4 +-
 .../lucene/util/packed/BulkOperation.java       |    3 +-
 .../lucene/util/packed/BulkOperationPacked.java |    6 +-
 .../util/packed/BulkOperationPacked1.java       |    3 +-
 .../util/packed/BulkOperationPacked10.java      |    3 +-
 .../util/packed/BulkOperationPacked11.java      |    3 +-
 .../util/packed/BulkOperationPacked12.java      |    3 +-
 .../util/packed/BulkOperationPacked13.java      |    3 +-
 .../util/packed/BulkOperationPacked14.java      |    3 +-
 .../util/packed/BulkOperationPacked15.java      |    3 +-
 .../util/packed/BulkOperationPacked16.java      |    3 +-
 .../util/packed/BulkOperationPacked17.java      |    3 +-
 .../util/packed/BulkOperationPacked18.java      |    3 +-
 .../util/packed/BulkOperationPacked19.java      |    3 +-
 .../util/packed/BulkOperationPacked2.java       |    3 +-
 .../util/packed/BulkOperationPacked20.java      |    3 +-
 .../util/packed/BulkOperationPacked21.java      |    3 +-
 .../util/packed/BulkOperationPacked22.java      |    3 +-
 .../util/packed/BulkOperationPacked23.java      |    3 +-
 .../util/packed/BulkOperationPacked24.java      |    3 +-
 .../util/packed/BulkOperationPacked3.java       |    3 +-
 .../util/packed/BulkOperationPacked4.java       |    3 +-
 .../util/packed/BulkOperationPacked5.java       |    3 +-
 .../util/packed/BulkOperationPacked6.java       |    3 +-
 .../util/packed/BulkOperationPacked7.java       |    3 +-
 .../util/packed/BulkOperationPacked8.java       |    3 +-
 .../util/packed/BulkOperationPacked9.java       |    3 +-
 .../packed/BulkOperationPackedSingleBlock.java  |    4 +-
 .../util/packed/DeltaPackedLongValues.java      |    4 +-
 .../org/apache/lucene/util/packed/Direct16.java |   10 +-
 .../org/apache/lucene/util/packed/Direct32.java |   10 +-
 .../org/apache/lucene/util/packed/Direct64.java |    5 +-
 .../org/apache/lucene/util/packed/Direct8.java  |   10 +-
 .../util/packed/DirectMonotonicReader.java      |    4 +-
 .../util/packed/DirectMonotonicWriter.java      |    4 +-
 .../packed/DirectPacked64SingleBlockReader.java |    4 +-
 .../lucene/util/packed/DirectPackedReader.java  |    4 +-
 .../apache/lucene/util/packed/DirectReader.java |    4 +-
 .../apache/lucene/util/packed/DirectWriter.java |    4 +-
 .../lucene/util/packed/GrowableWriter.java      |    8 +-
 .../util/packed/MonotonicBlockPackedReader.java |    4 +-
 .../util/packed/MonotonicBlockPackedWriter.java |    4 +-
 .../lucene/util/packed/MonotonicLongValues.java |    4 +-
 .../lucene/util/packed/Packed16ThreeBlocks.java |    5 +-
 .../org/apache/lucene/util/packed/Packed64.java |    8 +-
 .../lucene/util/packed/Packed64SingleBlock.java |    5 +-
 .../lucene/util/packed/Packed8ThreeBlocks.java  |    5 +-
 .../lucene/util/packed/PackedDataInput.java     |    4 +-
 .../lucene/util/packed/PackedDataOutput.java    |    4 +-
 .../apache/lucene/util/packed/PackedInts.java   |    6 +-
 .../lucene/util/packed/PackedLongValues.java    |    4 +-
 .../util/packed/PackedReaderIterator.java       |    4 +-
 .../apache/lucene/util/packed/PackedWriter.java |    4 +-
 .../lucene/util/packed/PagedGrowableWriter.java |    6 +-
 .../apache/lucene/util/packed/PagedMutable.java |    4 +-
 .../lucene/util/packed/gen_BulkOperation.py     |   79 +-
 .../org/apache/lucene/util/packed/gen_Direct.py |   29 +-
 .../util/packed/gen_Packed64SingleBlock.py      |   45 +-
 .../lucene/util/packed/gen_PackedThreeBlocks.py |   27 +-
 .../test/org/apache/lucene/TestAssertions.java  |    4 +-
 .../src/test/org/apache/lucene/TestDemo.java    |    4 +-
 .../org/apache/lucene/TestExternalCodecs.java   |    4 +-
 .../lucene/TestMergeSchedulerExternal.java      |   66 +-
 .../src/test/org/apache/lucene/TestSearch.java  |    4 +-
 .../apache/lucene/TestSearchForDuplicates.java  |    4 +-
 .../lucene/analysis/TestCachingTokenFilter.java |   12 +-
 .../apache/lucene/analysis/TestCharFilter.java  |    4 +-
 .../lucene/analysis/TestNumericTokenStream.java |   91 +-
 .../analysis/TestReusableStringReader.java      |   12 +-
 .../org/apache/lucene/analysis/TestToken.java   |    4 +-
 .../tokenattributes/TestBytesRefAttImpl.java    |    4 +-
 .../TestCharTermAttributeImpl.java              |   42 +-
 .../TestPackedTokenAttributeImpl.java           |    4 +-
 .../TestSimpleAttributeImpl.java                |    4 +-
 .../lucene/codecs/TestCodecLoadingDeadlock.java |    4 +-
 .../AbstractTestCompressionMode.java            |    4 +-
 .../AbstractTestLZ4CompressionMode.java         |    4 +-
 .../compressing/TestFastCompressionMode.java    |    4 +-
 .../compressing/TestFastDecompressionMode.java  |    4 +-
 .../TestGrowableByteArrayDataOutput.java        |    4 +-
 .../compressing/TestHighCompressionMode.java    |    4 +-
 .../lucene50/TestBlockPostingsFormat.java       |   11 +-
 .../lucene50/TestBlockPostingsFormat2.java      |    4 +-
 .../lucene50/TestBlockPostingsFormat3.java      |    4 +-
 .../lucene/codecs/lucene50/TestForUtil.java     |    4 +-
 .../lucene50/TestLucene50CompoundFormat.java    |    4 +-
 .../lucene50/TestLucene50FieldInfoFormat.java   |    4 +-
 .../lucene50/TestLucene50SegmentInfoFormat.java |    4 +-
 .../TestLucene50StoredFieldsFormat.java         |    4 +-
 ...cene50StoredFieldsFormatHighCompression.java |   18 +-
 .../lucene50/TestLucene50TermVectorsFormat.java |    4 +-
 .../lucene53/TestLucene53NormsFormat.java       |    4 +-
 .../lucene54/TestLucene54DocValuesFormat.java   |    4 +-
 .../lucene60/TestLucene60PointFormat.java       |   83 ++
 .../perfield/TestPerFieldDocValuesFormat.java   |    4 +-
 .../perfield/TestPerFieldPostingsFormat.java    |    4 +-
 .../perfield/TestPerFieldPostingsFormat2.java   |    4 +-
 .../lucene/document/TestBinaryDocument.java     |    4 +-
 .../apache/lucene/document/TestDateTools.java   |   38 +-
 .../apache/lucene/document/TestDocument.java    |   44 +-
 .../org/apache/lucene/document/TestField.java   |   88 +-
 .../apache/lucene/document/TestFieldType.java   |    4 +-
 .../lucene/index/Test2BBinaryDocValues.java     |    4 +-
 .../lucene/index/Test2BNumericDocValues.java    |    4 +-
 .../apache/lucene/index/Test2BPositions.java    |    4 +-
 .../org/apache/lucene/index/Test2BPostings.java |    4 +-
 .../lucene/index/Test2BPostingsBytes.java       |    4 +-
 .../index/Test2BSortedDocValuesFixedSorted.java |    4 +-
 .../lucene/index/Test2BSortedDocValuesOrds.java |    4 +-
 .../org/apache/lucene/index/Test2BTerms.java    |    4 +-
 .../lucene/index/Test4GBStoredFields.java       |    4 +-
 .../org/apache/lucene/index/TestAddIndexes.java |   64 +-
 .../index/TestAllFilesCheckIndexHeader.java     |  142 ++
 .../index/TestAllFilesDetectTruncation.java     |  126 ++
 .../index/TestAllFilesHaveChecksumFooter.java   |   28 +-
 .../index/TestAllFilesHaveCodecHeader.java      |   35 +-
 .../apache/lucene/index/TestAtomicUpdate.java   |   18 +-
 .../apache/lucene/index/TestBagOfPositions.java |    4 +-
 .../apache/lucene/index/TestBagOfPostings.java  |    4 +-
 .../index/TestBinaryDocValuesUpdates.java       |   50 +-
 .../apache/lucene/index/TestBinaryTerms.java    |    4 +-
 .../org/apache/lucene/index/TestByteSlices.java |   12 +-
 .../org/apache/lucene/index/TestCheckIndex.java |    4 +-
 .../lucene/index/TestCodecHoldsOpenFiles.java   |   19 +-
 .../org/apache/lucene/index/TestCodecUtil.java  |  123 +-
 .../org/apache/lucene/index/TestCodecs.java     |    4 +-
 .../index/TestConcurrentMergeScheduler.java     |   36 +-
 .../index/TestConsistentFieldNumbers.java       |    4 +-
 .../test/org/apache/lucene/index/TestCrash.java |    4 +-
 .../index/TestCrashCausesCorruptIndex.java      |   14 +-
 .../apache/lucene/index/TestCustomNorms.java    |    4 +-
 .../apache/lucene/index/TestDeletionPolicy.java |   38 +-
 .../index/TestDemoParallelLeafReader.java       |   20 +-
 .../lucene/index/TestDirectoryReader.java       |  402 +++---
 .../lucene/index/TestDirectoryReaderReopen.java |   38 +-
 .../test/org/apache/lucene/index/TestDoc.java   |   12 +-
 .../org/apache/lucene/index/TestDocCount.java   |    4 +-
 .../index/TestDocInverterPerFieldErrorInfo.java |   16 +-
 .../org/apache/lucene/index/TestDocValues.java  |  119 +-
 .../lucene/index/TestDocValuesIndexing.java     |  331 ++---
 .../lucene/index/TestDocsAndPositions.java      |    4 +-
 .../apache/lucene/index/TestDocumentWriter.java |    4 +-
 .../index/TestDocumentsWriterDeleteQueue.java   |   29 +-
 .../index/TestDocumentsWriterStallControl.java  |   27 +-
 .../apache/lucene/index/TestDuelingCodecs.java  |    4 +-
 .../lucene/index/TestDuelingCodecsAtNight.java  |    4 +-
 .../lucene/index/TestExceedMaxTermLength.java   |   30 +-
 .../index/TestExitableDirectoryReader.java      |   20 +-
 .../org/apache/lucene/index/TestFieldReuse.java |    4 +-
 .../apache/lucene/index/TestFieldsReader.java   |   69 +-
 .../lucene/index/TestFilterDirectoryReader.java |    4 +-
 .../lucene/index/TestFilterLeafReader.java      |    4 +-
 .../test/org/apache/lucene/index/TestFlex.java  |    4 +-
 .../index/TestFlushByRamOrCountsPolicy.java     |    4 +-
 .../lucene/index/TestForTooMuchCloning.java     |    4 +-
 .../lucene/index/TestForceMergeForever.java     |    4 +-
 .../apache/lucene/index/TestIndexCommit.java    |    4 +-
 .../lucene/index/TestIndexFileDeleter.java      |  111 +-
 .../org/apache/lucene/index/TestIndexInput.java |   22 +-
 .../lucene/index/TestIndexReaderClose.java      |   26 +-
 .../apache/lucene/index/TestIndexWriter.java    | 1049 ++++++++-------
 .../lucene/index/TestIndexWriterCommit.java     |   41 +-
 .../lucene/index/TestIndexWriterConfig.java     |   81 +-
 .../lucene/index/TestIndexWriterDelete.java     |   38 +-
 .../index/TestIndexWriterDeleteByQuery.java     |    6 +-
 .../lucene/index/TestIndexWriterExceptions.java |  249 ++--
 .../index/TestIndexWriterExceptions2.java       |    9 +-
 .../lucene/index/TestIndexWriterForceMerge.java |    5 +-
 .../lucene/index/TestIndexWriterFromReader.java |   70 +-
 .../index/TestIndexWriterLockRelease.java       |    4 +-
 .../lucene/index/TestIndexWriterMaxDocs.java    |  212 ++-
 .../index/TestIndexWriterMergePolicy.java       |   11 +-
 .../lucene/index/TestIndexWriterMerging.java    |   17 +-
 .../index/TestIndexWriterNRTIsCurrent.java      |   28 +-
 .../lucene/index/TestIndexWriterOnDiskFull.java |   38 +-
 .../lucene/index/TestIndexWriterOnJRECrash.java |   70 +-
 .../lucene/index/TestIndexWriterOnVMError.java  |    9 +-
 .../TestIndexWriterOutOfFileDescriptors.java    |    6 +-
 .../lucene/index/TestIndexWriterReader.java     |   32 +-
 .../index/TestIndexWriterThreadsToSegments.java |    4 +-
 .../lucene/index/TestIndexWriterUnicode.java    |    4 +-
 .../index/TestIndexWriterWithThreads.java       |   20 +-
 .../apache/lucene/index/TestIndexableField.java |    4 +-
 .../org/apache/lucene/index/TestInfoStream.java |    4 +-
 .../apache/lucene/index/TestIntBlockPool.java   |   15 +-
 .../org/apache/lucene/index/TestIsCurrent.java  |    4 +-
 .../lucene/index/TestLazyProxSkipping.java      |    4 +-
 .../apache/lucene/index/TestLogMergePolicy.java |    4 +-
 .../apache/lucene/index/TestLongPostings.java   |    4 +-
 .../org/apache/lucene/index/TestManyFields.java |    4 +-
 .../apache/lucene/index/TestMaxPosition.java    |   11 +-
 .../lucene/index/TestMaxTermFrequency.java      |    4 +-
 .../lucene/index/TestMergePolicyWrapper.java    |   37 +
 .../lucene/index/TestMergeRateLimiter.java      |    4 +-
 .../apache/lucene/index/TestMixedCodecs.java    |    4 +-
 .../lucene/index/TestMixedDocValuesUpdates.java |   32 +-
 .../apache/lucene/index/TestMultiDocValues.java |    4 +-
 .../apache/lucene/index/TestMultiFields.java    |    4 +-
 .../lucene/index/TestMultiLevelSkipList.java    |    4 +-
 .../apache/lucene/index/TestMultiTermsEnum.java |    4 +-
 .../lucene/index/TestNRTReaderCleanup.java      |   14 +-
 .../lucene/index/TestNRTReaderWithThreads.java  |    4 +-
 .../org/apache/lucene/index/TestNRTThreads.java |    4 +-
 .../apache/lucene/index/TestNeverDelete.java    |   12 +-
 .../apache/lucene/index/TestNewestSegment.java  |    4 +-
 .../lucene/index/TestNoDeletionPolicy.java      |    4 +-
 .../apache/lucene/index/TestNoMergePolicy.java  |   12 +-
 .../lucene/index/TestNoMergeScheduler.java      |    4 +-
 .../test/org/apache/lucene/index/TestNorms.java |    4 +-
 .../index/TestNumericDocValuesUpdates.java      |   51 +-
 .../org/apache/lucene/index/TestOmitNorms.java  |    4 +-
 .../apache/lucene/index/TestOmitPositions.java  |    9 +-
 .../org/apache/lucene/index/TestOmitTf.java     |   25 +-
 .../org/apache/lucene/index/TestOrdinalMap.java |    4 +-
 .../index/TestParallelCompositeReader.java      |   75 +-
 .../lucene/index/TestParallelLeafReader.java    |   35 +-
 .../index/TestParallelReaderEmptyIndex.java     |    4 +-
 .../lucene/index/TestParallelTermEnum.java      |    4 +-
 .../org/apache/lucene/index/TestPayloads.java   |    4 +-
 .../lucene/index/TestPayloadsOnVectors.java     |   13 +-
 .../lucene/index/TestPerSegmentDeletes.java     |    4 +-
 .../TestPersistentSnapshotDeletionPolicy.java   |   38 +-
 .../apache/lucene/index/TestPointValues.java    | 1232 ++++--------------
 .../lucene/index/TestPostingsOffsets.java       |   38 +-
 .../lucene/index/TestPrefixCodedTerms.java      |    4 +-
 .../apache/lucene/index/TestReadOnlyIndex.java  |    4 +-
 .../apache/lucene/index/TestReaderClosed.java   |    4 +-
 .../index/TestReaderWrapperDVTypeCheck.java     |    1 -
 .../org/apache/lucene/index/TestRollback.java   |    4 +-
 .../apache/lucene/index/TestRollingUpdates.java |   10 +-
 .../lucene/index/TestSameTokenSamePosition.java |    4 +-
 .../apache/lucene/index/TestSegmentInfos.java   |    4 +-
 .../apache/lucene/index/TestSegmentMerger.java  |    4 +-
 .../apache/lucene/index/TestSegmentReader.java  |   26 +-
 .../lucene/index/TestSegmentTermDocs.java       |    4 +-
 .../lucene/index/TestSegmentTermEnum.java       |    4 +-
 .../lucene/index/TestSizeBoundedForceMerge.java |    4 +-
 .../index/TestSnapshotDeletionPolicy.java       |   35 +-
 .../apache/lucene/index/TestStressAdvance.java  |    4 +-
 .../apache/lucene/index/TestStressDeletes.java  |   16 +-
 .../apache/lucene/index/TestStressIndexing.java |   16 +-
 .../lucene/index/TestStressIndexing2.java       |   18 +-
 .../org/apache/lucene/index/TestStressNRT.java  |    6 +-
 .../org/apache/lucene/index/TestSumDocFreq.java |    4 +-
 .../lucene/index/TestSwappedIndexFiles.java     |  128 ++
 .../test/org/apache/lucene/index/TestTerm.java  |    4 +-
 .../apache/lucene/index/TestTermVectors.java    |    4 +-
 .../lucene/index/TestTermVectorsReader.java     |  195 +--
 .../lucene/index/TestTermVectorsWriter.java     |   23 +-
 .../apache/lucene/index/TestTermdocPerf.java    |   15 +-
 .../test/org/apache/lucene/index/TestTerms.java |    4 +-
 .../org/apache/lucene/index/TestTermsEnum.java  |    4 +-
 .../org/apache/lucene/index/TestTermsEnum2.java |    4 +-
 .../lucene/index/TestThreadedForceMerge.java    |    4 +-
 .../lucene/index/TestTieredMergePolicy.java     |   25 +-
 .../index/TestTragicIndexWriterDeadlock.java    |    4 +-
 .../lucene/index/TestTransactionRollback.java   |    4 +-
 .../apache/lucene/index/TestTransactions.java   |    4 +-
 .../org/apache/lucene/index/TestTryDelete.java  |    4 +-
 .../lucene/index/TestTwoPhaseCommitTool.java    |    4 +-
 .../lucene/index/TestUniqueTermCount.java       |    4 +-
 .../index/TestUpgradeIndexMergePolicy.java      |   26 +
 .../lucene/search/BaseTestRangeFilter.java      |    4 +-
 .../apache/lucene/search/JustCompileSearch.java |    4 +-
 .../lucene/search/MultiCollectorTest.java       |   18 +-
 .../TestApproximationSearchEquivalence.java     |    4 +-
 .../lucene/search/TestAutomatonQuery.java       |    4 +-
 .../search/TestAutomatonQueryUnicode.java       |    4 +-
 .../lucene/search/TestBlendedTermQuery.java     |    4 +-
 .../org/apache/lucene/search/TestBoolean2.java  |    4 +-
 .../apache/lucene/search/TestBooleanCoord.java  |    4 +-
 .../search/TestBooleanMinShouldMatch.java       |    4 +-
 .../org/apache/lucene/search/TestBooleanOr.java |    2 +-
 .../apache/lucene/search/TestBooleanQuery.java  |   11 +-
 .../search/TestBooleanQueryVisitSubscorers.java |    4 +-
 .../lucene/search/TestBooleanRewrites.java      |    4 +-
 .../apache/lucene/search/TestBooleanScorer.java |    4 +-
 .../apache/lucene/search/TestBoostQuery.java    |    4 +-
 .../lucene/search/TestCachingCollector.java     |   11 +-
 .../lucene/search/TestComplexExplanations.java  |    4 +-
 .../TestComplexExplanationsOfNonMatches.java    |    4 +-
 .../lucene/search/TestConjunctionDISI.java      |    4 +-
 .../apache/lucene/search/TestConjunctions.java  |    4 +-
 .../lucene/search/TestConstantScoreQuery.java   |    4 +-
 .../TestControlledRealTimeReopenThread.java     |   18 +-
 .../lucene/search/TestCustomSearcherSort.java   |   14 +-
 .../org/apache/lucene/search/TestDateSort.java  |    4 +-
 .../lucene/search/TestDisjunctionMaxQuery.java  |    4 +-
 .../org/apache/lucene/search/TestDocBoost.java  |    4 +-
 .../search/TestDocValuesRewriteMethod.java      |    4 +-
 .../lucene/search/TestDocValuesScoring.java     |    4 +-
 .../lucene/search/TestEarlyTermination.java     |    4 +-
 .../lucene/search/TestElevationComparator.java  |    4 +-
 .../search/TestFieldCacheRewriteMethod.java     |    4 +-
 .../lucene/search/TestFieldValueQuery.java      |    4 +-
 .../apache/lucene/search/TestFuzzyQuery.java    |   55 +-
 .../apache/lucene/search/TestIndexSearcher.java |   15 +-
 .../apache/lucene/search/TestLRUQueryCache.java |    6 +-
 .../lucene/search/TestLiveFieldValues.java      |    4 +-
 .../lucene/search/TestMinShouldMatch2.java      |    4 +-
 .../lucene/search/TestMultiCollector.java       |   72 +-
 .../lucene/search/TestMultiPhraseEnum.java      |    4 +-
 .../lucene/search/TestMultiPhraseQuery.java     |   18 +-
 .../search/TestMultiTermConstantScore.java      |    4 +-
 .../search/TestMultiTermQueryRewrites.java      |   12 +-
 .../search/TestMultiThreadTermVectors.java      |    4 +-
 .../TestMultiValuedNumericRangeQuery.java       |    4 +-
 .../org/apache/lucene/search/TestMultiset.java  |    4 +-
 .../lucene/search/TestNGramPhraseQuery.java     |    4 +-
 .../apache/lucene/search/TestNeedsScores.java   |    4 +-
 .../test/org/apache/lucene/search/TestNot.java  |    4 +-
 .../lucene/search/TestNumericRangeQuery32.java  |    8 +-
 .../lucene/search/TestNumericRangeQuery64.java  |    8 +-
 .../lucene/search/TestPhrasePrefixQuery.java    |    4 +-
 .../apache/lucene/search/TestPhraseQuery.java   |   25 +-
 .../apache/lucene/search/TestPointQueries.java  |  165 +--
 .../lucene/search/TestPositionIncrement.java    |    4 +-
 .../search/TestPositiveScoresOnlyCollector.java |    4 +-
 .../lucene/search/TestPrefixInBooleanQuery.java |    4 +-
 .../apache/lucene/search/TestPrefixQuery.java   |    4 +-
 .../apache/lucene/search/TestPrefixRandom.java  |    4 +-
 .../lucene/search/TestQueryCachingPolicy.java   |    4 +-
 .../apache/lucene/search/TestQueryRescorer.java |    4 +-
 .../apache/lucene/search/TestRegexpQuery.java   |    4 +-
 .../apache/lucene/search/TestRegexpRandom.java  |    4 +-
 .../apache/lucene/search/TestRegexpRandom2.java |    4 +-
 .../lucene/search/TestReqExclBulkScorer.java    |    4 +-
 .../search/TestSameScoresWithThreads.java       |    4 +-
 .../search/TestScoreCachingWrappingScorer.java  |    4 +-
 .../apache/lucene/search/TestScorerPerf.java    |   32 +-
 .../apache/lucene/search/TestSearchAfter.java   |    4 +-
 .../lucene/search/TestSearchWithThreads.java    |    4 +-
 .../lucene/search/TestSearcherManager.java      |   57 +-
 .../lucene/search/TestShardSearching.java       |    4 +-
 .../apache/lucene/search/TestSimilarity.java    |    4 +-
 .../lucene/search/TestSimilarityProvider.java   |    4 +-
 .../lucene/search/TestSimpleExplanations.java   |    4 +-
 .../TestSimpleExplanationsOfNonMatches.java     |    4 +-
 .../search/TestSimpleSearchEquivalence.java     |   14 +-
 .../lucene/search/TestSloppyPhraseQuery.java    |    4 +-
 .../lucene/search/TestSloppyPhraseQuery2.java   |    4 +-
 .../test/org/apache/lucene/search/TestSort.java |    4 +-
 .../apache/lucene/search/TestSortRandom.java    |    4 +-
 .../apache/lucene/search/TestSortRescorer.java  |    4 +-
 .../search/TestSortedNumericSortField.java      |    4 +-
 .../lucene/search/TestSortedSetSelector.java    |    4 +-
 .../lucene/search/TestSortedSetSortField.java   |    4 +-
 .../lucene/search/TestSubScorerFreqs.java       |    4 +-
 .../apache/lucene/search/TestSynonymQuery.java  |    9 +-
 .../lucene/search/TestTermRangeQuery.java       |    4 +-
 .../apache/lucene/search/TestTermScorer.java    |   15 +-
 .../search/TestTimeLimitingCollector.java       |   29 +-
 .../lucene/search/TestTopDocsCollector.java     |    4 +-
 .../apache/lucene/search/TestTopDocsMerge.java  |    4 +-
 .../lucene/search/TestTopFieldCollector.java    |    4 +-
 .../search/TestTotalHitCountCollector.java      |    4 +-
 .../TestUsageTrackingFilterCachingPolicy.java   |    6 +-
 .../org/apache/lucene/search/TestWildcard.java  |    4 +-
 .../lucene/search/TestWildcardRandom.java       |    4 +-
 .../search/similarities/TestBM25Similarity.java |   53 +-
 .../similarities/TestClassicSimilarity.java     |    4 +-
 .../search/similarities/TestSimilarity2.java    |    4 +-
 .../search/similarities/TestSimilarityBase.java |    4 +-
 .../search/spans/JustCompileSearchSpans.java    |    4 +-
 .../apache/lucene/search/spans/TestBasics.java  |    4 +-
 .../search/spans/TestFieldMaskingSpanQuery.java |    4 +-
 .../lucene/search/spans/TestFilterSpans.java    |   27 +-
 .../search/spans/TestNearSpansOrdered.java      |    4 +-
 .../lucene/search/spans/TestSpanBoostQuery.java |   10 +-
 .../lucene/search/spans/TestSpanCollection.java |    4 +-
 .../search/spans/TestSpanContainQuery.java      |    4 +-
 .../search/spans/TestSpanExplanations.java      |    4 +-
 .../spans/TestSpanExplanationsOfNonMatches.java |    4 +-
 .../lucene/search/spans/TestSpanFirstQuery.java |    4 +-
 .../spans/TestSpanMultiTermQueryWrapper.java    |    4 +-
 .../lucene/search/spans/TestSpanNearQuery.java  |   33 +-
 .../lucene/search/spans/TestSpanNotQuery.java   |   21 +-
 .../lucene/search/spans/TestSpanOrQuery.java    |   12 +-
 .../search/spans/TestSpanSearchEquivalence.java |    4 +-
 .../lucene/search/spans/TestSpanTermQuery.java  |   13 +-
 .../apache/lucene/search/spans/TestSpans.java   |    4 +-
 .../lucene/search/spans/TestSpansEnum.java      |    4 +-
 .../lucene/store/TestBufferedChecksum.java      |    4 +-
 .../lucene/store/TestBufferedIndexInput.java    |  118 +-
 .../lucene/store/TestByteArrayDataInput.java    |    4 +-
 .../org/apache/lucene/store/TestDirectory.java  |   37 +-
 .../lucene/store/TestFileSwitchDirectory.java   |   13 +-
 .../lucene/store/TestFilterDirectory.java       |    4 +-
 .../apache/lucene/store/TestHugeRamFile.java    |    4 +-
 .../apache/lucene/store/TestLockFactory.java    |    4 +-
 .../apache/lucene/store/TestMmapDirectory.java  |   12 +-
 .../org/apache/lucene/store/TestMultiMMap.java  |   80 +-
 .../apache/lucene/store/TestNIOFSDirectory.java |    4 +-
 .../lucene/store/TestNRTCachingDirectory.java   |    4 +-
 .../lucene/store/TestNativeFSLockFactory.java   |   58 +-
 .../apache/lucene/store/TestRAMDirectory.java   |   12 +-
 .../apache/lucene/store/TestRateLimiter.java    |    4 +-
 .../lucene/store/TestSimpleFSDirectory.java     |    4 +-
 .../lucene/store/TestSimpleFSLockFactory.java   |   15 +-
 .../store/TestSingleInstanceLockFactory.java    |   16 +-
 .../lucene/store/TestSleepingLockWrapper.java   |    4 +-
 .../store/TestTrackingDirectoryWrapper.java     |    4 +-
 .../apache/lucene/store/TestWindowsMMap.java    |   91 --
 .../apache/lucene/util/BaseSortTestCase.java    |    4 +-
 .../lucene/util/StressRamUsageEstimator.java    |    4 +-
 .../apache/lucene/util/Test2BPagedBytes.java    |    4 +-
 .../org/apache/lucene/util/TestArrayUtil.java   |   75 +-
 .../apache/lucene/util/TestAttributeSource.java |   26 +-
 .../apache/lucene/util/TestByteBlockPool.java   |   32 +-
 .../org/apache/lucene/util/TestBytesRef.java    |    4 +-
 .../apache/lucene/util/TestBytesRefArray.java   |   27 +-
 .../apache/lucene/util/TestBytesRefHash.java    |    4 +-
 .../org/apache/lucene/util/TestCharsRef.java    |   50 +-
 .../apache/lucene/util/TestCharsRefBuilder.java |    4 +-
 .../lucene/util/TestCloseableThreadLocal.java   |    1 -
 .../apache/lucene/util/TestCollectionUtil.java  |    4 +-
 .../apache/lucene/util/TestDocIdSetBuilder.java |    4 +-
 .../apache/lucene/util/TestFilterIterator.java  |   15 +-
 .../lucene/util/TestFixedBitDocIdSet.java       |    1 -
 .../org/apache/lucene/util/TestFixedBitSet.java |    4 +-
 .../util/TestFrequencyTrackingRingBuffer.java   |    4 +-
 .../org/apache/lucene/util/TestIOUtils.java     |   12 +-
 .../lucene/util/TestInPlaceMergeSorter.java     |    4 +-
 .../lucene/util/TestIntArrayDocIdSet.java       |    4 +-
 .../org/apache/lucene/util/TestIntroSorter.java |    4 +-
 .../org/apache/lucene/util/TestIntsRef.java     |    4 +-
 .../apache/lucene/util/TestLSBRadixSorter.java  |    4 +-
 .../lucene/util/TestLegacyNumericUtils.java     |   36 +-
 .../org/apache/lucene/util/TestLongBitSet.java  |    4 +-
 .../org/apache/lucene/util/TestMathUtil.java    |    4 +-
 .../apache/lucene/util/TestMergedIterator.java  |    4 +-
 .../apache/lucene/util/TestNamedSPILoader.java  |   17 +-
 .../org/apache/lucene/util/TestNotDocIdSet.java |    4 +-
 .../apache/lucene/util/TestOfflineSorter.java   |   50 +-
 .../org/apache/lucene/util/TestPagedBytes.java  |    1 -
 .../apache/lucene/util/TestPriorityQueue.java   |   40 +-
 .../apache/lucene/util/TestQueryBuilder.java    |    4 +-
 .../lucene/util/TestRamUsageEstimator.java      |    4 +-
 .../util/TestRecyclingByteBlockAllocator.java   |   18 +-
 .../util/TestRecyclingIntBlockAllocator.java    |   18 +-
 .../apache/lucene/util/TestRoaringDocIdSet.java |    4 +-
 .../apache/lucene/util/TestRollingBuffer.java   |    8 +-
 .../lucene/util/TestSPIClassIterator.java       |    4 +-
 .../apache/lucene/util/TestSentinelIntSet.java  |    6 +-
 .../org/apache/lucene/util/TestSetOnce.java     |    4 +-
 .../org/apache/lucene/util/TestSloppyMath.java  |    4 +-
 .../org/apache/lucene/util/TestSmallFloat.java  |   14 +-
 .../lucene/util/TestSparseFixedBitDocIdSet.java |    4 +-
 .../lucene/util/TestSparseFixedBitSet.java      |    4 +-
 .../apache/lucene/util/TestStringHelper.java    |    4 +-
 .../org/apache/lucene/util/TestTimSorter.java   |    4 +-
 .../lucene/util/TestTimSorterWorstCase.java     |    4 +-
 .../org/apache/lucene/util/TestUnicodeUtil.java |   12 +-
 .../org/apache/lucene/util/TestVersion.java     |  151 +--
 .../apache/lucene/util/TestVirtualMethod.java   |   36 +-
 .../apache/lucene/util/TestWeakIdentityMap.java |    7 +-
 .../automaton/FiniteStringsIteratorTest.java    |   12 +-
 .../LimitedFiniteStringsIteratorTest.java       |   18 +-
 .../lucene/util/automaton/TestAutomaton.java    |   11 +-
 .../util/automaton/TestCompiledAutomaton.java   |    4 +-
 .../lucene/util/automaton/TestDeterminism.java  |    4 +-
 .../util/automaton/TestDeterminizeLexicon.java  |    4 +-
 .../util/automaton/TestLevenshteinAutomata.java |    4 +-
 .../lucene/util/automaton/TestMinimize.java     |    4 +-
 .../lucene/util/automaton/TestOperations.java   |    4 +-
 .../lucene/util/automaton/TestRegExp.java       |   36 +-
 .../lucene/util/automaton/TestUTF32ToUTF8.java  |    4 +-
 .../org/apache/lucene/util/bkd/TestBKD.java     |   45 +-
 .../org/apache/lucene/util/fst/Test2BFST.java   |    5 +-
 .../apache/lucene/util/fst/TestBytesStore.java  |    4 +-
 .../org/apache/lucene/util/fst/TestFSTs.java    |    7 +-
 .../lucene/util/packed/TestDirectMonotonic.java |    4 +-
 .../lucene/util/packed/TestDirectPacked.java    |   13 +-
 .../lucene/util/packed/TestPackedInts.java      |   25 +-
 .../java/org/apache/lucene/demo/IndexFiles.java |    4 +-
 .../org/apache/lucene/demo/SearchFiles.java     |    4 +-
 .../demo/facet/AssociationsFacetsExample.java   |    4 +-
 .../demo/facet/DistanceFacetsExample.java       |   12 +-
 .../ExpressionAggregationFacetsExample.java     |   32 +-
 .../facet/MultiCategoryListsFacetsExample.java  |    4 +-
 .../lucene/demo/facet/RangeFacetsExample.java   |    6 +-
 .../lucene/demo/facet/SimpleFacetsExample.java  |    4 +-
 .../facet/SimpleSortedSetFacetsExample.java     |    4 +-
 .../demo/xmlparser/FormBasedXmlQueryDemo.java   |    1 -
 .../test/org/apache/lucene/demo/TestDemo.java   |    4 +-
 .../facet/TestAssociationsFacetsExample.java    |    4 +-
 .../demo/facet/TestDistanceFacetsExample.java   |    4 +-
 .../TestExpressionAggregationFacetsExample.java |    4 +-
 .../TestMultiCategoryListsFacetsExample.java    |    4 +-
 .../demo/facet/TestRangeFacetsExample.java      |    4 +-
 .../demo/facet/TestSimpleFacetsExample.java     |    4 +-
 .../facet/TestSimpleSortedSetFacetsExample.java |    4 +-
 .../org/apache/lucene/expressions/Bindings.java |    2 +-
 .../apache/lucene/expressions/Expression.java   |    2 +-
 .../expressions/ExpressionComparator.java       |    2 +-
 .../expressions/ExpressionFunctionValues.java   |    2 +-
 .../lucene/expressions/ExpressionRescorer.java  |    4 +-
 .../lucene/expressions/ExpressionSortField.java |    2 +-
 .../expressions/ExpressionValueSource.java      |    2 +-
 .../apache/lucene/expressions/FakeScorer.java   |    4 +-
 .../lucene/expressions/ScoreFunctionValues.java |    2 +-
 .../lucene/expressions/ScoreValueSource.java    |    4 +-
 .../lucene/expressions/SimpleBindings.java      |    4 +-
 .../expressions/js/JavascriptCompiler.java      |    2 +-
 .../js/JavascriptErrorHandlingLexer.java        |    4 +-
 .../js/JavascriptParserErrorStrategy.java       |    4 +-
 .../lucene/expressions/js/VariableContext.java  |    4 +-
 .../lucene/expressions/TestDemoExpressions.java |   32 +-
 .../expressions/TestExpressionRescorer.java     |    4 +-
 .../expressions/TestExpressionSortField.java    |    4 +-
 .../lucene/expressions/TestExpressionSorts.java |    4 +-
 .../expressions/TestExpressionValidation.java   |   60 +-
 .../expressions/TestExpressionValueSource.java  |    4 +-
 .../expressions/js/TestCustomFunctions.java     |  127 +-
 .../expressions/js/TestJavascriptCompiler.java  |  118 +-
 .../expressions/js/TestJavascriptFunction.java  |    2 +-
 .../js/TestJavascriptOperations.java            |    2 +-
 .../expressions/js/TestVariableContext.java     |    4 +-
 .../org/apache/lucene/facet/DrillDownQuery.java |    3 +-
 .../org/apache/lucene/facet/DrillSideways.java  |    3 +-
 .../apache/lucene/facet/DrillSidewaysQuery.java |    4 +-
 .../lucene/facet/DrillSidewaysScorer.java       |    3 +-
 .../org/apache/lucene/facet/FacetField.java     |    3 +-
 .../org/apache/lucene/facet/FacetResult.java    |    3 +-
 .../java/org/apache/lucene/facet/Facets.java    |    3 +-
 .../apache/lucene/facet/FacetsCollector.java    |    3 +-
 .../org/apache/lucene/facet/FacetsConfig.java   |    4 +-
 .../org/apache/lucene/facet/LabelAndValue.java  |    3 +-
 .../org/apache/lucene/facet/MultiFacets.java    |    3 +-
 .../facet/RandomSamplingFacetsCollector.java    |    3 +-
 .../lucene/facet/TopOrdAndFloatQueue.java       |    3 +-
 .../apache/lucene/facet/TopOrdAndIntQueue.java  |    3 +-
 .../apache/lucene/facet/range/DoubleRange.java  |    3 +-
 .../facet/range/DoubleRangeFacetCounts.java     |    3 +-
 .../apache/lucene/facet/range/LongRange.java    |    3 +-
 .../lucene/facet/range/LongRangeCounter.java    |    3 +-
 .../facet/range/LongRangeFacetCounts.java       |    3 +-
 .../org/apache/lucene/facet/range/Range.java    |    3 +-
 .../lucene/facet/range/RangeFacetCounts.java    |    3 +-
 .../DefaultSortedSetDocValuesReaderState.java   |    3 +-
 .../SortedSetDocValuesFacetCounts.java          |    3 +-
 .../sortedset/SortedSetDocValuesFacetField.java |    3 +-
 .../SortedSetDocValuesReaderState.java          |    3 +-
 .../facet/taxonomy/AssociationFacetField.java   |    3 +-
 .../facet/taxonomy/CachedOrdinalsReader.java    |    3 +-
 .../facet/taxonomy/DocValuesOrdinalsReader.java |    4 +-
 .../lucene/facet/taxonomy/FacetLabel.java       |    3 +-
 .../lucene/facet/taxonomy/FakeScorer.java       |    3 +-
 .../facet/taxonomy/FastTaxonomyFacetCounts.java |    3 +-
 .../taxonomy/FloatAssociationFacetField.java    |    3 +-
 .../facet/taxonomy/FloatTaxonomyFacets.java     |    3 +-
 .../taxonomy/IntAssociationFacetField.java      |    3 +-
 .../facet/taxonomy/IntTaxonomyFacets.java       |    3 +-
 .../lucene/facet/taxonomy/LRUHashMap.java       |    3 +-
 .../taxonomy/OrdinalMappingLeafReader.java      |    3 +-
 .../lucene/facet/taxonomy/OrdinalsReader.java   |    3 +-
 .../facet/taxonomy/ParallelTaxonomyArrays.java  |    4 +-
 .../facet/taxonomy/PrintTaxonomyStats.java      |    3 +-
 .../facet/taxonomy/SearcherTaxonomyManager.java |    5 +-
 .../facet/taxonomy/TaxonomyFacetCounts.java     |    3 +-
 .../TaxonomyFacetSumFloatAssociations.java      |    3 +-
 .../TaxonomyFacetSumIntAssociations.java        |    3 +-
 .../taxonomy/TaxonomyFacetSumValueSource.java   |    3 +-
 .../lucene/facet/taxonomy/TaxonomyFacets.java   |    3 +-
 .../facet/taxonomy/TaxonomyMergeUtils.java      |   31 +-
 .../lucene/facet/taxonomy/TaxonomyReader.java   |   17 +-
 .../lucene/facet/taxonomy/TaxonomyWriter.java   |   15 +-
 .../lucene/facet/taxonomy/directory/Consts.java |    7 +-
 .../directory/DirectoryTaxonomyReader.java      |   33 +-
 .../directory/DirectoryTaxonomyWriter.java      |   35 +-
 .../taxonomy/directory/TaxonomyIndexArrays.java |   25 +-
 .../taxonomy/writercache/CategoryPathUtils.java |    7 +-
 .../taxonomy/writercache/CharBlockArray.java    |   21 +-
 .../writercache/Cl2oTaxonomyWriterCache.java    |   15 +-
 .../taxonomy/writercache/CollisionMap.java      |   13 +-
 .../writercache/CompactLabelToOrdinal.java      |    3 +-
 .../taxonomy/writercache/LabelToOrdinal.java    |    7 +-
 .../writercache/LruTaxonomyWriterCache.java     |    9 +-
 .../writercache/NameHashIntCacheLRU.java        |    7 +-
 .../taxonomy/writercache/NameIntCacheLRU.java   |   13 +-
 .../writercache/TaxonomyWriterCache.java        |    9 +-
 .../facet/AssertingSubDocsAtOnceCollector.java  |    3 +-
 .../org/apache/lucene/facet/FacetTestCase.java  |    3 +-
 .../apache/lucene/facet/SlowRAMDirectory.java   |    3 +-
 .../apache/lucene/facet/TestDrillDownQuery.java |    3 +-
 .../apache/lucene/facet/TestDrillSideways.java  |    3 +-
 .../apache/lucene/facet/TestFacetsConfig.java   |    3 +-
 .../lucene/facet/TestMultipleIndexFields.java   |    3 +-
 .../TestRandomSamplingFacetsCollector.java      |   33 +-
 .../facet/range/TestRangeFacetCounts.java       |   52 +-
 .../sortedset/TestSortedSetDocValuesFacets.java |   10 +-
 .../taxonomy/TestCachedOrdinalsReader.java      |    3 +-
 .../lucene/facet/taxonomy/TestFacetLabel.java   |  155 +--
 .../lucene/facet/taxonomy/TestLRUHashMap.java   |    3 +-
 .../taxonomy/TestOrdinalMappingLeafReader.java  |   33 +-
 .../taxonomy/TestSearcherTaxonomyManager.java   |   10 +-
 .../facet/taxonomy/TestTaxonomyCombined.java    |   57 +-
 .../taxonomy/TestTaxonomyFacetAssociations.java |   41 +-
 .../facet/taxonomy/TestTaxonomyFacetCounts.java |   49 +-
 .../taxonomy/TestTaxonomyFacetCounts2.java      |    3 +-
 .../TestTaxonomyFacetSumValueSource.java        |   17 +-
 .../taxonomy/directory/TestAddTaxonomy.java     |   42 +-
 .../TestConcurrentFacetedIndexing.java          |   33 +-
 .../directory/TestDirectoryTaxonomyReader.java  |   41 +-
 .../directory/TestDirectoryTaxonomyWriter.java  |   51 +-
 .../writercache/TestCharBlockArray.java         |   30 +-
 .../writercache/TestCompactLabelToOrdinal.java  |   33 +-
 .../AbstractAllGroupHeadsCollector.java         |    3 +-
 .../grouping/AbstractAllGroupsCollector.java    |    3 +-
 .../AbstractDistinctValuesCollector.java        |    3 +-
 .../AbstractFirstPassGroupingCollector.java     |    3 +-
 .../grouping/AbstractGroupFacetCollector.java   |    3 +-
 .../AbstractSecondPassGroupingCollector.java    |    3 +-
 .../search/grouping/BlockGroupingCollector.java |    3 +-
 .../search/grouping/CollectedSearchGroup.java   |    1 -
 .../lucene/search/grouping/FakeScorer.java      |    3 +-
 .../lucene/search/grouping/GroupDocs.java       |    3 +-
 .../lucene/search/grouping/GroupingSearch.java  |    3 +-
 .../lucene/search/grouping/SearchGroup.java     |    3 +-
 .../lucene/search/grouping/TopGroups.java       |    3 +-
 .../FunctionAllGroupHeadsCollector.java         |    3 +-
 .../function/FunctionAllGroupsCollector.java    |    3 +-
 .../FunctionDistinctValuesCollector.java        |    3 +-
 .../FunctionFirstPassGroupingCollector.java     |    3 +-
 .../FunctionSecondPassGroupingCollector.java    |    3 +-
 .../term/TermAllGroupHeadsCollector.java        |    3 +-
 .../grouping/term/TermAllGroupsCollector.java   |    3 +-
 .../term/TermDistinctValuesCollector.java       |    3 +-
 .../term/TermFirstPassGroupingCollector.java    |    3 +-
 .../grouping/term/TermGroupFacetCollector.java  |    3 +-
 .../term/TermSecondPassGroupingCollector.java   |    3 +-
 .../grouping/AbstractGroupingTestCase.java      |    3 +-
 .../grouping/AllGroupHeadsCollectorTest.java    |    3 +-
 .../search/grouping/AllGroupsCollectorTest.java |    5 +-
 .../grouping/DistinctValuesCollectorTest.java   |    3 +-
 .../grouping/GroupFacetCollectorTest.java       |    3 +-
 .../search/grouping/GroupingSearchTest.java     |    3 +-
 .../lucene/search/grouping/TestGrouping.java    |    1 -
 .../lucene/search/highlight/DefaultEncoder.java |   22 +-
 .../apache/lucene/search/highlight/Encoder.java |   17 +-
 .../lucene/search/highlight/Formatter.java      |    4 +-
 .../lucene/search/highlight/Fragmenter.java     |    3 +-
 .../search/highlight/GradientFormatter.java     |    3 +-
 .../lucene/search/highlight/Highlighter.java    |    3 +-
 .../highlight/InvalidTokenOffsetsException.java |    3 +-
 .../lucene/search/highlight/NullFragmenter.java |    3 +-
 .../highlight/OffsetLimitTokenFilter.java       |    3 +-
 .../lucene/search/highlight/PositionSpan.java   |    3 +-
 .../lucene/search/highlight/QueryScorer.java    |    3 +-
 .../search/highlight/QueryTermExtractor.java    |    3 +-
 .../search/highlight/QueryTermScorer.java       |    3 +-
 .../apache/lucene/search/highlight/Scorer.java  |    3 +-
 .../search/highlight/SimpleFragmenter.java      |    3 +-
 .../search/highlight/SimpleHTMLEncoder.java     |   19 +-
 .../search/highlight/SimpleHTMLFormatter.java   |    3 +-
 .../search/highlight/SimpleSpanFragmenter.java  |    6 +-
 .../search/highlight/SpanGradientFormatter.java |    3 +-
 .../search/highlight/TermVectorLeafReader.java  |    3 +-
 .../lucene/search/highlight/TextFragment.java   |    4 +-
 .../lucene/search/highlight/TokenGroup.java     |    3 +-
 .../lucene/search/highlight/TokenSources.java   |    3 +-
 .../highlight/TokenStreamFromTermVector.java    |    3 +-
 .../search/highlight/WeightedSpanTerm.java      |    6 +-
 .../highlight/WeightedSpanTermExtractor.java    |    3 +-
 .../lucene/search/highlight/WeightedTerm.java   |    3 +-
 .../CustomSeparatorBreakIterator.java           |    9 +-
 .../DefaultPassageFormatter.java                |    3 +-
 .../MultiTermHighlighting.java                  |    3 +-
 .../search/postingshighlight/Passage.java       |    3 +-
 .../postingshighlight/PassageFormatter.java     |    3 +-
 .../search/postingshighlight/PassageScorer.java |    3 +-
 .../postingshighlight/PostingsHighlighter.java  |    3 +-
 .../postingshighlight/WholeBreakIterator.java   |    3 +-
 .../vectorhighlight/BaseFragListBuilder.java    |    3 +-
 .../vectorhighlight/BaseFragmentsBuilder.java   |    3 +-
 .../search/vectorhighlight/BoundaryScanner.java |    3 +-
 .../BreakIteratorBoundaryScanner.java           |    3 +-
 .../vectorhighlight/FastVectorHighlighter.java  |    3 +-
 .../search/vectorhighlight/FieldFragList.java   |    3 +-
 .../search/vectorhighlight/FieldPhraseList.java |    3 +-
 .../search/vectorhighlight/FieldQuery.java      |    3 +-
 .../search/vectorhighlight/FieldTermStack.java  |    3 +-
 .../search/vectorhighlight/FragListBuilder.java |    3 +-
 .../vectorhighlight/FragmentsBuilder.java       |    3 +-
 .../ScoreOrderFragmentsBuilder.java             |    3 +-
 .../vectorhighlight/SimpleBoundaryScanner.java  |    3 +-
 .../vectorhighlight/SimpleFieldFragList.java    |    3 +-
 .../vectorhighlight/SimpleFragListBuilder.java  |    4 +-
 .../vectorhighlight/SimpleFragmentsBuilder.java |    3 +-
 .../vectorhighlight/SingleFragListBuilder.java  |    3 +-
 .../vectorhighlight/WeightedFieldFragList.java  |    3 +-
 .../WeightedFragListBuilder.java                |    3 +-
 .../search/highlight/HighlighterPhraseTest.java |    3 +-
 .../search/highlight/HighlighterTest.java       |    5 +-
 .../lucene/search/highlight/MissesTest.java     |    3 +-
 .../highlight/OffsetLimitTokenFilterTest.java   |    3 +-
 .../search/highlight/TokenSourcesTest.java      |    3 +-
 .../custom/HighlightCustomQueryTest.java        |    4 +-
 .../TestCustomSeparatorBreakIterator.java       |    3 +-
 .../TestMultiTermHighlighting.java              |    3 +-
 .../TestPostingsHighlighter.java                |   17 +-
 .../TestPostingsHighlighterRanking.java         |    3 +-
 .../TestWholeBreakIterator.java                 |    3 +-
 .../vectorhighlight/AbstractTestCase.java       |    3 +-
 .../BreakIteratorBoundaryScannerTest.java       |    3 +-
 .../FastVectorHighlighterTest.java              |    2 +-
 .../vectorhighlight/FieldPhraseListTest.java    |    3 +-
 .../search/vectorhighlight/FieldQueryTest.java  |    3 +-
 .../vectorhighlight/FieldTermStackTest.java     |    3 +-
 .../vectorhighlight/IndexTimeSynonymTest.java   |    3 +-
 .../ScoreOrderFragmentsBuilderTest.java         |    3 +-
 .../SimpleBoundaryScannerTest.java              |    3 +-
 .../SimpleFragListBuilderTest.java              |   12 +-
 .../SimpleFragmentsBuilderTest.java             |    3 +-
 .../SingleFragListBuilderTest.java              |   11 +-
 .../WeightedFragListBuilderTest.java            |    3 +-
 lucene/ivy-versions.properties                  |   12 +-
 .../search/join/BaseGlobalOrdinalScorer.java    |    3 +-
 .../lucene/search/join/BitSetProducer.java      |    3 +-
 .../lucene/search/join/BlockJoinSelector.java   |    3 +-
 .../lucene/search/join/CheckJoinIndex.java      |    3 +-
 .../search/join/DocValuesTermsCollector.java    |   33 +-
 .../apache/lucene/search/join/FakeScorer.java   |    3 +-
 .../search/join/GenericTermsCollector.java      |   31 +-
 .../search/join/GlobalOrdinalsCollector.java    |    3 +-
 .../lucene/search/join/GlobalOrdinalsQuery.java |    3 +-
 .../join/GlobalOrdinalsWithScoreCollector.java  |    3 +-
 .../join/GlobalOrdinalsWithScoreQuery.java      |    3 +-
 .../org/apache/lucene/search/join/JoinUtil.java |   17 +-
 .../lucene/search/join/QueryBitSetProducer.java |    3 +-
 .../apache/lucene/search/join/ScoreMode.java    |    3 +-
 .../lucene/search/join/TermsCollector.java      |    3 +-
 .../search/join/TermsIncludingScoreQuery.java   |    3 +-
 .../apache/lucene/search/join/TermsQuery.java   |    3 +-
 .../search/join/TermsWithScoreCollector.java    |    9 +-
 .../search/join/ToChildBlockJoinQuery.java      |    3 +-
 .../search/join/ToParentBlockJoinCollector.java |    3 +-
 .../join/ToParentBlockJoinIndexSearcher.java    |    3 +-
 .../search/join/ToParentBlockJoinQuery.java     |    3 +-
 .../search/join/ToParentBlockJoinSortField.java |    3 +-
 .../lucene/search/join/TestBlockJoin.java       |   13 +-
 .../search/join/TestBlockJoinSelector.java      |    4 +-
 .../search/join/TestBlockJoinSorting.java       |    3 +-
 .../search/join/TestBlockJoinValidation.java    |   38 +-
 .../lucene/search/join/TestCheckJoinIndex.java  |    3 +-
 .../apache/lucene/search/join/TestJoinUtil.java |   33 +-
 lucene/licenses/icu4j-54.1.jar.sha1             |    1 -
 lucene/licenses/icu4j-56.1.jar.sha1             |    1 +
 ...jetty-continuation-9.2.13.v20150730.jar.sha1 |    1 -
 .../jetty-continuation-9.3.6.v20151106.jar.sha1 |    1 +
 .../jetty-http-9.2.13.v20150730.jar.sha1        |    1 -
 .../jetty-http-9.3.6.v20151106.jar.sha1         |    1 +
 .../licenses/jetty-io-9.2.13.v20150730.jar.sha1 |    1 -
 .../licenses/jetty-io-9.3.6.v20151106.jar.sha1  |    1 +
 .../jetty-server-9.2.13.v20150730.jar.sha1      |    1 -
 .../jetty-server-9.3.6.v20151106.jar.sha1       |    1 +
 .../jetty-servlet-9.2.13.v20150730.jar.sha1     |    1 -
 .../jetty-servlet-9.3.6.v20151106.jar.sha1      |    1 +
 .../jetty-util-9.2.13.v20150730.jar.sha1        |    1 -
 .../jetty-util-9.3.6.v20151106.jar.sha1         |    1 +
 lucene/licenses/morfologik-fsa-2.0.1.jar.sha1   |    1 -
 lucene/licenses/morfologik-fsa-2.1.0.jar.sha1   |    1 +
 lucene/licenses/morfologik-fsa-LICENSE-BSD.txt  |    2 +-
 .../licenses/morfologik-polish-2.0.1.jar.sha1   |    1 -
 .../licenses/morfologik-polish-2.1.0.jar.sha1   |    1 +
 .../licenses/morfologik-polish-LICENSE-BSD.txt  |   16 +-
 .../licenses/morfologik-stemming-2.0.1.jar.sha1 |    1 -
 .../licenses/morfologik-stemming-2.1.0.jar.sha1 |    1 +
 .../morfologik-stemming-LICENSE-BSD.txt         |    2 +-
 .../apache/lucene/index/memory/MemoryIndex.java |  120 +-
 .../lucene/index/memory/TestMemoryIndex.java    |   48 +-
 .../memory/TestMemoryIndexAgainstRAMDir.java    |    3 +-
 .../apache/lucene/document/LazyDocument.java    |   15 +-
 .../apache/lucene/index/MergeReaderWrapper.java |    3 +-
 .../lucene/index/MultiPassIndexSplitter.java    |    3 +-
 .../apache/lucene/index/PKIndexSplitter.java    |    3 +-
 .../java/org/apache/lucene/index/Sorter.java    |    3 +-
 .../apache/lucene/index/SortingLeafReader.java  |    3 +-
 .../apache/lucene/index/SortingMergePolicy.java |   24 +-
 .../org/apache/lucene/misc/GetTermInfo.java     |    3 +-
 .../org/apache/lucene/misc/HighFreqTerms.java   |    3 +-
 .../org/apache/lucene/misc/IndexMergeTool.java  |   14 +-
 .../apache/lucene/misc/SweetSpotSimilarity.java |    1 -
 .../java/org/apache/lucene/misc/TermStats.java  |    3 +-
 .../search/BlockJoinComparatorSource.java       |    3 +-
 .../search/DiversifiedTopDocsCollector.java     |    4 +-
 .../EarlyTerminatingSortingCollector.java       |    3 +-
 .../apache/lucene/store/NativePosixUtil.java    |    3 +-
 .../lucene/store/NativeUnixDirectory.java       |   28 +-
 .../org/apache/lucene/store/RAFDirectory.java   |    4 +-
 .../apache/lucene/store/WindowsDirectory.java   |   27 +-
 .../apache/lucene/uninverting/DocTermOrds.java  |    1 -
 .../apache/lucene/uninverting/FieldCache.java   |    3 +-
 .../lucene/uninverting/FieldCacheImpl.java      |    7 +-
 .../uninverting/FieldCacheSanityChecker.java    |   13 +-
 .../lucene/uninverting/UninvertingReader.java   |    3 +-
 .../apache/lucene/util/fst/ListOfOutputs.java   |    3 +-
 .../util/fst/UpToTwoPositiveIntOutputs.java     |    3 +-
 .../apache/lucene/index/IndexSortingTest.java   |    3 +-
 .../org/apache/lucene/index/SorterTestBase.java |    3 +-
 .../lucene/index/SortingLeafReaderTest.java     |   11 +-
 .../lucene/index/TestBlockJoinSorter.java       |    3 +-
 .../index/TestMultiPassIndexSplitter.java       |    3 +-
 .../lucene/index/TestPKIndexSplitter.java       |   27 +-
 .../lucene/index/TestSortingMergePolicy.java    |   33 +-
 .../lucene/misc/SweetSpotSimilarityTest.java    |    3 -
 .../apache/lucene/misc/TestHighFreqTerms.java   |    3 +-
 .../search/TestDiversifiedTopDocsCollector.java |    3 +-
 .../TestEarlyTerminatingSortingCollector.java   |    3 +-
 .../apache/lucene/store/TestRAFDirectory.java   |    3 +-
 .../lucene/uninverting/TestDocTermOrds.java     |    3 +-
 .../lucene/uninverting/TestFieldCache.java      |   84 +-
 .../uninverting/TestFieldCacheReopen.java       |    3 +-
 .../TestFieldCacheSanityChecker.java            |   14 +-
 .../lucene/uninverting/TestFieldCacheSort.java  |    8 +-
 .../uninverting/TestFieldCacheSortRandom.java   |    3 +-
 .../uninverting/TestFieldCacheVsDocValues.java  |    3 +-
 .../uninverting/TestFieldCacheWithThreads.java  |    3 +-
 .../lucene/uninverting/TestNumericTerms32.java  |    3 +-
 .../lucene/uninverting/TestNumericTerms64.java  |    3 +-
 .../uninverting/TestUninvertingReader.java      |    3 +-
 .../apache/lucene/util/fst/TestFSTsMisc.java    |    4 +-
 .../apache/lucene/queries/BoostingQuery.java    |    3 +-
 .../apache/lucene/queries/CommonTermsQuery.java |    4 +-
 .../lucene/queries/CustomScoreProvider.java     |    3 +-
 .../apache/lucene/queries/CustomScoreQuery.java |    3 +-
 .../org/apache/lucene/queries/TermsQuery.java   |   55 +-
 .../lucene/queries/function/BoostedQuery.java   |    3 +-
 .../lucene/queries/function/FunctionQuery.java  |    3 +-
 .../queries/function/FunctionRangeQuery.java    |    3 +-
 .../lucene/queries/function/FunctionValues.java |    3 +-
 .../lucene/queries/function/ValueSource.java    |    3 +-
 .../queries/function/ValueSourceScorer.java     |    3 +-
 .../function/docvalues/BoolDocValues.java       |    3 +-
 .../docvalues/DocTermsIndexDocValues.java       |    1 -
 .../function/docvalues/DoubleDocValues.java     |    3 +-
 .../function/docvalues/FloatDocValues.java      |    3 +-
 .../function/docvalues/IntDocValues.java        |    3 +-
 .../function/docvalues/LongDocValues.java       |    3 +-
 .../function/docvalues/StrDocValues.java        |    3 +-
 .../function/valuesource/BoolFunction.java      |    1 -
 .../valuesource/BytesRefFieldSource.java        |    3 +-
 .../function/valuesource/ConstNumberSource.java |    1 -
 .../function/valuesource/ConstValueSource.java  |    1 -
 .../function/valuesource/DefFunction.java       |    3 +-
 .../function/valuesource/DivFloatFunction.java  |    1 -
 .../valuesource/DocFreqValueSource.java         |    1 -
 .../valuesource/DoubleConstValueSource.java     |    1 -
 .../function/valuesource/DoubleFieldSource.java |    1 -
 .../function/valuesource/DualFloatFunction.java |    1 -
 .../function/valuesource/EnumFieldSource.java   |    3 +-
 .../function/valuesource/FieldCacheSource.java  |    1 -
 .../function/valuesource/FloatFieldSource.java  |    1 -
 .../function/valuesource/IDFValueSource.java    |    1 -
 .../function/valuesource/IfFunction.java        |    1 -
 .../function/valuesource/IntFieldSource.java    |    1 -
 .../valuesource/JoinDocFreqValueSource.java     |    1 -
 .../valuesource/LinearFloatFunction.java        |    1 -
 .../valuesource/LiteralValueSource.java         |    3 +-
 .../function/valuesource/LongFieldSource.java   |    1 -
 .../function/valuesource/MaxFloatFunction.java  |    1 -
 .../function/valuesource/MinFloatFunction.java  |    1 -
 .../function/valuesource/MultiBoolFunction.java |    1 -
 .../valuesource/MultiFloatFunction.java         |    3 +-
 .../function/valuesource/MultiFunction.java     |    3 +-
 .../function/valuesource/MultiValueSource.java  |    3 +-
 .../function/valuesource/NormValueSource.java   |    1 -
 .../function/valuesource/PowFloatFunction.java  |    1 -
 .../valuesource/ProductFloatFunction.java       |    1 -
 .../function/valuesource/QueryValueSource.java  |    1 -
 .../valuesource/RangeMapFloatFunction.java      |    1 -
 .../valuesource/ReciprocalFloatFunction.java    |    1 -
 .../valuesource/ScaleFloatFunction.java         |    1 -
 .../valuesource/SimpleBoolFunction.java         |    1 -
 .../valuesource/SimpleFloatFunction.java        |    1 -
 .../function/valuesource/SingleFunction.java    |    1 -
 .../valuesource/SortedSetFieldSource.java       |    3 +-
 .../function/valuesource/SumFloatFunction.java  |    1 -
 .../SumTotalTermFreqValueSource.java            |    1 -
 .../function/valuesource/TFValueSource.java     |    3 +-
 .../valuesource/TermFreqValueSource.java        |    1 -
 .../valuesource/TotalTermFreqValueSource.java   |    1 -
 .../function/valuesource/VectorValueSource.java |    3 +-
 .../apache/lucene/queries/mlt/MoreLikeThis.java |   14 +-
 .../lucene/queries/mlt/MoreLikeThisQuery.java   |    6 +-
 .../payloads/AveragePayloadFunction.java        |    4 +-
 .../queries/payloads/MaxPayloadFunction.java    |    4 +-
 .../queries/payloads/MinPayloadFunction.java    |    3 +-
 .../queries/payloads/PayloadFunction.java       |    3 +-
 .../queries/payloads/PayloadScoreQuery.java     |    3 +-
 .../queries/payloads/SpanPayloadCheckQuery.java |    3 +-
 .../lucene/queries/BoostingQueryTest.java       |    3 +-
 .../lucene/queries/CommonTermsQueryTest.java    |   31 +-
 .../apache/lucene/queries/TermsQueryTest.java   |    3 +-
 .../queries/TestCustomScoreExplanations.java    |    3 +-
 .../lucene/queries/TestCustomScoreQuery.java    |    3 +-
 .../queries/function/FunctionTestSetup.java     |   32 +-
 .../queries/function/TestBoostedQuery.java      |   33 +-
 .../function/TestDocValuesFieldSources.java     |    3 +-
 .../queries/function/TestFieldScoreQuery.java   |    3 +-
 .../function/TestFunctionQueryExplanations.java |    3 +-
 .../queries/function/TestFunctionQuerySort.java |    3 +-
 .../function/TestFunctionRangeQuery.java        |    3 +-
 .../function/TestLongNormValueSource.java       |    3 +-
 .../function/TestSortedSetFieldSource.java      |    3 +-
 .../queries/function/TestValueSources.java      |    3 +-
 .../lucene/queries/mlt/TestMoreLikeThis.java    |    3 +-
 .../lucene/queries/payloads/PayloadHelper.java  |    3 +-
 .../queries/payloads/TestPayloadCheckQuery.java |    3 +-
 .../payloads/TestPayloadExplanations.java       |    3 +-
 .../queries/payloads/TestPayloadScoreQuery.java |    3 +-
 .../queries/payloads/TestPayloadSpans.java      |   14 +-
 .../queries/payloads/TestPayloadTermQuery.java  |    3 +-
 .../analyzing/AnalyzingQueryParser.java         |    3 +-
 .../queryparser/classic/FastCharStream.java     |    5 +-
 .../classic/MultiFieldQueryParser.java          |    3 +-
 .../queryparser/classic/QueryParserBase.java    |    1 -
 .../complexPhrase/ComplexPhraseQueryParser.java |    3 +-
 .../queryparser/ext/ExtendableQueryParser.java  |    3 +-
 .../lucene/queryparser/ext/ExtensionQuery.java  |    7 +-
 .../lucene/queryparser/ext/Extensions.java      |    4 +-
 .../lucene/queryparser/ext/ParserExtension.java |    3 +-
 .../flexible/core/QueryNodeError.java           |    3 +-
 .../flexible/core/QueryNodeException.java       |    3 +-
 .../flexible/core/QueryNodeParseException.java  |    3 +-
 .../flexible/core/QueryParserHelper.java        |   16 +-
 .../flexible/core/builders/QueryBuilder.java    |    8 +-
 .../core/builders/QueryTreeBuilder.java         |    3 +-
 .../core/config/AbstractQueryConfig.java        |    3 +-
 .../flexible/core/config/ConfigurationKey.java  |    3 +-
 .../flexible/core/config/FieldConfig.java       |    3 +-
 .../core/config/FieldConfigListener.java        |    3 +-
 .../core/config/QueryConfigHandler.java         |    3 +-
 .../core/messages/QueryParserMessages.java      |    3 +-
 .../flexible/core/nodes/AndQueryNode.java       |    3 +-
 .../flexible/core/nodes/AnyQueryNode.java       |    3 +-
 .../flexible/core/nodes/BooleanQueryNode.java   |    3 +-
 .../flexible/core/nodes/BoostQueryNode.java     |    3 +-
 .../flexible/core/nodes/DeletedQueryNode.java   |    7 +-
 .../flexible/core/nodes/FieldQueryNode.java     |    3 +-
 .../core/nodes/FieldValuePairQueryNode.java     |    3 +-
 .../flexible/core/nodes/FieldableNode.java      |    3 +-
 .../flexible/core/nodes/FuzzyQueryNode.java     |    3 +-
 .../flexible/core/nodes/GroupQueryNode.java     |    3 +-
 .../core/nodes/MatchAllDocsQueryNode.java       |    3 +-
 .../core/nodes/MatchNoDocsQueryNode.java        |    3 +-
 .../flexible/core/nodes/ModifierQueryNode.java  |    3 +-
 .../core/nodes/NoTokenFoundQueryNode.java       |    3 +-
 .../flexible/core/nodes/OpaqueQueryNode.java    |    3 +-
 .../flexible/core/nodes/OrQueryNode.java        |    3 +-
 .../flexible/core/nodes/PathQueryNode.java      |    3 +-
 .../core/nodes/PhraseSlopQueryNode.java         |    3 +-
 .../flexible/core/nodes/ProximityQueryNode.java |    3 +-
 .../flexible/core/nodes/QueryNode.java          |    3 +-
 .../flexible/core/nodes/QueryNodeImpl.java      |    3 +-
 .../core/nodes/QuotedFieldQueryNode.java        |    3 +-
 .../flexible/core/nodes/RangeQueryNode.java     |    7 +-
 .../flexible/core/nodes/SlopQueryNode.java      |    3 +-
 .../flexible/core/nodes/TextableQueryNode.java  |   27 +-
 .../core/nodes/TokenizedPhraseQueryNode.java    |    3 +-
 .../flexible/core/nodes/ValueQueryNode.java     |   27 +-
 .../flexible/core/parser/EscapeQuerySyntax.java |    3 +-
 .../flexible/core/parser/SyntaxParser.java      |    3 +-
 .../NoChildOptimizationQueryNodeProcessor.java  |    3 +-
 .../core/processors/QueryNodeProcessor.java     |    3 +-
 .../core/processors/QueryNodeProcessorImpl.java |    3 +-
 .../processors/QueryNodeProcessorPipeline.java  |    3 +-
 .../RemoveDeletedQueryNodesProcessor.java       |    3 +-
 .../flexible/core/util/QueryNodeOperation.java  |    3 +-
 .../flexible/core/util/StringUtils.java         |    3 +-
 .../core/util/UnescapedCharSequence.java        |    7 +-
 .../queryparser/flexible/messages/Message.java  |    3 +-
 .../flexible/messages/MessageImpl.java          |    3 +-
 .../queryparser/flexible/messages/NLS.java      |    3 +-
 .../flexible/messages/NLSException.java         |    3 +-
 .../precedence/PrecedenceQueryParser.java       |    3 +-
 .../BooleanModifiersQueryNodeProcessor.java     |    3 +-
 .../PrecedenceQueryNodeProcessorPipeline.java   |    3 +-
 .../CommonQueryParserConfiguration.java         |   23 +-
 .../flexible/standard/QueryParserUtil.java      |    3 +-
 .../flexible/standard/StandardQueryParser.java  |    3 +-
 .../standard/builders/AnyQueryNodeBuilder.java  |    3 +-
 .../builders/BooleanQueryNodeBuilder.java       |    3 +-
 .../builders/BoostQueryNodeBuilder.java         |    3 +-
 .../builders/DummyQueryNodeBuilder.java         |    3 +-
 .../builders/FieldQueryNodeBuilder.java         |    3 +-
 .../builders/FuzzyQueryNodeBuilder.java         |    3 +-
 .../builders/GroupQueryNodeBuilder.java         |    3 +-
 .../builders/MatchAllDocsQueryNodeBuilder.java  |    3 +-
 .../builders/MatchNoDocsQueryNodeBuilder.java   |    3 +-
 .../builders/ModifierQueryNodeBuilder.java      |    3 +-
 .../builders/MultiPhraseQueryNodeBuilder.java   |    3 +-
 .../builders/NumericRangeQueryNodeBuilder.java  |    3 +-
 .../builders/PhraseQueryNodeBuilder.java        |    3 +-
 .../PrefixWildcardQueryNodeBuilder.java         |    3 +-
 .../builders/RegexpQueryNodeBuilder.java        |    3 +-
 .../standard/builders/SlopQueryNodeBuilder.java |    3 +-
 .../StandardBooleanQueryNodeBuilder.java        |    3 +-
 .../standard/builders/StandardQueryBuilder.java |    3 +-
 .../builders/StandardQueryTreeBuilder.java      |    3 +-
 .../builders/TermRangeQueryNodeBuilder.java     |    3 +-
 .../builders/WildcardQueryNodeBuilder.java      |    3 +-
 .../config/FieldBoostMapFCListener.java         |    3 +-
 .../config/FieldDateResolutionFCListener.java   |    3 +-
 .../flexible/standard/config/FuzzyConfig.java   |    3 +-
 .../standard/config/NumberDateFormat.java       |    3 +-
 .../flexible/standard/config/NumericConfig.java |    3 +-
 .../config/NumericFieldConfigListener.java      |    3 +-
 .../config/StandardQueryConfigHandler.java      |    3 +-
 .../standard/nodes/AbstractRangeQueryNode.java  |    3 +-
 .../standard/nodes/BooleanModifierNode.java     |    3 +-
 .../standard/nodes/MultiPhraseQueryNode.java    |    3 +-
 .../standard/nodes/NumericQueryNode.java        |    3 +-
 .../standard/nodes/NumericRangeQueryNode.java   |   27 +-
 .../standard/nodes/PrefixWildcardQueryNode.java |    7 +-
 .../standard/nodes/RegexpQueryNode.java         |    3 +-
 .../nodes/StandardBooleanQueryNode.java         |    3 +-
 .../standard/nodes/TermRangeQueryNode.java      |    3 +-
 .../standard/nodes/WildcardQueryNode.java       |    3 +-
 .../standard/parser/EscapeQuerySyntaxImpl.java  |    3 +-
 .../standard/parser/FastCharStream.java         |    5 +-
 .../AllowLeadingWildcardProcessor.java          |    3 +-
 .../processors/AnalyzerQueryNodeProcessor.java  |    3 +-
 .../BooleanQuery2ModifierNodeProcessor.java     |    3 +-
 ...ngleChildOptimizationQueryNodeProcessor.java |    3 +-
 .../processors/BoostQueryNodeProcessor.java     |    3 +-
 .../DefaultPhraseSlopQueryNodeProcessor.java    |    3 +-
 .../processors/FuzzyQueryNodeProcessor.java     |    3 +-
 ...owercaseExpandedTermsQueryNodeProcessor.java |    3 +-
 .../MatchAllDocsQueryNodeProcessor.java         |    3 +-
 .../MultiFieldQueryNodeProcessor.java           |    3 +-
 .../MultiTermRewriteMethodProcessor.java        |    3 +-
 .../processors/NumericQueryNodeProcessor.java   |    3 +-
 .../NumericRangeQueryNodeProcessor.java         |    3 +-
 .../processors/OpenRangeQueryNodeProcessor.java |    3 +-
 .../PhraseSlopQueryNodeProcessor.java           |    3 +-
 .../RemoveEmptyNonLeafQueryNodeProcessor.java   |    3 +-
 .../StandardQueryNodeProcessorPipeline.java     |    3 +-
 .../processors/TermRangeQueryNodeProcessor.java |    3 +-
 .../processors/WildcardQueryNodeProcessor.java  |    3 +-
 .../queryparser/simple/SimpleQueryParser.java   |    3 +-
 .../surround/parser/FastCharStream.java         |    3 +-
 .../queryparser/surround/query/AndQuery.java    |    4 +-
 .../surround/query/BasicQueryFactory.java       |    3 +-
 .../surround/query/ComposedQuery.java           |    3 +-
 .../surround/query/DistanceQuery.java           |    3 +-
 .../surround/query/DistanceRewriteQuery.java    |    3 +-
 .../surround/query/DistanceSubQuery.java        |    3 +-
 .../queryparser/surround/query/FieldsQuery.java |    3 +-
 .../queryparser/surround/query/NotQuery.java    |    3 +-
 .../queryparser/surround/query/OrQuery.java     |    3 +-
 .../surround/query/RewriteQuery.java            |    2 +-
 .../queryparser/surround/query/SimpleTerm.java  |    3 +-
 .../surround/query/SimpleTermRewriteQuery.java  |    2 +-
 .../surround/query/SpanNearClauseFactory.java   |    3 +-
 .../surround/query/SrndBooleanQuery.java        |    3 +-
 .../surround/query/SrndPrefixQuery.java         |    3 +-
 .../queryparser/surround/query/SrndQuery.java   |    3 +-
 .../surround/query/SrndTermQuery.java           |    3 +-
 .../surround/query/SrndTruncQuery.java          |    3 +-
 .../surround/query/TooManyBasicQueries.java     |    3 +-
 .../lucene/queryparser/xml/CoreParser.java      |   27 +-
 .../xml/CorePlusExtensionsParser.java           |   11 +-
 .../queryparser/xml/CorePlusQueriesParser.java  |   13 +-
 .../apache/lucene/queryparser/xml/DOMUtils.java |   19 +-
 .../lucene/queryparser/xml/ParserException.java |    5 +-
 .../lucene/queryparser/xml/QueryBuilder.java    |    8 +-
 .../queryparser/xml/QueryBuilderFactory.java    |   15 +-
 .../queryparser/xml/QueryTemplateManager.java   |   33 +-
 .../xml/builders/BooleanQueryBuilder.java       |   27 +-
 .../xml/builders/BoostingQueryBuilder.java      |   17 +-
 .../xml/builders/BoostingTermBuilder.java       |   23 +-
 .../xml/builders/ConstantScoreQueryBuilder.java |   19 +-
 .../builders/DisjunctionMaxQueryBuilder.java    |    3 +-
 .../xml/builders/FuzzyLikeThisQueryBuilder.java |   25 +-
 .../LegacyNumericRangeQueryBuilder.java         |    3 +-
 .../xml/builders/LikeThisQueryBuilder.java      |   31 +-
 .../xml/builders/MatchAllDocsQueryBuilder.java  |   13 +-
 .../xml/builders/RangeQueryBuilder.java         |    6 +-
 .../xml/builders/SpanBuilderBase.java           |   11 +-
 .../xml/builders/SpanFirstBuilder.java          |   15 +-
 .../xml/builders/SpanNearBuilder.java           |   23 +-
 .../xml/builders/SpanNotBuilder.java            |   15 +-
 .../queryparser/xml/builders/SpanOrBuilder.java |   23 +-
 .../xml/builders/SpanOrTermsBuilder.java        |   33 +-
 .../xml/builders/SpanQueryBuilder.java          |    3 +-
 .../xml/builders/SpanQueryBuilderFactory.java   |   17 +-
 .../xml/builders/SpanTermBuilder.java           |   17 +-
 .../xml/builders/TermQueryBuilder.java          |   19 +-
 .../xml/builders/TermsQueryBuilder.java         |   33 +-
 .../xml/builders/UserInputQueryBuilder.java     |   23 +-
 .../analyzing/TestAnalyzingQueryParser.java     |   62 +-
 .../queryparser/classic/TestMultiAnalyzer.java  |    3 +-
 .../classic/TestMultiFieldQueryParser.java      |   53 +-
 .../classic/TestMultiPhraseQueryParsing.java    |    3 +-
 .../queryparser/classic/TestQueryParser.java    |   26 +-
 .../complexPhrase/TestComplexPhraseQuery.java   |   12 +-
 .../lucene/queryparser/ext/ExtensionStub.java   |   13 +-
 .../ext/TestExtendableQueryParser.java          |    9 +-
 .../lucene/queryparser/ext/TestExtensions.java  |   11 +-
 .../core/builders/TestQueryTreeBuilder.java     |    3 +-
 .../flexible/core/nodes/TestQueryNode.java      |    3 +-
 .../flexible/messages/MessagesTestBundle.java   |   27 +-
 .../queryparser/flexible/messages/TestNLS.java  |    3 +-
 .../precedence/TestPrecedenceQueryParser.java   |   24 +-
 .../flexible/spans/SpanOrQueryNodeBuilder.java  |    3 +-
 .../spans/SpanTermQueryNodeBuilder.java         |    3 +-
 .../flexible/spans/SpansQueryConfigHandler.java |    3 +-
 .../flexible/spans/SpansQueryTreeBuilder.java   |    3 +-
 .../spans/SpansValidatorQueryNodeProcessor.java |    3 +-
 .../flexible/spans/TestSpanQueryParser.java     |   74 +-
 .../spans/TestSpanQueryParserSimpleSample.java  |    3 +-
 .../flexible/spans/UniqueFieldAttribute.java    |    3 +-
 .../spans/UniqueFieldAttributeImpl.java         |    3 +-
 .../spans/UniqueFieldQueryNodeProcessor.java    |    3 +-
 .../standard/TestMultiAnalyzerQPHelper.java     |    3 +-
 .../standard/TestMultiFieldQPHelper.java        |   53 +-
 .../standard/TestNumericQueryParser.java        |    3 +-
 .../flexible/standard/TestQPHelper.java         |   50 +-
 .../flexible/standard/TestStandardQP.java       |   15 +-
 .../simple/TestSimpleQueryParser.java           |    3 +-
 .../surround/query/BooleanQueryTst.java         |    3 +-
 .../surround/query/ExceptionQueryTst.java       |    3 +-
 .../surround/query/SingleFieldTestDb.java       |    3 +-
 .../surround/query/SrndQueryTest.java           |    3 +-
 .../surround/query/Test01Exceptions.java        |    3 +-
 .../surround/query/Test02Boolean.java           |    3 +-
 .../surround/query/Test03Distance.java          |    3 +-
 .../queryparser/util/QueryParserTestBase.java   |    3 +-
 .../lucene/queryparser/xml/TestCoreParser.java  |    9 +-
 .../xml/TestCorePlusExtensionsParser.java       |    9 +-
 .../xml/TestCorePlusQueriesParser.java          |    9 +-
 .../xml/TestQueryTemplateManager.java           |    3 +-
 .../builders/TestNumericRangeQueryBuilder.java  |    3 +-
 .../IndexAndTaxonomyReplicationHandler.java     |    3 +-
 .../replicator/IndexAndTaxonomyRevision.java    |    3 +-
 .../replicator/IndexInputInputStream.java       |    3 +-
 .../replicator/IndexReplicationHandler.java     |    3 +-
 .../apache/lucene/replicator/IndexRevision.java |    3 +-
 .../lucene/replicator/LocalReplicator.java      |    3 +-
 .../replicator/PerSessionDirectoryFactory.java  |    3 +-
 .../lucene/replicator/ReplicationClient.java    |    3 +-
 .../apache/lucene/replicator/Replicator.java    |    3 +-
 .../org/apache/lucene/replicator/Revision.java  |    3 +-
 .../apache/lucene/replicator/RevisionFile.java  |    3 +-
 .../replicator/SessionExpiredException.java     |    3 +-
 .../apache/lucene/replicator/SessionToken.java  |    3 +-
 .../lucene/replicator/http/HttpClientBase.java  |    3 +-
 .../lucene/replicator/http/HttpReplicator.java  |    3 +-
 .../replicator/http/ReplicationService.java     |    3 +-
 .../apache/lucene/replicator/nrt/CopyJob.java   |  238 ++++
 .../lucene/replicator/nrt/CopyOneFile.java      |  132 ++
 .../apache/lucene/replicator/nrt/CopyState.java |   58 +
 .../lucene/replicator/nrt/FileMetaData.java     |   42 +
 .../org/apache/lucene/replicator/nrt/Node.java  |  224 ++++
 .../nrt/NodeCommunicationException.java         |   32 +
 .../nrt/PreCopyMergedSegmentWarmer.java         |   62 +
 .../lucene/replicator/nrt/PrimaryNode.java      |  306 +++++
 .../replicator/nrt/ReplicaFileDeleter.java      |  169 +++
 .../lucene/replicator/nrt/ReplicaNode.java      |  771 +++++++++++
 .../nrt/SegmentInfosSearcherManager.java        |  132 ++
 .../lucene/replicator/nrt/package-info.java     |   21 +
 .../IndexAndTaxonomyReplicationClientTest.java  |   20 +-
 .../IndexAndTaxonomyRevisionTest.java           |   27 +-
 .../replicator/IndexReplicationClientTest.java  |    3 +-
 .../lucene/replicator/IndexRevisionTest.java    |   39 +-
 .../lucene/replicator/LocalReplicatorTest.java  |  124 +-
 .../lucene/replicator/ReplicatorTestCase.java   |    3 +-
 .../lucene/replicator/SessionTokenTest.java     |    3 +-
 .../replicator/http/HttpReplicatorTest.java     |    8 +-
 .../replicator/http/ReplicationServlet.java     |    3 +-
 .../lucene/replicator/nrt/Connection.java       |   63 +
 .../org/apache/lucene/replicator/nrt/Jobs.java  |  166 +++
 .../lucene/replicator/nrt/NodeProcess.java      |  251 ++++
 .../lucene/replicator/nrt/SimpleCopyJob.java    |  287 ++++
 .../replicator/nrt/SimplePrimaryNode.java       |  760 +++++++++++
 .../replicator/nrt/SimpleReplicaNode.java       |  355 +++++
 .../lucene/replicator/nrt/SimpleServer.java     |  376 ++++++
 .../lucene/replicator/nrt/SimpleTransLog.java   |  250 ++++
 .../replicator/nrt/TestNRTReplication.java      |  887 +++++++++++++
 .../nrt/TestStressNRTReplication.java           | 1201 +++++++++++++++++
 .../lucene/replicator/nrt/ThreadPumper.java     |   63 +
 lucene/replicator/test.cmd                      |    1 +
 lucene/sandbox/build.xml                        |   25 +
 .../idversion/IDVersionPostingsFormat.java      |    3 +-
 .../idversion/IDVersionPostingsReader.java      |    3 +-
 .../idversion/IDVersionPostingsWriter.java      |    3 +-
 .../idversion/IDVersionSegmentTermsEnum.java    |    3 +-
 .../IDVersionSegmentTermsEnumFrame.java         |    3 +-
 .../codecs/idversion/IDVersionTermState.java    |    3 +-
 .../lucene/codecs/idversion/SingleDocsEnum.java |    3 +-
 .../codecs/idversion/SinglePostingsEnum.java    |    3 +-
 .../idversion/VersionBlockTreeTermsReader.java  |    3 +-
 .../idversion/VersionBlockTreeTermsWriter.java  |    3 +-
 .../codecs/idversion/VersionFieldReader.java    |    3 +-
 .../apache/lucene/document/GeoPointField.java   |  132 --
 .../org/apache/lucene/document/LatLonPoint.java |    9 +-
 .../lucene/payloads/PayloadSpanCollector.java   |    3 +-
 .../apache/lucene/payloads/PayloadSpanUtil.java |    3 +-
 .../sandbox/queries/FuzzyLikeThisQuery.java     |    3 +-
 .../lucene/sandbox/queries/SlowFuzzyQuery.java  |    3 +-
 .../sandbox/queries/SlowFuzzyTermsEnum.java     |    3 +-
 .../lucene/search/DocValuesNumbersQuery.java    |    3 +-
 .../lucene/search/DocValuesRangeQuery.java      |    3 +-
 .../lucene/search/DocValuesTermsQuery.java      |    3 +-
 .../apache/lucene/search/GeoBoundingBox.java    |   47 -
 .../lucene/search/GeoPointDistanceQuery.java    |  171 ---
 .../search/GeoPointDistanceQueryImpl.java       |  132 --
 .../search/GeoPointDistanceRangeQuery.java      |  103 --
 .../lucene/search/GeoPointInBBoxQuery.java      |  153 ---
 .../lucene/search/GeoPointInBBoxQueryImpl.java  |  163 ---
 .../lucene/search/GeoPointInPolygonQuery.java   |  195 ---
 .../apache/lucene/search/GeoPointTermQuery.java |   71 -
 .../GeoPointTermQueryConstantScoreWrapper.java  |  130 --
 .../apache/lucene/search/GeoPointTermsEnum.java |  250 ----
 .../lucene/search/PointInPolygonQuery.java      |   17 +-
 .../apache/lucene/search/PointInRectQuery.java  |   11 +-
 .../lucene/search/TermAutomatonQuery.java       |    3 +-
 .../lucene/search/TermAutomatonScorer.java      |    3 +-
 .../search/TokenStreamToTermAutomatonQuery.java |    3 +-
 .../apache/lucene/util/GeoDistanceUtils.java    |  216 ---
 .../org/apache/lucene/util/GeoHashUtils.java    |  274 ----
 .../apache/lucene/util/GeoProjectionUtils.java  |  438 -------
 .../java/org/apache/lucene/util/GeoRect.java    |   67 -
 .../apache/lucene/util/GeoRelationUtils.java    |  428 ------
 .../java/org/apache/lucene/util/GeoUtils.java   |  238 ----
 .../java/org/apache/lucene/util/package.html    |   28 -
 .../codecs/idversion/StringAndPayloadField.java |    3 +-
 .../idversion/TestIDVersionPostingsFormat.java  |   85 +-
 .../lucene/payloads/TestPayloadSpanUtil.java    |    3 +-
 .../sandbox/queries/FuzzyLikeThisQueryTest.java |    3 +-
 .../sandbox/queries/TestSlowFuzzyQuery.java     |   22 +-
 .../sandbox/queries/TestSlowFuzzyQuery2.java    |    3 +-
 .../search/TestDocValuesNumbersQuery.java       |    3 +-
 .../lucene/search/TestDocValuesRangeQuery.java  |   13 +-
 .../lucene/search/TestDocValuesTermsQuery.java  |    3 +-
 .../search/TestFieldCacheTermsFilter.java       |    3 +-
 .../apache/lucene/search/TestGeoPointQuery.java |  351 -----
 .../lucene/search/TestLatLonPointQueries.java   |   61 +-
 .../lucene/search/TestTermAutomatonQuery.java   |   17 +-
 .../lucene/util/BaseGeoPointTestCase.java       |  782 -----------
 .../org/apache/lucene/util/TestGeoUtils.java    |  537 --------
 .../apache/lucene/spatial/SpatialStrategy.java  |    3 +-
 .../spatial/bbox/BBoxSimilarityValueSource.java |    3 +-
 .../lucene/spatial/bbox/BBoxStrategy.java       |    5 +-
 .../lucene/spatial/bbox/BBoxValueSource.java    |    3 +-
 .../composite/CompositeSpatialStrategy.java     |    3 +-
 .../spatial/composite/CompositeVerifyQuery.java |    3 +-
 .../composite/IntersectsRPTVerifyQuery.java     |    3 +-
 .../geopoint/document/GeoPointField.java        |  250 ++++
 .../geopoint/document/GeoPointTokenStream.java  |  233 ++++
 .../spatial/geopoint/document/package-info.java |   21 +
 .../spatial/geopoint/search/GeoBoundingBox.java |   53 +
 .../geopoint/search/GeoPointDistanceQuery.java  |  189 +++
 .../search/GeoPointDistanceQueryImpl.java       |  107 ++
 .../search/GeoPointDistanceRangeQuery.java      |  116 ++
 .../geopoint/search/GeoPointInBBoxQuery.java    |  173 +++
 .../search/GeoPointInBBoxQueryImpl.java         |  156 +++
 .../geopoint/search/GeoPointInPolygonQuery.java |  153 +++
 .../search/GeoPointInPolygonQueryImpl.java      |  103 ++
 .../geopoint/search/GeoPointMultiTermQuery.java |  166 +++
 .../search/GeoPointNumericTermsEnum.java        |  161 +++
 .../search/GeoPointPrefixTermsEnum.java         |  237 ++++
 .../GeoPointTermQueryConstantScoreWrapper.java  |  153 +++
 .../geopoint/search/GeoPointTermsEnum.java      |  140 ++
 .../spatial/geopoint/search/package-info.java   |   21 +
 .../spatial/prefix/AbstractPrefixTreeQuery.java |    3 +-
 .../prefix/AbstractVisitingPrefixTreeQuery.java |    3 +-
 .../prefix/BytesRefIteratorTokenStream.java     |    3 +-
 .../spatial/prefix/CellToBytesRefIterator.java  |    3 +-
 .../spatial/prefix/ContainsPrefixTreeQuery.java |    5 +-
 .../spatial/prefix/HeatmapFacetCounter.java     |    3 +-
 .../prefix/IntersectsPrefixTreeQuery.java       |    3 +-
 .../prefix/NumberRangePrefixTreeStrategy.java   |    3 +-
 .../PointPrefixTreeFieldCacheProvider.java      |    3 +-
 .../spatial/prefix/PrefixTreeFacetCounter.java  |    3 +-
 .../spatial/prefix/PrefixTreeStrategy.java      |    3 +-
 .../prefix/RecursivePrefixTreeStrategy.java     |    3 +-
 .../prefix/TermQueryPrefixTreeStrategy.java     |    3 +-
 .../spatial/prefix/WithinPrefixTreeQuery.java   |    3 +-
 .../apache/lucene/spatial/prefix/tree/Cell.java |    3 +-
 .../spatial/prefix/tree/CellIterator.java       |    3 +-
 .../prefix/tree/DateRangePrefixTree.java        |    3 +-
 .../spatial/prefix/tree/FilterCellIterator.java |    3 +-
 .../spatial/prefix/tree/GeohashPrefixTree.java  |    3 +-
 .../lucene/spatial/prefix/tree/LegacyCell.java  |    3 +-
 .../spatial/prefix/tree/LegacyPrefixTree.java   |    3 +-
 .../prefix/tree/NumberRangePrefixTree.java      |    3 +-
 .../prefix/tree/PackedQuadPrefixTree.java       |    3 +-
 .../spatial/prefix/tree/QuadPrefixTree.java     |    3 +-
 .../prefix/tree/SingletonCellIterator.java      |    3 +-
 .../spatial/prefix/tree/SpatialPrefixTree.java  |    3 +-
 .../prefix/tree/SpatialPrefixTreeFactory.java   |    1 -
 .../spatial/prefix/tree/TreeCellIterator.java   |    3 +-
 .../lucene/spatial/query/SpatialArgs.java       |    3 +-
 .../lucene/spatial/query/SpatialArgsParser.java |    3 +-
 .../lucene/spatial/query/SpatialOperation.java  |    3 +-
 .../query/UnsupportedSpatialOperation.java      |    3 +-
 .../serialized/SerializedDVStrategy.java        |    3 +-
 .../lucene/spatial/spatial4j/Geo3dShape.java    |    3 +-
 .../spatial/util/CachingDoubleValueSource.java  |    1 -
 .../util/DistanceToShapeValueSource.java        |    3 +-
 .../lucene/spatial/util/GeoDistanceUtils.java   |  223 ++++
 .../lucene/spatial/util/GeoEncodingUtils.java   |  157 +++
 .../lucene/spatial/util/GeoHashUtils.java       |  283 ++++
 .../lucene/spatial/util/GeoProjectionUtils.java |  465 +++++++
 .../org/apache/lucene/spatial/util/GeoRect.java |   66 +
 .../lucene/spatial/util/GeoRelationUtils.java   |  520 ++++++++
 .../apache/lucene/spatial/util/GeoUtils.java    |  187 +++
 .../spatial/util/ShapeAreaValueSource.java      |    3 +-
 .../lucene/spatial/util/ShapeFieldCache.java    |    1 -
 .../ShapeFieldCacheDistanceValueSource.java     |    3 +-
 .../spatial/util/ShapeFieldCacheProvider.java   |    1 -
 .../spatial/util/ShapePredicateValueSource.java |    3 +-
 .../spatial/vector/DistanceValueSource.java     |    3 +-
 .../spatial/vector/PointVectorStrategy.java     |    3 +-
 .../lucene/spatial/DistanceStrategyTest.java    |    3 +-
 .../apache/lucene/spatial/PortedSolr3Test.java  |    3 +-
 .../lucene/spatial/QueryEqualsHashCodeTest.java |    3 +-
 .../apache/lucene/spatial/SpatialArgsTest.java  |    3 +-
 .../apache/lucene/spatial/SpatialExample.java   |    3 +-
 .../lucene/spatial/SpatialMatchConcern.java     |    1 -
 .../apache/lucene/spatial/SpatialTestCase.java  |    3 +-
 .../apache/lucene/spatial/SpatialTestData.java  |    3 +-
 .../apache/lucene/spatial/SpatialTestQuery.java |    3 +-
 .../apache/lucene/spatial/StrategyTestCase.java |    5 +-
 .../lucene/spatial/TestTestFramework.java       |    3 +-
 .../lucene/spatial/bbox/TestBBoxStrategy.java   |    3 +-
 .../composite/CompositeStrategyTest.java        |    3 +-
 .../geopoint/search/TestGeoPointQuery.java      |  399 ++++++
 .../prefix/CellToBytesRefIterator50.java        |    3 +-
 .../spatial/prefix/DateNRStrategyTest.java      |    3 +-
 .../spatial/prefix/HeatmapFacetCounterTest.java |    3 +-
 .../lucene/spatial/prefix/JtsPolygonTest.java   |    3 +-
 .../spatial/prefix/NumberRangeFacetsTest.java   |    3 +-
 .../RandomSpatialOpFuzzyPrefixTree50Test.java   |    3 +-
 .../RandomSpatialOpFuzzyPrefixTreeTest.java     |    3 +-
 .../prefix/RandomSpatialOpStrategyTestCase.java |    3 +-
 .../prefix/TestRecursivePrefixTreeStrategy.java |    3 +-
 .../prefix/TestTermQueryPrefixGridStrategy.java |    3 +-
 .../prefix/tree/DateRangePrefixTreeTest.java    |    3 +-
 .../prefix/tree/SpatialPrefixTreeTest.java      |    3 +-
 .../spatial/query/SpatialArgsParserTest.java    |   19 +-
 .../serialized/SerializedStrategyTest.java      |    3 +-
 .../lucene/spatial/spatial4j/Geo3dRptTest.java  |    3 +-
 .../Geo3dShapeRectRelationTestCase.java         |    3 +-
 .../Geo3dShapeSphereModelRectRelationTest.java  |    3 +-
 .../Geo3dShapeWGS84ModelRectRelationTest.java   |    3 +-
 .../spatial4j/RandomizedShapeTestCase.java      |    4 +-
 .../spatial/spatial4j/geo3d/GeoPointTest.java   |    3 +-
 .../spatial/util/BaseGeoPointTestCase.java      |  759 +++++++++++
 .../lucene/spatial/util/TestGeoUtils.java       |  565 ++++++++
 .../spatial/vector/TestPointVectorStrategy.java |    3 +-
 .../org/apache/lucene/geo3d/ArcDistance.java    |    3 +-
 .../apache/lucene/geo3d/BasePlanetObject.java   |    3 +-
 .../org/apache/lucene/geo3d/BaseXYZSolid.java   |    3 +-
 .../java/org/apache/lucene/geo3d/Bounds.java    |    3 +-
 .../org/apache/lucene/geo3d/DistanceStyle.java  |    3 +-
 .../org/apache/lucene/geo3d/Geo3DPoint.java     |    9 +-
 .../java/org/apache/lucene/geo3d/Geo3DUtil.java |    3 +-
 .../java/org/apache/lucene/geo3d/GeoArea.java   |    3 +-
 .../org/apache/lucene/geo3d/GeoAreaFactory.java |    3 +-
 .../java/org/apache/lucene/geo3d/GeoBBox.java   |    3 +-
 .../org/apache/lucene/geo3d/GeoBBoxFactory.java |    3 +-
 .../org/apache/lucene/geo3d/GeoBaseBBox.java    |    3 +-
 .../org/apache/lucene/geo3d/GeoBaseCircle.java  |    3 +-
 .../lucene/geo3d/GeoBaseDistanceShape.java      |    3 +-
 .../lucene/geo3d/GeoBaseMembershipShape.java    |    3 +-
 .../org/apache/lucene/geo3d/GeoBasePolygon.java |    3 +-
 .../org/apache/lucene/geo3d/GeoBaseShape.java   |    3 +-
 .../java/org/apache/lucene/geo3d/GeoCircle.java |    3 +-
 .../apache/lucene/geo3d/GeoCircleFactory.java   |    3 +-
 .../geo3d/GeoCompositeMembershipShape.java      |    3 +-
 .../lucene/geo3d/GeoCompositePolygon.java       |    3 +-
 .../apache/lucene/geo3d/GeoConvexPolygon.java   |    3 +-
 .../geo3d/GeoDegenerateHorizontalLine.java      |    3 +-
 .../lucene/geo3d/GeoDegenerateLatitudeZone.java |    3 +-
 .../geo3d/GeoDegenerateLongitudeSlice.java      |    3 +-
 .../apache/lucene/geo3d/GeoDegeneratePoint.java |    5 +-
 .../lucene/geo3d/GeoDegenerateVerticalLine.java |    3 +-
 .../org/apache/lucene/geo3d/GeoDistance.java    |    3 +-
 .../apache/lucene/geo3d/GeoDistanceShape.java   |    3 +-
 .../apache/lucene/geo3d/GeoLatitudeZone.java    |    3 +-
 .../apache/lucene/geo3d/GeoLongitudeSlice.java  |    3 +-
 .../apache/lucene/geo3d/GeoMembershipShape.java |    3 +-
 .../lucene/geo3d/GeoNorthLatitudeZone.java      |    3 +-
 .../apache/lucene/geo3d/GeoNorthRectangle.java  |    3 +-
 .../apache/lucene/geo3d/GeoOutsideDistance.java |    3 +-
 .../java/org/apache/lucene/geo3d/GeoPath.java   |    3 +-
 .../java/org/apache/lucene/geo3d/GeoPoint.java  |    5 +-
 .../org/apache/lucene/geo3d/GeoPolygon.java     |    3 +-
 .../apache/lucene/geo3d/GeoPolygonFactory.java  |    3 +-
 .../org/apache/lucene/geo3d/GeoRectangle.java   |    3 +-
 .../java/org/apache/lucene/geo3d/GeoShape.java  |    3 +-
 .../org/apache/lucene/geo3d/GeoSizeable.java    |    3 +-
 .../lucene/geo3d/GeoSouthLatitudeZone.java      |    3 +-
 .../apache/lucene/geo3d/GeoSouthRectangle.java  |    3 +-
 .../apache/lucene/geo3d/GeoStandardCircle.java  |    3 +-
 .../geo3d/GeoWideDegenerateHorizontalLine.java  |    3 +-
 .../lucene/geo3d/GeoWideLongitudeSlice.java     |    3 +-
 .../lucene/geo3d/GeoWideNorthRectangle.java     |    3 +-
 .../apache/lucene/geo3d/GeoWideRectangle.java   |    3 +-
 .../lucene/geo3d/GeoWideSouthRectangle.java     |    3 +-
 .../java/org/apache/lucene/geo3d/GeoWorld.java  |    3 +-
 .../org/apache/lucene/geo3d/LatLonBounds.java   |    3 +-
 .../org/apache/lucene/geo3d/LinearDistance.java |    3 +-
 .../lucene/geo3d/LinearSquaredDistance.java     |    3 +-
 .../org/apache/lucene/geo3d/Membership.java     |    3 +-
 .../org/apache/lucene/geo3d/NormalDistance.java |    3 +-
 .../lucene/geo3d/NormalSquaredDistance.java     |    3 +-
 .../src/java/org/apache/lucene/geo3d/Plane.java |    3 +-
 .../org/apache/lucene/geo3d/PlanetModel.java    |    3 +-
 .../lucene/geo3d/PointInGeo3DShapeQuery.java    |   15 +-
 .../org/apache/lucene/geo3d/SidedPlane.java     |    3 +-
 .../apache/lucene/geo3d/StandardXYZSolid.java   |    3 +-
 .../src/java/org/apache/lucene/geo3d/Tools.java |    3 +-
 .../java/org/apache/lucene/geo3d/Vector.java    |    3 +-
 .../java/org/apache/lucene/geo3d/XYZBounds.java |    3 +-
 .../java/org/apache/lucene/geo3d/XYZSolid.java  |    3 +-
 .../apache/lucene/geo3d/XYZSolidFactory.java    |    3 +-
 .../java/org/apache/lucene/geo3d/XYdZSolid.java |    3 +-
 .../java/org/apache/lucene/geo3d/XdYZSolid.java |    3 +-
 .../org/apache/lucene/geo3d/XdYdZSolid.java     |    3 +-
 .../java/org/apache/lucene/geo3d/dXYZSolid.java |    3 +-
 .../org/apache/lucene/geo3d/dXYdZSolid.java     |    3 +-
 .../org/apache/lucene/geo3d/dXdYZSolid.java     |    3 +-
 .../org/apache/lucene/geo3d/dXdYdZSolid.java    |    3 +-
 .../org/apache/lucene/geo3d/GeoBBoxTest.java    |    3 +-
 .../org/apache/lucene/geo3d/GeoCircleTest.java  |    3 +-
 .../lucene/geo3d/GeoConvexPolygonTest.java      |    3 +-
 .../org/apache/lucene/geo3d/GeoModelTest.java   |    3 +-
 .../org/apache/lucene/geo3d/GeoPathTest.java    |    3 +-
 .../org/apache/lucene/geo3d/GeoPolygonTest.java |    3 +-
 .../test/org/apache/lucene/geo3d/PlaneTest.java |    3 +-
 .../org/apache/lucene/geo3d/TestGeo3DPoint.java |   14 +-
 .../org/apache/lucene/geo3d/XYZSolidTest.java   |    3 +-
 .../lucene/search/spell/CombineSuggestion.java  |    3 +-
 .../apache/lucene/search/spell/Dictionary.java  |    3 +-
 .../lucene/search/spell/DirectSpellChecker.java |    3 +-
 .../search/spell/HighFrequencyDictionary.java   |    1 -
 .../search/spell/JaroWinklerDistance.java       |    3 +-
 .../lucene/search/spell/LevensteinDistance.java |    3 +-
 .../lucene/search/spell/LuceneDictionary.java   |    3 +-
 .../search/spell/LuceneLevenshteinDistance.java |    3 +-
 .../lucene/search/spell/NGramDistance.java      |   33 +-
 .../search/spell/PlainTextDictionary.java       |    3 +-
 .../lucene/search/spell/SpellChecker.java       |    3 +-
 .../lucene/search/spell/StringDistance.java     |    3 +-
 .../apache/lucene/search/spell/SuggestMode.java |    3 +-
 .../apache/lucene/search/spell/SuggestWord.java |    5 +-
 .../spell/SuggestWordFrequencyComparator.java   |    6 +-
 .../lucene/search/spell/SuggestWordQueue.java   |    5 +-
 .../spell/SuggestWordScoreComparator.java       |    3 +-
 .../search/spell/WordBreakSpellChecker.java     |    3 +-
 .../lucene/search/suggest/BitsProducer.java     |    3 +-
 .../search/suggest/BufferedInputIterator.java   |    3 +-
 .../search/suggest/DocumentDictionary.java      |    3 +-
 .../suggest/DocumentValueSourceDictionary.java  |    3 +-
 .../lucene/search/suggest/FileDictionary.java   |    4 +-
 .../lucene/search/suggest/InMemorySorter.java   |    3 +-
 .../lucene/search/suggest/InputIterator.java    |    3 +-
 .../apache/lucene/search/suggest/Lookup.java    |    3 +-
 .../search/suggest/SortedInputIterator.java     |    3 +-
 .../search/suggest/UnsortedInputIterator.java   |    3 +-
 .../analyzing/AnalyzingInfixSuggester.java      |    6 +-
 .../suggest/analyzing/AnalyzingSuggester.java   |    3 +-
 .../analyzing/BlendedInfixSuggester.java        |    3 +-
 .../search/suggest/analyzing/FSTUtil.java       |    3 +-
 .../suggest/analyzing/FreeTextSuggester.java    |    3 +-
 .../suggest/analyzing/FuzzySuggester.java       |    3 +-
 .../suggest/analyzing/SuggestStopFilter.java    |    3 +-
 .../analyzing/SuggestStopFilterFactory.java     |    3 +-
 .../document/Completion50PostingsFormat.java    |    4 +-
 .../suggest/document/CompletionAnalyzer.java    |    3 +-
 .../document/CompletionFieldsConsumer.java      |    3 +-
 .../document/CompletionFieldsProducer.java      |    3 +-
 .../document/CompletionPostingsFormat.java      |    3 +-
 .../suggest/document/CompletionQuery.java       |    3 +-
 .../suggest/document/CompletionScorer.java      |    3 +-
 .../suggest/document/CompletionTerms.java       |    3 +-
 .../suggest/document/CompletionTokenStream.java |    3 +-
 .../suggest/document/CompletionWeight.java      |    3 +-
 .../document/CompletionsTermsReader.java        |    3 +-
 .../search/suggest/document/ContextQuery.java   |    3 +-
 .../suggest/document/ContextSuggestField.java   |    3 +-
 .../suggest/document/FuzzyCompletionQuery.java  |    3 +-
 .../search/suggest/document/NRTSuggester.java   |    3 +-
 .../suggest/document/NRTSuggesterBuilder.java   |    3 +-
 .../suggest/document/PrefixCompletionQuery.java |    3 +-
 .../suggest/document/RegexCompletionQuery.java  |    3 +-
 .../search/suggest/document/SuggestField.java   |    3 +-
 .../suggest/document/SuggestIndexSearcher.java  |    3 +-
 .../document/SuggestScoreDocPriorityQueue.java  |    3 +-
 .../search/suggest/document/TopSuggestDocs.java |    3 +-
 .../document/TopSuggestDocsCollector.java       |    3 +-
 .../search/suggest/fst/BytesRefSorter.java      |    3 +-
 .../search/suggest/fst/ExternalRefSorter.java   |    4 +-
 .../search/suggest/fst/FSTCompletion.java       |    3 +-
 .../suggest/fst/FSTCompletionBuilder.java       |    3 +-
 .../search/suggest/fst/FSTCompletionLookup.java |    3 +-
 .../suggest/fst/WFSTCompletionLookup.java       |    3 +-
 .../search/suggest/jaspell/JaspellLookup.java   |    3 +-
 .../jaspell/JaspellTernarySearchTrie.java       |    5 +-
 .../search/suggest/tst/TSTAutocomplete.java     |    3 +-
 .../lucene/search/suggest/tst/TSTLookup.java    |    3 +-
 .../search/suggest/tst/TernaryTreeNode.java     |    9 +-
 .../search/spell/TestDirectSpellChecker.java    |    3 +-
 .../search/spell/TestJaroWinklerDistance.java   |    3 +-
 .../search/spell/TestLevenshteinDistance.java   |    3 +-
 .../search/spell/TestLuceneDictionary.java      |    3 +-
 .../lucene/search/spell/TestNGramDistance.java  |    3 +-
 .../search/spell/TestPlainTextDictionary.java   |    3 +-
 .../lucene/search/spell/TestSpellChecker.java   |   49 +-
 .../search/spell/TestWordBreakSpellChecker.java |    3 +-
 .../apache/lucene/search/suggest/Average.java   |    5 +-
 .../search/suggest/DocumentDictionaryTest.java  |   33 +-
 .../DocumentValueSourceDictionaryTest.java      |    3 +-
 .../search/suggest/FileDictionaryTest.java      |   33 +-
 .../org/apache/lucene/search/suggest/Input.java |    3 +-
 .../search/suggest/InputArrayIterator.java      |    3 +-
 .../search/suggest/LookupBenchmarkTest.java     |    3 +-
 .../lucene/search/suggest/PersistenceTest.java  |    6 +-
 .../suggest/TestHighFrequencyDictionary.java    |   27 +-
 .../search/suggest/TestInputIterator.java       |   33 +-
 .../analyzing/AnalyzingInfixSuggesterTest.java  |   19 +-
 .../analyzing/AnalyzingSuggesterTest.java       |   24 +-
 .../analyzing/BlendedInfixSuggesterTest.java    |    3 +-
 .../suggest/analyzing/FuzzySuggesterTest.java   |    9 +-
 .../analyzing/TestFreeTextSuggester.java        |   27 +-
 .../analyzing/TestSuggestStopFilter.java        |    3 +-
 .../analyzing/TestSuggestStopFilterFactory.java |   41 +-
 .../document/CompletionTokenStreamTest.java     |    3 +-
 .../suggest/document/TestContextQuery.java      |   19 +-
 .../document/TestContextSuggestField.java       |   46 +-
 .../document/TestFuzzyCompletionQuery.java      |    3 +-
 .../document/TestPrefixCompletionQuery.java     |    3 +-
 .../document/TestRegexCompletionQuery.java      |    3 +-
 .../suggest/document/TestSuggestField.java      |   45 +-
 .../search/suggest/fst/BytesRefSortersTest.java |   14 +-
 .../search/suggest/fst/FSTCompletionTest.java   |    9 +-
 .../search/suggest/fst/WFSTCompletionTest.java  |    9 +-
 .../analysis/BaseTokenStreamTestCase.java       |    3 +-
 .../analysis/CannedBinaryTokenStream.java       |    3 +-
 .../lucene/analysis/CannedTokenStream.java      |    3 +-
 .../lucene/analysis/CollationTestBase.java      |    4 +-
 .../lucene/analysis/CrankyTokenFilter.java      |    3 +-
 .../lucene/analysis/LookaheadTokenFilter.java   |    3 +-
 .../apache/lucene/analysis/MockAnalyzer.java    |    3 +-
 .../lucene/analysis/MockBytesAnalyzer.java      |    3 +-
 .../apache/lucene/analysis/MockCharFilter.java  |    3 +-
 .../analysis/MockFixedLengthPayloadFilter.java  |    3 +-
 .../lucene/analysis/MockGraphTokenFilter.java   |    3 +-
 .../analysis/MockHoleInjectingTokenFilter.java  |    4 +-
 .../lucene/analysis/MockPayloadAnalyzer.java    |    4 +-
 .../MockRandomLookaheadTokenFilter.java         |    3 +-
 .../lucene/analysis/MockReaderWrapper.java      |    3 +-
 .../apache/lucene/analysis/MockTokenFilter.java |    3 +-
 .../apache/lucene/analysis/MockTokenizer.java   |    3 +-
 .../analysis/MockUTF16TermAttributeImpl.java    |    3 +-
 .../MockVariableLengthPayloadFilter.java        |    3 +-
 .../lucene/analysis/SimplePayloadFilter.java    |    3 +-
 .../lucene/analysis/TokenStreamToDot.java       |    3 +-
 .../lucene/analysis/ValidatingTokenFilter.java  |    3 +-
 .../lucene/analysis/VocabularyAssert.java       |    5 +-
 .../lucene/codecs/MissingOrdRemapper.java       |   11 +-
 .../lucene/codecs/asserting/AssertingCodec.java |    3 +-
 .../asserting/AssertingDocValuesFormat.java     |    3 +-
 .../asserting/AssertingLiveDocsFormat.java      |    3 +-
 .../codecs/asserting/AssertingNormsFormat.java  |    3 +-
 .../codecs/asserting/AssertingPointFormat.java  |    8 +-
 .../asserting/AssertingPostingsFormat.java      |    3 +-
 .../asserting/AssertingStoredFieldsFormat.java  |    3 +-
 .../asserting/AssertingTermVectorsFormat.java   |    3 +-
 .../codecs/blockterms/LuceneFixedGap.java       |    3 +-
 .../blockterms/LuceneVarGapDocFreqInterval.java |    3 +-
 .../blockterms/LuceneVarGapFixedInterval.java   |    3 +-
 .../bloom/TestBloomFilteredLucenePostings.java  |    3 +-
 .../codecs/cheapbastard/CheapBastardCodec.java  |    3 +-
 .../codecs/compressing/CompressingCodec.java    |    3 +-
 .../compressing/FastCompressingCodec.java       |    3 +-
 .../FastDecompressionCompressingCodec.java      |    3 +-
 .../HighCompressionCompressingCodec.java        |    3 +-
 .../dummy/DummyCompressingCodec.java            |    3 +-
 .../lucene/codecs/cranky/CrankyCodec.java       |    9 +-
 .../codecs/cranky/CrankyCompoundFormat.java     |    3 +-
 .../codecs/cranky/CrankyDocValuesFormat.java    |    3 +-
 .../codecs/cranky/CrankyFieldInfosFormat.java   |    3 +-
 .../codecs/cranky/CrankyLiveDocsFormat.java     |    3 +-
 .../lucene/codecs/cranky/CrankyNormsFormat.java |    3 +-
 .../lucene/codecs/cranky/CrankyPointFormat.java |  175 +++
 .../codecs/cranky/CrankyPostingsFormat.java     |    3 +-
 .../codecs/cranky/CrankySegmentInfoFormat.java  |    3 +-
 .../codecs/cranky/CrankyStoredFieldsFormat.java |    3 +-
 .../codecs/cranky/CrankyTermVectorsFormat.java  |    3 +-
 .../mockrandom/MockRandomPostingsFormat.java    |    3 +-
 .../codecs/ramonly/RAMOnlyPostingsFormat.java   |    3 +-
 .../lucene/index/AlcoholicMergePolicy.java      |    3 +-
 .../lucene/index/AllDeletedFilterReader.java    |    7 +-
 .../lucene/index/AssertingDirectoryReader.java  |    3 +-
 .../lucene/index/AssertingLeafReader.java       |   21 +-
 .../index/BaseCompoundFormatTestCase.java       |   76 +-
 .../BaseCompressingDocValuesFormatTestCase.java |    3 +-
 .../index/BaseDocValuesFormatTestCase.java      |    3 +-
 .../index/BaseFieldInfoFormatTestCase.java      |   56 +-
 .../index/BaseIndexFileFormatTestCase.java      |   21 +-
 .../lucene/index/BaseMergePolicyTestCase.java   |   69 +-
 .../lucene/index/BaseNormsFormatTestCase.java   |    3 +-
 .../lucene/index/BasePointFormatTestCase.java   |  917 +++++++++++++
 .../index/BasePostingsFormatTestCase.java       |    5 +-
 .../index/BaseSegmentInfoFormatTestCase.java    |   74 +-
 .../index/BaseStoredFieldsFormatTestCase.java   |    3 +-
 .../index/BaseTermVectorsFormatTestCase.java    |    3 +-
 .../apache/lucene/index/BaseTestCheckIndex.java |   13 +-
 .../java/org/apache/lucene/index/DocHelper.java |    9 +-
 .../lucene/index/FieldFilterLeafReader.java     |    3 +-
 .../apache/lucene/index/ForceMergePolicy.java   |   48 +-
 .../lucene/index/IndexWriterMaxDocsChanger.java |    7 +-
 .../lucene/index/MismatchedDirectoryReader.java |    3 +-
 .../lucene/index/MismatchedLeafReader.java      |    3 +-
 .../lucene/index/MockRandomMergePolicy.java     |    3 +-
 .../apache/lucene/index/PerThreadPKLookup.java  |    3 +-
 .../org/apache/lucene/index/RandomCodec.java    |    3 +-
 .../apache/lucene/index/RandomIndexWriter.java  |   11 +-
 .../lucene/index/RandomPostingsTester.java      |   11 +-
 .../SuppressingConcurrentMergeScheduler.java    |    7 +-
 .../ThreadedIndexingAndSearchingTestCase.java   |    4 +-
 .../apache/lucene/mockfile/DisableFsyncFS.java  |   23 +-
 .../org/apache/lucene/mockfile/ExtrasFS.java    |    3 +-
 .../mockfile/FilterAsynchronousFileChannel.java |    3 +-
 .../lucene/mockfile/FilterDirectoryStream.java  |    3 +-
 .../lucene/mockfile/FilterFileChannel.java      |    3 +-
 .../apache/lucene/mockfile/FilterFileStore.java |    3 +-
 .../lucene/mockfile/FilterFileSystem.java       |    3 +-
 .../mockfile/FilterFileSystemProvider.java      |    3 +-
 .../lucene/mockfile/FilterInputStream2.java     |    3 +-
 .../lucene/mockfile/FilterOutputStream2.java    |    3 +-
 .../org/apache/lucene/mockfile/FilterPath.java  |    3 +-
 .../mockfile/FilterSeekableByteChannel.java     |    3 +-
 .../apache/lucene/mockfile/HandleLimitFS.java   |    3 +-
 .../lucene/mockfile/HandleTrackingFS.java       |    3 +-
 .../java/org/apache/lucene/mockfile/LeakFS.java |    3 +-
 .../lucene/mockfile/MockFileSystemTestCase.java |    3 +-
 .../org/apache/lucene/mockfile/ShuffleFS.java   |    3 +-
 .../org/apache/lucene/mockfile/VerboseFS.java   |    3 +-
 .../apache/lucene/mockfile/VirusCheckingFS.java |   80 ++
 .../org/apache/lucene/mockfile/WindowsFS.java   |    3 +-
 .../lucene/search/AssertingBulkScorer.java      |    3 +-
 .../lucene/search/AssertingCollector.java       |    3 +-
 .../lucene/search/AssertingIndexSearcher.java   |    3 +-
 .../lucene/search/AssertingLeafCollector.java   |    3 +-
 .../apache/lucene/search/AssertingQuery.java    |    3 +-
 .../apache/lucene/search/AssertingScorer.java   |    3 +-
 .../apache/lucene/search/AssertingWeight.java   |    3 +-
 .../lucene/search/BaseExplanationTestCase.java  |    3 +-
 .../lucene/search/BulkScorerWrapperScorer.java  |    3 +-
 .../org/apache/lucene/search/CheckHits.java     |    3 +-
 .../org/apache/lucene/search/QueryUtils.java    |    3 +-
 .../lucene/search/RandomApproximationQuery.java |    3 +-
 .../lucene/search/ScorerIndexSearcher.java      |    3 +-
 .../search/SearchEquivalenceTestBase.java       |    3 +-
 .../lucene/search/ShardSearchingTestBase.java   |    3 +-
 .../search/similarities/RandomSimilarity.java   |    3 +-
 .../lucene/search/spans/AssertingSpanQuery.java |    3 +-
 .../search/spans/AssertingSpanWeight.java       |    3 +-
 .../lucene/search/spans/AssertingSpans.java     |    3 +-
 .../lucene/search/spans/MultiSpansWrapper.java  |    3 +-
 .../lucene/search/spans/SpanTestUtil.java       |    3 +-
 .../lucene/store/BaseDirectoryTestCase.java     |  231 ++--
 .../lucene/store/BaseDirectoryWrapper.java      |    3 +-
 .../lucene/store/BaseLockFactoryTestCase.java   |   80 +-
 .../lucene/store/MockDirectoryWrapper.java      |  508 ++++----
 .../lucene/store/MockIndexInputWrapper.java     |   13 +-
 .../lucene/store/MockIndexOutputWrapper.java    |    3 +-
 .../lucene/store/RawDirectoryWrapper.java       |    3 +-
 .../store/SlowClosingMockIndexInputWrapper.java |    3 +-
 .../store/SlowOpeningMockIndexInputWrapper.java |    3 +-
 .../lucene/util/AbstractBeforeAfterRule.java    |   23 +-
 .../apache/lucene/util/BaseBitSetTestCase.java  |    3 +-
 .../lucene/util/BaseDocIdSetTestCase.java       |    3 +-
 .../apache/lucene/util/CloseableDirectory.java  |   15 +-
 .../java/org/apache/lucene/util/English.java    |    9 +-
 .../util/FailOnNonBulkMergesInfoStream.java     |    3 +-
 .../org/apache/lucene/util/FailureMarker.java   |   13 +-
 .../org/apache/lucene/util/LineFileDocs.java    |    3 +-
 .../lucene/util/LuceneJUnit3MethodProvider.java |    3 +-
 .../org/apache/lucene/util/LuceneTestCase.java  |  134 +-
 .../org/apache/lucene/util/NullInfoStream.java  |    3 +-
 .../lucene/util/QuickPatchThreadsFilter.java    |    7 +-
 .../org/apache/lucene/util/RamUsageTester.java  |    3 +-
 .../org/apache/lucene/util/RemoveUponClose.java |   19 +-
 .../java/org/apache/lucene/util/Rethrow.java    |    3 +-
 .../util/RunListenerPrintReproduceInfo.java     |   33 +-
 .../lucene/util/TestRuleAssertionsRequired.java |    3 +-
 .../apache/lucene/util/TestRuleDelegate.java    |   15 +-
 .../util/TestRuleIgnoreAfterMaxFailures.java    |   21 +-
 .../lucene/util/TestRuleIgnoreTestSuites.java   |   11 +-
 .../lucene/util/TestRuleLimitSysouts.java       |   33 +-
 .../apache/lucene/util/TestRuleMarkFailure.java |   19 +-
 .../util/TestRuleRestoreSystemProperties.java   |   17 +-
 .../util/TestRuleSetupAndRestoreClassEnv.java   |    3 +-
 .../TestRuleSetupAndRestoreInstanceEnv.java     |    7 +-
 .../util/TestRuleSetupTeardownChained.java      |   13 +-
 .../lucene/util/TestRuleStoreClassName.java     |    3 +-
 .../util/TestRuleTemporaryFilesCleanup.java     |    5 +-
 .../lucene/util/TestRuleThreadAndTestName.java  |   11 +-
 .../apache/lucene/util/TestSecurityManager.java |    9 +-
 .../java/org/apache/lucene/util/TestUtil.java   |  108 +-
 .../lucene/util/ThrottledIndexOutput.java       |    9 +-
 .../java/org/apache/lucene/util/TimeUnits.java  |    3 +-
 .../util/automaton/AutomatonTestUtil.java       |    3 +-
 .../org/apache/lucene/util/fst/FSTTester.java   |    9 +-
 .../lucene/analysis/TestGraphTokenizers.java    |    3 +-
 .../analysis/TestLookaheadTokenFilter.java      |    3 +-
 .../lucene/analysis/TestMockAnalyzer.java       |    3 +-
 .../lucene/analysis/TestMockCharFilter.java     |    9 +-
 .../apache/lucene/analysis/TestPosition.java    |    5 +-
 .../lucene/analysis/TrivialLookaheadFilter.java |    3 +-
 .../asserting/TestAssertingDocValuesFormat.java |    3 +-
 .../asserting/TestAssertingNormsFormat.java     |    3 +-
 .../asserting/TestAssertingPointFormat.java     |   30 +
 .../asserting/TestAssertingPostingsFormat.java  |    3 +-
 .../TestAssertingStoredFieldsFormat.java        |    3 +-
 .../TestAssertingTermVectorsFormat.java         |    3 +-
 .../TestCompressingStoredFieldsFormat.java      |    7 +-
 .../TestCompressingTermVectorsFormat.java       |   33 +-
 .../lucene/index/TestAssertingLeafReader.java   |    3 +-
 .../lucene/index/TestForceMergePolicy.java      |    3 +-
 .../lucene/mockfile/TestDisableFsyncFS.java     |    3 +-
 .../apache/lucene/mockfile/TestExtrasFS.java    |    3 +-
 .../lucene/mockfile/TestHandleLimitFS.java      |    3 +-
 .../lucene/mockfile/TestHandleTrackingFS.java   |    3 +-
 .../org/apache/lucene/mockfile/TestLeakFS.java  |    3 +-
 .../apache/lucene/mockfile/TestShuffleFS.java   |    3 +-
 .../apache/lucene/mockfile/TestVerboseFS.java   |    3 +-
 .../lucene/mockfile/TestVirusCheckingFS.java    |   62 +
 .../apache/lucene/mockfile/TestWindowsFS.java   |    5 +-
 .../lucene/store/TestMockDirectoryWrapper.java  |    4 +-
 .../test/org/apache/lucene/util/SorePoint.java  |    3 +-
 .../test/org/apache/lucene/util/SoreType.java   |    3 +-
 .../lucene/util/TestBeforeAfterOverrides.java   |   17 +-
 .../apache/lucene/util/TestCodecReported.java   |   15 +-
 .../util/TestExceptionInBeforeClassHooks.java   |    3 +-
 .../util/TestFailIfDirectoryNotClosed.java      |    3 +-
 .../util/TestFailIfUnreferencedFiles.java       |    3 +-
 .../apache/lucene/util/TestGroupFiltering.java  |   21 +-
 .../apache/lucene/util/TestJUnitRuleOrder.java  |    3 +-
 .../apache/lucene/util/TestMaxFailuresRule.java |    3 +-
 .../util/TestRamUsageTesterOnWildAnimals.java   |    3 +-
 .../lucene/util/TestReproduceMessage.java       |    3 +-
 .../util/TestReproduceMessageWithRepeated.java  |    3 +-
 .../util/TestRunWithRestrictedPermissions.java  |    3 +-
 .../lucene/util/TestSeedFromUncaught.java       |    3 +-
 .../lucene/util/TestSetupTeardownChaining.java  |    3 +-
 .../lucene/util/TestWorstCaseTestBehavior.java  |   15 +-
 .../org/apache/lucene/util/WithNestedTests.java |    3 +-
 lucene/tools/junit4/tests.policy                |    1 +
 .../dependencies/GetMavenDependenciesTask.java  |    3 +-
 .../dependencies/InterpolatedProperties.java    |    3 +-
 .../lucene/validation/LibVersionsCheckTask.java |    3 +-
 .../lucene/validation/LicenseCheckTask.java     |    3 +-
 .../apache/lucene/validation/LicenseType.java   |    5 +-
 .../lucene/validation/ivyde/IvyNodeElement.java |   28 +-
 .../validation/ivyde/IvyNodeElementAdapter.java |   28 +-
 solr/CHANGES.txt                                |  189 ++-
 solr/README.txt                                 |    2 +-
 .../apache/solr/schema/ICUCollationField.java   |    3 +-
 .../TestFoldingMultitermExtrasQuery.java        |    3 +-
 .../solr/schema/TestICUCollationField.java      |    1 -
 .../schema/TestICUCollationFieldDocValues.java  |    1 -
 .../schema/TestICUCollationFieldOptions.java    |    3 +-
 .../analytics/accumulator/BasicAccumulator.java |    1 -
 .../accumulator/FacetingAccumulator.java        |    1 -
 .../analytics/accumulator/ValueAccumulator.java |    1 -
 .../facet/FacetValueAccumulator.java            |    1 -
 .../facet/FieldFacetAccumulator.java            |    1 -
 .../facet/QueryFacetAccumulator.java            |    1 -
 .../facet/RangeFacetAccumulator.java            |    1 -
 .../analytics/expression/BaseExpression.java    |    1 -
 .../expression/DualDelegateExpression.java      |    1 -
 .../solr/analytics/expression/Expression.java   |    1 -
 .../analytics/expression/ExpressionFactory.java |    1 -
 .../expression/MultiDelegateExpression.java     |    1 -
 .../expression/SingleDelegateExpression.java    |    1 -
 .../plugin/AnalyticsStatisticsCollector.java    |    1 -
 .../request/AbstractFieldFacetRequest.java      |    1 -
 .../request/AnalyticsContentHandler.java        |    1 -
 .../analytics/request/AnalyticsRequest.java     |    1 -
 .../request/AnalyticsRequestFactory.java        |    1 -
 .../solr/analytics/request/AnalyticsStats.java  |    1 -
 .../analytics/request/ExpressionRequest.java    |    1 -
 .../solr/analytics/request/FacetRequest.java    |    1 -
 .../analytics/request/FieldFacetRequest.java    |    1 -
 .../analytics/request/QueryFacetRequest.java    |    1 -
 .../analytics/request/RangeFacetRequest.java    |    1 -
 .../AbstractDelegatingStatsCollector.java       |    1 -
 .../statistics/MedianStatsCollector.java        |    1 -
 .../statistics/MinMaxStatsCollector.java        |    1 -
 .../statistics/NumericStatsCollector.java       |    1 -
 .../statistics/PercentileStatsCollector.java    |    1 -
 .../analytics/statistics/StatsCollector.java    |    1 -
 .../StatsCollectorSupplierFactory.java          |    1 -
 .../statistics/UniqueStatsCollector.java        |    1 -
 .../solr/analytics/util/AnalyticsParams.java    |    1 -
 .../solr/analytics/util/AnalyticsParsers.java   |    1 -
 .../solr/analytics/util/MedianCalculator.java   |    1 -
 .../analytics/util/PercentileCalculator.java    |    1 -
 .../analytics/util/RangeEndpointCalculator.java |    1 -
 .../AbsoluteValueDoubleFunction.java            |    1 -
 .../util/valuesource/AddDoubleFunction.java     |    1 -
 .../util/valuesource/ConcatStringFunction.java  |    1 -
 .../util/valuesource/ConstDateSource.java       |    1 -
 .../util/valuesource/ConstDoubleSource.java     |    1 -
 .../util/valuesource/ConstStringSource.java     |    1 -
 .../util/valuesource/DateFieldSource.java       |    1 -
 .../util/valuesource/DateMathFunction.java      |    1 -
 .../util/valuesource/DivDoubleFunction.java     |    1 -
 .../util/valuesource/DualDoubleFunction.java    |    1 -
 .../util/valuesource/FilterFieldSource.java     |    1 -
 .../util/valuesource/LogDoubleFunction.java     |    1 -
 .../util/valuesource/MultiDateFunction.java     |    1 -
 .../util/valuesource/MultiDoubleFunction.java   |    1 -
 .../util/valuesource/MultiStringFunction.java   |    1 -
 .../valuesource/MultiplyDoubleFunction.java     |    1 -
 .../util/valuesource/NegateDoubleFunction.java  |    1 -
 .../util/valuesource/PowDoubleFunction.java     |    1 -
 .../util/valuesource/ReverseStringFunction.java |    1 -
 .../util/valuesource/SingleDoubleFunction.java  |    1 -
 .../util/valuesource/SingleStringFunction.java  |    1 -
 .../handler/component/AnalyticsComponent.java   |    1 -
 .../solrconfig.snippet.randomindexconfig.xml    |    2 +-
 .../analytics/AbstractAnalyticsStatsTest.java   |    1 -
 .../org/apache/solr/analytics/NoFacetTest.java  |    1 -
 .../analytics/expression/ExpressionTest.java    |    1 -
 .../facet/AbstractAnalyticsFacetTest.java       |    1 -
 .../analytics/facet/FieldFacetExtrasTest.java   |    1 -
 .../solr/analytics/facet/FieldFacetTest.java    |    1 -
 .../solr/analytics/facet/QueryFacetTest.java    |    1 -
 .../solr/analytics/facet/RangeFacetTest.java    |    1 -
 .../util/valuesource/FunctionTest.java          |    1 -
 solr/contrib/clustering/ivy.xml                 |    3 -
 .../handler/clustering/ClusteringComponent.java |    3 +-
 .../handler/clustering/ClusteringEngine.java    |    2 +-
 .../handler/clustering/ClusteringParams.java    |    3 +-
 .../clustering/DocumentClusteringEngine.java    |    3 +-
 .../clustering/SearchClusteringEngine.java      |    3 +-
 .../carrot2/CarrotClusteringEngine.java         |    3 +-
 .../clustering/carrot2/CarrotParams.java        |   10 +-
 .../carrot2/LuceneCarrot2StemmerFactory.java    |    7 +-
 .../carrot2/LuceneCarrot2TokenizerFactory.java  |    3 +-
 .../clustering/carrot2/SolrResourceLocator.java |    1 -
 .../SolrStopwordsCarrot2LexicalDataFactory.java |    3 +-
 .../clustering/AbstractClusteringTestCase.java  |    3 +-
 .../clustering/ClusteringComponentTest.java     |    3 +-
 .../DistributedClusteringComponentTest.java     |    3 +-
 .../MockDocumentClusteringEngine.java           |    2 +-
 .../carrot2/CarrotClusteringEngineTest.java     |    3 +-
 .../carrot2/DuplicatingStemmerFactory.java      |    3 +-
 .../carrot2/DuplicatingTokenizerFactory.java    |    3 +-
 .../carrot2/EchoClusteringAlgorithm.java        |    2 +-
 .../carrot2/EchoStemsClusteringAlgorithm.java   |    4 +-
 .../carrot2/EchoTokensClusteringAlgorithm.java  |    4 +-
 ...exicalResourcesCheckClusteringAlgorithm.java |    4 +-
 .../carrot2/MockClusteringAlgorithm.java        |    2 +-
 .../handler/dataimport/CachePropertyUtil.java   |    3 +-
 .../apache/solr/handler/dataimport/Context.java |    1 -
 .../solr/handler/dataimport/ContextImpl.java    |    4 +-
 .../solr/handler/dataimport/DIHCache.java       |    3 +-
 .../handler/dataimport/DIHCacheSupport.java     |    3 +-
 .../solr/handler/dataimport/DIHLogLevels.java   |    3 +-
 .../solr/handler/dataimport/DIHProperties.java  |    5 +-
 .../solr/handler/dataimport/DIHWriter.java      |    2 +-
 .../solr/handler/dataimport/DIHWriterBase.java  |    3 +-
 .../dataimport/DataImportHandlerException.java  |    1 -
 .../solr/handler/dataimport/DataImporter.java   |    1 -
 .../solr/handler/dataimport/DataSource.java     |    1 -
 .../handler/dataimport/DateFormatEvaluator.java |   33 +-
 .../dataimport/DateFormatTransformer.java       |    1 -
 .../solr/handler/dataimport/DebugLogger.java    |    3 +-
 .../solr/handler/dataimport/DocBuilder.java     |    1 -
 .../solr/handler/dataimport/JdbcDataSource.java |   70 +-
 .../dataimport/NumberFormatTransformer.java     |    3 +-
 .../dataimport/SimplePropertiesWriter.java      |    3 +-
 .../handler/dataimport/SolrEntityProcessor.java |    3 +-
 .../dataimport/SolrQueryEscapingEvaluator.java  |   15 +-
 .../dataimport/SortedMapBackedCache.java        |    3 +-
 .../dataimport/SqlEscapingEvaluator.java        |   11 +-
 .../solr/handler/dataimport/UrlEvaluator.java   |   17 +-
 .../apache/solr/handler/dataimport/Zipper.java  |   27 +-
 .../dataimport/config/DIHConfiguration.java     |   33 +-
 .../solr/handler/dataimport/config/Entity.java  |   26 +-
 .../handler/dataimport/config/EntityField.java  |    1 -
 .../solr/handler/dataimport/config/Field.java   |    1 -
 .../dataimport/config/PropertyWriter.java       |    9 +-
 .../solr/handler/dataimport/config/Script.java  |   25 +-
 .../dataimport/AbstractDIHCacheTestCase.java    |    3 +-
 .../dataimport/AbstractDIHJdbcTestCase.java     |   30 +-
 .../AbstractSqlEntityProcessorTestCase.java     |   33 +-
 .../dataimport/AddAColumnTransformer.java       |    7 +-
 .../handler/dataimport/DestroyCountCache.java   |    3 +-
 .../dataimport/MockSolrEntityProcessor.java     |    3 +-
 .../handler/dataimport/TestEphemeralCache.java  |    3 +-
 .../handler/dataimport/TestErrorHandling.java   |    3 +-
 .../dataimport/TestFileListEntityProcessor.java |    3 +-
 .../TestFileListWithLineEntityProcessor.java    |   19 +-
 .../dataimport/TestHierarchicalDocBuilder.java  |    3 +-
 .../TestJdbcDataSourceConvertType.java          |    3 +-
 .../dataimport/TestLineEntityProcessor.java     |    3 +-
 .../handler/dataimport/TestNestedChildren.java  |   15 +-
 .../dataimport/TestSimplePropertiesWriter.java  |   33 +-
 .../TestSolrEntityProcessorEndToEnd.java        |    3 +-
 .../dataimport/TestSolrEntityProcessorUnit.java |    2 +-
 .../dataimport/TestSortedMapBackedCache.java    |    7 +-
 .../dataimport/TestSqlEntityProcessor.java      |    9 +-
 .../dataimport/TestSqlEntityProcessorDelta.java |   21 +-
 .../TestVariableResolverEndToEnd.java           |   31 +-
 .../dataimport/TestXPathRecordReader.java       |    2 +-
 .../dataimport/TestZKPropertiesWriter.java      |    7 +-
 .../dataimport/TripleThreatTransformer.java     |   16 +-
 .../handler/extraction/ParseContextConfig.java  |    3 +-
 .../extraction/RegexRulesPasswordProvider.java  |    1 -
 .../handler/extraction/SolrContentHandler.java  |    1 -
 .../ExtractingRequestHandlerTest.java           |    3 +-
 .../extraction/ParseContextConfigTest.java      |    3 +-
 .../solr/update/processor/DetectedLanguage.java |    3 +-
 ...DetectLanguageIdentifierUpdateProcessor.java |    3 +-
 ...anguageIdentifierUpdateProcessorFactory.java |    3 +-
 .../solr/update/processor/LangIdParams.java     |    3 +-
 .../LanguageIdentifierUpdateProcessor.java      |    3 +-
 .../TikaLanguageIdentifierUpdateProcessor.java  |    3 +-
 ...anguageIdentifierUpdateProcessorFactory.java |    3 +-
 ...ageIdentifierUpdateProcessorFactoryTest.java |    3 +-
 ...dentifierUpdateProcessorFactoryTestCase.java |    1 -
 ...ageIdentifierUpdateProcessorFactoryTest.java |    3 +-
 .../solr/hadoop/AlphaNumericComparator.java     |    1 -
 .../solr/hadoop/DataInputInputStream.java       |    1 -
 .../hadoop/UnbufferedDataInputInputStream.java  |    1 -
 .../apache/solr/hadoop/ZooKeeperInspector.java  |    1 -
 .../solr/hadoop/MorphlineGoLiveMiniMRTest.java  |    1 -
 .../solr/collection1/conf/solrconfig.xml        |   18 +-
 .../test-files/solr/minimr/conf/solrconfig.xml  |   18 +-
 .../test-files/solr/mrunit/conf/solrconfig.xml  |   18 +-
 .../collection1/conf/solrconfig.xml             |   18 +-
 .../solr/solrcloud/conf/solrconfig.xml          |   18 +-
 .../solr/AbstractSolrMorphlineZkTestBase.java   |    1 -
 .../uima/processor/FieldMappingException.java   |    3 +-
 .../uima/processor/SolrUIMAConfiguration.java   |    3 +-
 .../processor/SolrUIMAConfigurationReader.java  |    3 +-
 .../solr/uima/processor/UIMAToSolrMapper.java   |    3 +-
 .../processor/UIMAUpdateRequestProcessor.java   |    3 +-
 .../UIMAUpdateRequestProcessorFactory.java      |    3 +-
 .../UIMATokenizersSolrIntegrationTest.java      |    3 +-
 .../UIMAUpdateRequestProcessorTest.java         |    3 +-
 .../uima/processor/an/DummyEntityAnnotator.java |   17 +-
 .../processor/an/DummyExceptionAnnotator.java   |   11 +-
 .../processor/an/DummySentimentAnnotator.java   |   21 +-
 .../java/org/apache/solr/response/PageTool.java |    1 -
 .../solr/response/SolrParamResourceLoader.java  |    1 -
 .../solr/response/SolrVelocityLogger.java       |    3 +-
 .../solr/response/VelocityResponseWriter.java   |    1 -
 .../test/org/apache/solr/velocity/MockTool.java |    3 +-
 .../velocity/VelocityResponseWriterTest.java    |    1 -
 solr/core/ivy.xml                               |    2 +
 .../solr/analysis/ReversedWildcardFilter.java   |    3 +-
 .../analysis/ReversedWildcardFilterFactory.java |    3 +-
 .../org/apache/solr/analysis/SolrAnalyzer.java  |    1 -
 .../apache/solr/analysis/TokenizerChain.java    |    1 -
 .../solrj/embedded/EmbeddedSolrServer.java      |    1 -
 .../solr/client/solrj/embedded/JettyConfig.java |    1 -
 .../client/solrj/embedded/JettySolrRunner.java  |   16 +-
 .../solr/client/solrj/embedded/SSLConfig.java   |    5 +-
 .../org/apache/solr/cloud/ActionThrottle.java   |    7 +-
 .../src/java/org/apache/solr/cloud/Assign.java  |   27 +-
 .../solr/cloud/CloudConfigSetService.java       |    1 -
 .../org/apache/solr/cloud/CloudDescriptor.java  |    3 +-
 .../java/org/apache/solr/cloud/CloudUtil.java   |    3 +-
 .../cloud/CurrentCoreDescriptorProvider.java    |    3 +-
 .../org/apache/solr/cloud/DistributedMap.java   |  169 +--
 .../org/apache/solr/cloud/DistributedQueue.java |   10 +-
 .../org/apache/solr/cloud/ElectionContext.java  |   23 +-
 .../org/apache/solr/cloud/LeaderElector.java    |  107 +-
 .../cloud/LeaderInitiatedRecoveryThread.java    |   33 +-
 .../java/org/apache/solr/cloud/Overseer.java    |   83 +-
 .../OverseerAutoReplicaFailoverThread.java      |    3 +-
 .../OverseerCollectionConfigSetProcessor.java   |    3 +-
 .../cloud/OverseerCollectionMessageHandler.java |   71 +-
 .../cloud/OverseerConfigSetMessageHandler.java  |    3 +-
 .../solr/cloud/OverseerMessageHandler.java      |    3 +-
 .../solr/cloud/OverseerNodePrioritizer.java     |    7 +-
 .../apache/solr/cloud/OverseerSolrResponse.java |    3 +-
 .../solr/cloud/OverseerTaskProcessor.java       |   34 +-
 .../apache/solr/cloud/OverseerTaskQueue.java    |   17 +-
 .../org/apache/solr/cloud/RecoveryStrategy.java |    3 +-
 .../solr/cloud/SizeLimitedDistributedMap.java   |   32 +-
 .../org/apache/solr/cloud/SolrZkServer.java     |   27 +-
 .../org/apache/solr/cloud/SyncStrategy.java     |   33 +-
 .../src/java/org/apache/solr/cloud/ZkCLI.java   |   33 +-
 .../org/apache/solr/cloud/ZkController.java     |   49 +-
 .../apache/solr/cloud/ZkSolrResourceLoader.java |    3 +-
 .../cloud/overseer/ClusterStateMutator.java     |    7 +-
 .../solr/cloud/overseer/CollectionMutator.java  |    7 +-
 .../apache/solr/cloud/overseer/NodeMutator.java |   85 ++
 .../solr/cloud/overseer/OverseerAction.java     |    6 +-
 .../solr/cloud/overseer/ReplicaMutator.java     |    7 +-
 .../solr/cloud/overseer/SliceMutator.java       |    7 +-
 .../solr/cloud/overseer/ZkStateWriter.java      |    3 +-
 .../solr/cloud/overseer/ZkWriteCommand.java     |    3 +-
 .../apache/solr/cloud/rule/ImplicitSnitch.java  |   84 +-
 .../apache/solr/cloud/rule/RemoteCallback.java  |    3 +-
 .../apache/solr/cloud/rule/ReplicaAssigner.java |   29 +-
 .../java/org/apache/solr/cloud/rule/Rule.java   |    4 +-
 .../java/org/apache/solr/cloud/rule/Snitch.java |    3 +-
 .../apache/solr/cloud/rule/SnitchContext.java   |    3 +-
 .../solr/core/AbstractSolrEventListener.java    |    1 -
 .../org/apache/solr/core/BlobRepository.java    |  254 ++++
 .../solr/core/CachingDirectoryFactory.java      |    3 +-
 .../java/org/apache/solr/core/CloseHook.java    |    4 +-
 .../java/org/apache/solr/core/CloudConfig.java  |   45 +-
 .../java/org/apache/solr/core/CodecFactory.java |    3 +-
 .../src/java/org/apache/solr/core/Config.java   |    1 -
 .../org/apache/solr/core/ConfigOverlay.java     |   72 +-
 .../java/org/apache/solr/core/ConfigSet.java    |    1 -
 .../apache/solr/core/ConfigSetProperties.java   |    1 -
 .../org/apache/solr/core/ConfigSetService.java  |    1 -
 .../org/apache/solr/core/CoreContainer.java     |   60 +-
 .../org/apache/solr/core/CoreDescriptor.java    |    1 -
 .../apache/solr/core/CorePropertiesLocator.java |    3 +-
 .../java/org/apache/solr/core/CoresLocator.java |    3 +-
 .../java/org/apache/solr/core/Diagnostics.java  |    4 +-
 .../org/apache/solr/core/DirectoryFactory.java  |    3 +-
 .../solr/core/EphemeralDirectoryFactory.java    |    3 +-
 .../apache/solr/core/HdfsDirectoryFactory.java  |    3 +-
 .../solr/core/IndexDeletionPolicyWrapper.java   |    3 +-
 .../apache/solr/core/IndexReaderFactory.java    |    3 +-
 .../java/org/apache/solr/core/InitParams.java   |    3 +-
 .../org/apache/solr/core/JarRepository.java     |  223 ----
 .../apache/solr/core/MMapDirectoryFactory.java  |    4 +-
 .../org/apache/solr/core/MapSerializable.java   |    4 +-
 .../org/apache/solr/core/MemClassLoader.java    |    3 +-
 .../apache/solr/core/NIOFSDirectoryFactory.java |    3 +-
 .../solr/core/NRTCachingDirectoryFactory.java   |    1 -
 .../java/org/apache/solr/core/NodeConfig.java   |    3 +-
 .../java/org/apache/solr/core/PluginBag.java    |   14 +-
 .../apache/solr/core/QuerySenderListener.java   |    1 -
 .../apache/solr/core/RAMDirectoryFactory.java   |    1 -
 .../org/apache/solr/core/RequestHandlers.java   |    3 +-
 .../org/apache/solr/core/RequestParams.java     |  129 +-
 .../apache/solr/core/RunExecutableListener.java |    1 -
 .../apache/solr/core/SchemaCodecFactory.java    |   33 +-
 .../solr/core/SimpleFSDirectoryFactory.java     |    3 +-
 .../java/org/apache/solr/core/SolrConfig.java   |    1 -
 .../src/java/org/apache/solr/core/SolrCore.java |   17 +-
 .../java/org/apache/solr/core/SolrCores.java    |   39 +-
 .../apache/solr/core/SolrDeletionPolicy.java    |    3 +-
 .../org/apache/solr/core/SolrEventListener.java |    1 -
 .../org/apache/solr/core/SolrInfoMBean.java     |    1 -
 .../apache/solr/core/SolrResourceLoader.java    |    3 +-
 .../core/SolrResourceNotFoundException.java     |    1 -
 .../org/apache/solr/core/SolrXmlConfig.java     |    9 +-
 .../solr/core/StandardDirectoryFactory.java     |    3 +-
 .../solr/core/StandardIndexReaderFactory.java   |    4 +-
 .../java/org/apache/solr/core/ZkContainer.java  |    3 +-
 .../handler/AnalysisRequestHandlerBase.java     |    1 -
 .../org/apache/solr/handler/BlobHandler.java    |    3 +-
 .../apache/solr/handler/CdcrBufferManager.java  |    3 +-
 .../solr/handler/CdcrBufferStateManager.java    |    4 +-
 .../solr/handler/CdcrLeaderStateManager.java    |    8 +-
 .../org/apache/solr/handler/CdcrParams.java     |    3 +-
 .../solr/handler/CdcrProcessStateManager.java   |    8 +-
 .../org/apache/solr/handler/CdcrReplicator.java |    3 +-
 .../solr/handler/CdcrReplicatorManager.java     |    3 +-
 .../solr/handler/CdcrReplicatorScheduler.java   |    3 +-
 .../solr/handler/CdcrReplicatorState.java       |    3 +-
 .../apache/solr/handler/CdcrRequestHandler.java |    3 +-
 .../apache/solr/handler/CdcrStateManager.java   |    3 +-
 .../solr/handler/CdcrUpdateLogSynchronizer.java |   15 +-
 .../solr/handler/ContentStreamHandlerBase.java  |    3 +-
 .../solr/handler/ContentStreamLoader.java       |    4 +-
 .../handler/DocumentAnalysisRequestHandler.java |    1 -
 .../apache/solr/handler/DumpRequestHandler.java |    1 -
 .../handler/FieldAnalysisRequestHandler.java    |    1 -
 .../solr/handler/MoreLikeThisHandler.java       |    1 -
 .../solr/handler/NestedRequestHandler.java      |    3 +-
 .../solr/handler/NotFoundRequestHandler.java    |    3 +-
 .../apache/solr/handler/OldBackupDirectory.java |    3 +-
 .../apache/solr/handler/PingRequestHandler.java |    8 +-
 .../apache/solr/handler/RealTimeGetHandler.java |    1 -
 .../apache/solr/handler/RequestHandlerBase.java |    1 -
 .../solr/handler/RequestHandlerUtils.java       |    1 -
 .../org/apache/solr/handler/RestoreCore.java    |    4 +-
 .../org/apache/solr/handler/SQLHandler.java     |  215 ++-
 .../org/apache/solr/handler/SchemaHandler.java  |   12 +-
 .../apache/solr/handler/SolrConfigHandler.java  |   52 +-
 .../solr/handler/StandardRequestHandler.java    |    1 -
 .../org/apache/solr/handler/StreamHandler.java  |   12 +-
 .../solr/handler/UpdateRequestHandler.java      |    1 -
 .../solr/handler/admin/AdminHandlers.java       |    1 -
 .../solr/handler/admin/ClusterStatus.java       |    4 +-
 .../solr/handler/admin/CollectionsHandler.java  |  202 ++-
 .../solr/handler/admin/ConfigSetsHandler.java   |    7 +-
 .../solr/handler/admin/CoreAdminHandler.java    |    1 -
 .../solr/handler/admin/CoreAdminOperation.java  |   11 +-
 .../apache/solr/handler/admin/InfoHandler.java  |    3 +-
 .../solr/handler/admin/LoggingHandler.java      |    3 +-
 .../solr/handler/admin/LukeRequestHandler.java  |   21 +-
 .../solr/handler/admin/PluginInfoHandler.java   |    1 -
 .../handler/admin/PropertiesRequestHandler.java |    1 -
 .../solr/handler/admin/RebalanceLeaders.java    |   33 +-
 .../solr/handler/admin/SecurityConfHandler.java |    3 +-
 .../admin/SegmentsInfoRequestHandler.java       |   33 +-
 .../handler/admin/ShowFileRequestHandler.java   |    1 -
 .../handler/admin/SolrInfoMBeanHandler.java     |    3 +-
 .../solr/handler/admin/SystemInfoHandler.java   |    1 -
 .../solr/handler/admin/ThreadDumpHandler.java   |    1 -
 .../handler/admin/ZookeeperInfoHandler.java     |    5 +-
 .../handler/component/DateFacetProcessor.java   |    3 +-
 .../solr/handler/component/DebugComponent.java  |    1 -
 .../solr/handler/component/ExpandComponent.java |    1 -
 .../solr/handler/component/FacetComponent.java  |    1 -
 .../solr/handler/component/FieldFacetStats.java |    3 +-
 .../handler/component/HighlightComponent.java   |    1 -
 .../handler/component/HttpShardHandler.java     |    3 +-
 .../component/HttpShardHandlerFactory.java      |    3 +-
 .../component/IterativeMergeStrategy.java       |   31 +-
 .../solr/handler/component/MergeStrategy.java   |   31 +-
 .../component/MoreLikeThisComponent.java        |    1 -
 .../solr/handler/component/PivotFacet.java      |    1 -
 .../solr/handler/component/PivotFacetField.java |    1 -
 .../PivotFacetFieldValueCollection.java         |    3 +-
 .../handler/component/PivotFacetHelper.java     |    1 -
 .../handler/component/PivotFacetProcessor.java  |    3 +-
 .../solr/handler/component/PivotFacetValue.java |    3 +-
 .../solr/handler/component/QueryComponent.java  |   90 +-
 .../component/QueryElevationComponent.java      |    1 -
 .../handler/component/RangeFacetProcessor.java  |    3 +-
 .../handler/component/RangeFacetRequest.java    |    7 +-
 .../handler/component/RealTimeGetComponent.java |   11 +-
 .../solr/handler/component/ResponseBuilder.java |    9 +-
 .../handler/component/ResponseLogComponent.java |    3 +-
 .../solr/handler/component/SearchComponent.java |    1 -
 .../solr/handler/component/SearchHandler.java   |   20 +-
 .../apache/solr/handler/component/ShardDoc.java |  166 +--
 .../component/ShardFieldSortedHitQueue.java     |  178 +++
 .../solr/handler/component/ShardHandler.java    |    4 +-
 .../handler/component/ShardHandlerFactory.java  |    4 +-
 .../solr/handler/component/ShardResponse.java   |    3 +-
 .../handler/component/SpatialHeatmapFacets.java |    3 +-
 .../handler/component/SpellCheckComponent.java  |    1 -
 .../handler/component/SpellCheckMergeData.java  |    3 +-
 .../solr/handler/component/StatsComponent.java  |    1 -
 .../solr/handler/component/StatsField.java      |    1 -
 .../solr/handler/component/StatsValues.java     |    2 -
 .../handler/component/StatsValuesFactory.java   |    3 +-
 .../handler/component/SuggestComponent.java     |    3 +-
 .../handler/component/TermVectorComponent.java  |   34 +-
 .../solr/handler/component/TermsComponent.java  |    3 +-
 .../apache/solr/handler/loader/CSVLoader.java   |    1 -
 .../solr/handler/loader/CSVLoaderBase.java      |    1 -
 .../handler/loader/ContentStreamLoader.java     |    4 +-
 .../solr/handler/loader/JavabinLoader.java      |    1 -
 .../apache/solr/handler/loader/JsonLoader.java  |    3 +-
 .../apache/solr/handler/loader/XMLLoader.java   |    3 +-
 .../highlight/BreakIteratorBoundaryScanner.java |    1 -
 .../apache/solr/highlight/DefaultEncoder.java   |    1 -
 .../solr/highlight/HighlightingPluginBase.java  |    1 -
 .../org/apache/solr/highlight/HtmlEncoder.java  |    1 -
 .../solr/highlight/PostingsSolrHighlighter.java |    3 +-
 .../highlight/ScoreOrderFragmentsBuilder.java   |    1 -
 .../solr/highlight/SimpleBoundaryScanner.java   |    1 -
 .../solr/highlight/SimpleFragListBuilder.java   |    1 -
 .../solr/highlight/SimpleFragmentsBuilder.java  |    1 -
 .../solr/highlight/SingleFragListBuilder.java   |    1 -
 .../solr/highlight/SolrBoundaryScanner.java     |    1 -
 .../org/apache/solr/highlight/SolrEncoder.java  |    1 -
 .../apache/solr/highlight/SolrFormatter.java    |    1 -
 .../solr/highlight/SolrFragListBuilder.java     |    1 -
 .../apache/solr/highlight/SolrFragmenter.java   |    1 -
 .../solr/highlight/SolrFragmentsBuilder.java    |    1 -
 .../apache/solr/highlight/SolrHighlighter.java  |    3 +-
 .../solr/highlight/WeightedFragListBuilder.java |    1 -
 .../solr/index/DefaultMergePolicyFactory.java   |   45 +
 .../index/LogByteSizeMergePolicyFactory.java    |   38 +
 .../solr/index/LogDocMergePolicyFactory.java    |   38 +
 .../apache/solr/index/MergePolicyFactory.java   |   40 +
 .../solr/index/MergePolicyFactoryArgs.java      |   66 +
 .../solr/index/SimpleMergePolicyFactory.java    |   42 +
 .../solr/index/SortingMergePolicyFactory.java   |   51 +
 .../solr/index/TieredMergePolicyFactory.java    |   38 +
 .../index/UpgradeIndexMergePolicyFactory.java   |   39 +
 .../solr/index/WrapperMergePolicyFactory.java   |  121 ++
 .../apache/solr/index/hdfs/CheckHdfsIndex.java  |    3 +-
 .../org/apache/solr/index/package-info.java     |   22 +
 .../org/apache/solr/internal/csv/CSVParser.java |    6 +-
 .../apache/solr/internal/csv/CSVPrinter.java    |    6 +-
 .../apache/solr/internal/csv/CSVStrategy.java   |    6 +-
 .../org/apache/solr/internal/csv/CSVUtils.java  |    6 +-
 .../apache/solr/internal/csv/CharBuffer.java    |   26 +-
 .../internal/csv/ExtendedBufferedReader.java    |    6 +-
 .../solr/internal/csv/writer/CSVConfig.java     |   26 +-
 .../internal/csv/writer/CSVConfigGuesser.java   |   26 +-
 .../solr/internal/csv/writer/CSVField.java      |   26 +-
 .../solr/internal/csv/writer/CSVWriter.java     |   26 +-
 .../org/apache/solr/logging/CircularList.java   |    1 -
 .../org/apache/solr/logging/ListenerConfig.java |    5 +-
 .../org/apache/solr/logging/LogWatcher.java     |    1 -
 .../apache/solr/logging/LogWatcherConfig.java   |    3 +-
 .../org/apache/solr/logging/LoggerInfo.java     |    1 -
 .../apache/solr/logging/MDCLoggingContext.java  |    3 +-
 .../org/apache/solr/parser/FastCharStream.java  |    5 +-
 .../java/org/apache/solr/parser/QueryParser.jj  |    2 +-
 .../solr/parser/QueryParserTokenManager.java    |  426 +++---
 .../apache/solr/parser/SolrQueryParserBase.java |    1 -
 .../java/org/apache/solr/query/FilterQuery.java |    3 +-
 .../org/apache/solr/query/SolrRangeQuery.java   |    3 +-
 .../apache/solr/request/DocValuesFacets.java    |    3 +-
 .../org/apache/solr/request/DocValuesStats.java |    3 +-
 .../org/apache/solr/request/IntervalFacets.java |   33 +-
 .../solr/request/LocalSolrQueryRequest.java     |    1 -
 .../org/apache/solr/request/NumericFacets.java  |    3 +-
 .../request/PerSegmentSingleValuedFaceting.java |    1 -
 .../org/apache/solr/request/SimpleFacets.java   |   77 +-
 .../apache/solr/request/SolrQueryRequest.java   |    1 -
 .../solr/request/SolrQueryRequestBase.java      |    1 -
 .../apache/solr/request/SolrRequestHandler.java |    1 -
 .../apache/solr/request/SolrRequestInfo.java    |    1 -
 .../org/apache/solr/request/json/JSONUtil.java  |    4 +-
 .../apache/solr/request/json/ObjectUtil.java    |    4 +-
 .../apache/solr/request/json/RequestUtil.java   |    4 +-
 .../solr/request/macro/MacroExpander.java       |    3 +-
 .../solr/response/BasicResultContext.java       |    3 +-
 .../response/BinaryQueryResponseWriter.java     |    4 +-
 .../apache/solr/response/CSVResponseWriter.java |    1 -
 .../org/apache/solr/response/DocsStreamer.java  |    3 +-
 .../solr/response/JSONResponseWriter.java       |    1 -
 .../apache/solr/response/PHPResponseWriter.java |    1 -
 .../response/PHPSerializedResponseWriter.java   |    1 -
 .../solr/response/PythonResponseWriter.java     |    1 -
 .../solr/response/QueryResponseWriter.java      |    1 -
 .../solr/response/QueryResponseWriterUtil.java  |   16 +-
 .../apache/solr/response/RawResponseWriter.java |    1 -
 .../org/apache/solr/response/ResultContext.java |    1 -
 .../solr/response/SchemaXmlResponseWriter.java  |    1 -
 .../apache/solr/response/SchemaXmlWriter.java   |    3 +-
 .../solr/response/SmileResponseWriter.java      |    4 +-
 .../apache/solr/response/SolrQueryResponse.java |    2 +-
 .../solr/response/SortingResponseWriter.java    |  101 +-
 .../solr/response/TextResponseWriter.java       |    1 -
 .../apache/solr/response/XMLResponseWriter.java |    1 -
 .../org/apache/solr/response/XMLWriter.java     |    1 -
 .../solr/response/XSLTResponseWriter.java       |    1 -
 .../transform/BaseEditorialTransformer.java     |    5 +-
 .../solr/response/transform/DocTransformer.java |    1 -
 .../response/transform/DocTransformers.java     |    1 -
 .../transform/ElevatedMarkerFactory.java        |    3 +-
 .../transform/ExcludedMarkerFactory.java        |    3 +-
 .../response/transform/TransformerFactory.java  |    1 -
 .../org/apache/solr/rest/BaseSolrResource.java  |    9 +-
 .../java/org/apache/solr/rest/DELETEable.java   |    3 +-
 .../src/java/org/apache/solr/rest/GETable.java  |    3 +-
 .../org/apache/solr/rest/ManagedResource.java   |    3 +-
 .../solr/rest/ManagedResourceObserver.java      |    3 +-
 .../solr/rest/ManagedResourceStorage.java       |    3 +-
 .../src/java/org/apache/solr/rest/POSTable.java |    3 +-
 .../src/java/org/apache/solr/rest/PUTable.java  |    3 +-
 .../java/org/apache/solr/rest/RestManager.java  |   12 +-
 .../org/apache/solr/rest/SolrSchemaRestApi.java |    3 +-
 .../solr/rest/schema/BaseFieldResource.java     |    3 +-
 .../solr/rest/schema/BaseFieldTypeResource.java |    3 +-
 .../schema/CopyFieldCollectionResource.java     |    4 +-
 .../schema/DynamicFieldCollectionResource.java  |    3 +-
 .../solr/rest/schema/DynamicFieldResource.java  |    4 +-
 .../rest/schema/FieldCollectionResource.java    |    4 +-
 .../apache/solr/rest/schema/FieldResource.java  |    3 +-
 .../schema/FieldTypeCollectionResource.java     |    3 +-
 .../solr/rest/schema/FieldTypeResource.java     |    3 +-
 .../solr/rest/schema/FieldTypeXmlAdapter.java   |    3 +-
 .../analysis/BaseManagedTokenFilterFactory.java |    3 +-
 .../analysis/ManagedStopFilterFactory.java      |    3 +-
 .../analysis/ManagedSynonymFilterFactory.java   |    3 +-
 .../schema/analysis/ManagedWordSetResource.java |    3 +-
 .../solr/schema/AbstractSpatialFieldType.java   |    3 +-
 .../AbstractSpatialPrefixTreeFieldType.java     |    3 +-
 .../solr/schema/AbstractSubTypeFieldType.java   |    3 +-
 .../java/org/apache/solr/schema/BBoxField.java  |    3 +-
 .../org/apache/solr/schema/BinaryField.java     |    1 -
 .../java/org/apache/solr/schema/BoolField.java  |    1 -
 .../solr/schema/ClassicIndexSchemaFactory.java  |    3 +-
 .../org/apache/solr/schema/CollationField.java  |    3 +-
 .../apache/solr/schema/CoordinateFieldType.java |    1 -
 .../java/org/apache/solr/schema/CopyField.java  |    1 -
 .../org/apache/solr/schema/CurrencyField.java   |    3 +-
 .../org/apache/solr/schema/DateRangeField.java  |    3 +-
 .../apache/solr/schema/DateValueFieldType.java  |    1 -
 .../solr/schema/DoubleValueFieldType.java       |    1 -
 .../java/org/apache/solr/schema/EnumField.java  |   14 +-
 .../solr/schema/ExchangeRateProvider.java       |    3 +-
 .../solr/schema/ExternalFileFieldReloader.java  |    1 -
 .../org/apache/solr/schema/FieldProperties.java |    1 -
 .../java/org/apache/solr/schema/FieldType.java  |    1 -
 .../solr/schema/FieldTypePluginLoader.java      |    1 -
 .../apache/solr/schema/FloatValueFieldType.java |    1 -
 .../org/apache/solr/schema/GeoHashField.java    |    1 -
 .../org/apache/solr/schema/IndexSchema.java     |    1 -
 .../apache/solr/schema/IndexSchemaFactory.java  |    3 +-
 .../apache/solr/schema/IntValueFieldType.java   |    1 -
 .../solr/schema/JsonPreAnalyzedParser.java      |   33 +-
 .../java/org/apache/solr/schema/LatLonType.java |    3 +-
 .../apache/solr/schema/LongValueFieldType.java  |    1 -
 .../apache/solr/schema/ManagedIndexSchema.java  |    7 +-
 .../solr/schema/ManagedIndexSchemaFactory.java  |    3 +-
 .../solr/schema/NumericValueFieldType.java      |    1 -
 .../schema/OpenExchangeRatesOrgProvider.java    |    3 +-
 .../java/org/apache/solr/schema/PointType.java  |    1 -
 .../apache/solr/schema/PreAnalyzedField.java    |    3 +-
 .../apache/solr/schema/PrimitiveFieldType.java  |    1 -
 .../org/apache/solr/schema/RandomSortField.java |    1 -
 .../schema/RptWithGeometrySpatialField.java     |    3 +-
 .../org/apache/solr/schema/SchemaAware.java     |    4 +-
 .../org/apache/solr/schema/SchemaField.java     |    1 -
 .../org/apache/solr/schema/SchemaManager.java   |    4 +-
 .../apache/solr/schema/SimilarityFactory.java   |    3 +-
 .../solr/schema/SimplePreAnalyzedParser.java    |    3 +-
 .../schema/SpatialPointVectorFieldType.java     |    3 +-
 .../apache/solr/schema/SpatialQueryable.java    |    4 +-
 .../SpatialRecursivePrefixTreeFieldType.java    |    3 +-
 .../SpatialTermQueryPrefixTreeFieldType.java    |    1 -
 .../java/org/apache/solr/schema/StrField.java   |    1 -
 .../org/apache/solr/schema/StrFieldSource.java  |    1 -
 .../java/org/apache/solr/schema/TextField.java  |    1 -
 .../org/apache/solr/schema/TrieDateField.java   |    1 -
 .../org/apache/solr/schema/TrieDoubleField.java |    1 -
 .../java/org/apache/solr/schema/TrieField.java  |   26 +-
 .../org/apache/solr/schema/TrieFloatField.java  |    1 -
 .../org/apache/solr/schema/TrieIntField.java    |    1 -
 .../org/apache/solr/schema/TrieLongField.java   |    1 -
 .../java/org/apache/solr/schema/UUIDField.java  |    3 +-
 .../apache/solr/schema/ZkIndexSchemaReader.java |    3 +-
 .../org/apache/solr/search/AnalyticsQuery.java  |   31 +-
 .../java/org/apache/solr/search/BitDocSet.java  |    1 -
 .../solr/search/BitsFilteredDocIdSet.java       |    3 +-
 .../solr/search/BitsFilteredPostingsEnum.java   |    3 +-
 .../apache/solr/search/BoostQParserPlugin.java  |    4 -
 .../org/apache/solr/search/CacheConfig.java     |    1 -
 .../apache/solr/search/CacheRegenerator.java    |    1 -
 .../solr/search/CollapsingQParserPlugin.java    |    5 -
 .../solr/search/ComplexPhraseQParserPlugin.java |    4 +-
 .../java/org/apache/solr/search/CursorMark.java |    1 -
 .../apache/solr/search/DelegatingCollector.java |    1 -
 .../apache/solr/search/DisMaxQParserPlugin.java |    4 -
 .../org/apache/solr/search/DocIterator.java     |    1 -
 .../java/org/apache/solr/search/DocList.java    |    1 -
 .../org/apache/solr/search/DocListAndSet.java   |    1 -
 .../src/java/org/apache/solr/search/DocSet.java |    1 -
 .../java/org/apache/solr/search/DocSetBase.java |    1 -
 .../org/apache/solr/search/DocSetBuilder.java   |    3 +-
 .../org/apache/solr/search/DocSetCollector.java |    3 +-
 .../org/apache/solr/search/DocSetProducer.java  |    3 +-
 .../java/org/apache/solr/search/DocSetUtil.java |    4 +-
 .../java/org/apache/solr/search/DocSlice.java   |    1 -
 .../solr/search/EarlyTerminatingCollector.java  |    3 +-
 .../EarlyTerminatingCollectorException.java     |    4 +-
 .../apache/solr/search/ExportQParserPlugin.java |    4 -
 .../solr/search/ExtendedDismaxQParser.java      |    1 -
 .../search/ExtendedDismaxQParserPlugin.java     |    5 -
 .../org/apache/solr/search/ExtendedQuery.java   |    1 -
 .../apache/solr/search/ExtendedQueryBase.java   |    1 -
 .../org/apache/solr/search/FastLRUCache.java    |    3 +-
 .../org/apache/solr/search/FieldParams.java     |    3 +-
 .../apache/solr/search/FieldQParserPlugin.java  |    4 -
 .../src/java/org/apache/solr/search/Filter.java |    3 +-
 .../apache/solr/search/FilteredDocIdSet.java    |    3 +-
 .../solr/search/FunctionQParserPlugin.java      |    4 -
 .../solr/search/FunctionRangeQParserPlugin.java |    4 -
 .../apache/solr/search/FunctionRangeQuery.java  |    1 -
 .../java/org/apache/solr/search/Grouping.java   |    1 -
 .../java/org/apache/solr/search/HashDocSet.java |    1 -
 .../apache/solr/search/HashQParserPlugin.java   |    5 -
 .../java/org/apache/solr/search/Insanity.java   |    3 +-
 .../apache/solr/search/JoinQParserPlugin.java   |    4 -
 .../java/org/apache/solr/search/LFUCache.java   |    3 +-
 .../java/org/apache/solr/search/LRUCache.java   |    1 -
 .../apache/solr/search/LuceneQParserPlugin.java |    4 -
 .../apache/solr/search/NestedQParserPlugin.java |    4 -
 .../org/apache/solr/search/NoOpRegenerator.java |    3 +-
 .../solr/search/OldLuceneQParserPlugin.java     |    4 -
 .../java/org/apache/solr/search/PostFilter.java |    1 -
 .../apache/solr/search/PrefixQParserPlugin.java |    4 -
 .../org/apache/solr/search/QParserPlugin.java   |    4 +
 .../org/apache/solr/search/QueryCommand.java    |   15 +-
 .../org/apache/solr/search/QueryContext.java    |    3 +-
 .../org/apache/solr/search/QueryParsing.java    |    1 -
 .../org/apache/solr/search/QueryResult.java     |   12 +-
 .../org/apache/solr/search/QueryResultKey.java  |    1 -
 .../java/org/apache/solr/search/QueryUtils.java |    1 -
 .../apache/solr/search/QueryWrapperFilter.java  |    3 +-
 .../java/org/apache/solr/search/RankQuery.java  |   31 +-
 .../apache/solr/search/RawQParserPlugin.java    |    4 -
 .../apache/solr/search/ReRankQParserPlugin.java |   29 +-
 .../org/apache/solr/search/ScoreFilter.java     |    1 -
 .../apache/solr/search/SimpleQParserPlugin.java |    8 +-
 .../java/org/apache/solr/search/SolrCache.java  |    1 -
 .../org/apache/solr/search/SolrCacheBase.java   |    1 -
 .../solr/search/SolrConstantScoreQuery.java     |   31 +-
 .../org/apache/solr/search/SolrCoreParser.java  |    3 +-
 .../apache/solr/search/SolrFieldCacheMBean.java |    1 -
 .../java/org/apache/solr/search/SolrFilter.java |    1 -
 .../apache/solr/search/SolrIndexSearcher.java   |   39 +-
 .../org/apache/solr/search/SolrQueryParser.java |    1 -
 .../solr/search/SolrQueryTimeoutImpl.java       |    3 +-
 .../java/org/apache/solr/search/SortSpec.java   |    1 -
 .../org/apache/solr/search/SortSpecParsing.java |   31 +-
 .../org/apache/solr/search/SortedIntDocSet.java |    1 -
 .../java/org/apache/solr/search/Sorting.java    |    1 -
 .../solr/search/SpatialBoxQParserPlugin.java    |    6 -
 .../solr/search/SpatialFilterQParser.java       |    4 +-
 .../solr/search/SpatialFilterQParserPlugin.java |    8 +-
 .../org/apache/solr/search/SpatialOptions.java  |    3 +-
 .../java/org/apache/solr/search/StrParser.java  |    7 +-
 .../solr/search/SurroundQParserPlugin.java      |    8 +-
 .../apache/solr/search/SwitchQParserPlugin.java |    4 -
 .../org/apache/solr/search/SyntaxError.java     |    1 -
 .../apache/solr/search/TermQParserPlugin.java   |    4 -
 .../apache/solr/search/TermsQParserPlugin.java  |    7 +-
 .../org/apache/solr/search/WrappedQuery.java    |    1 -
 .../apache/solr/search/XmlQParserPlugin.java    |    7 +-
 .../solr/search/facet/AggValueSource.java       |    3 +-
 .../org/apache/solr/search/facet/AvgAgg.java    |    3 +-
 .../org/apache/solr/search/facet/BlockJoin.java |    4 +-
 .../org/apache/solr/search/facet/CountAgg.java  |    3 +-
 .../solr/search/facet/FacetDebugInfo.java       |    1 -
 .../apache/solr/search/facet/FacetField.java    |    3 +-
 .../search/facet/FacetFieldProcessorDV.java     |    3 +-
 .../facet/FacetFieldProcessorNumeric.java       |    3 +-
 .../apache/solr/search/facet/FacetMerger.java   |    3 +-
 .../apache/solr/search/facet/FacetModule.java   |    3 +-
 .../solr/search/facet/FacetProcessor.java       |   25 +-
 .../apache/solr/search/facet/FacetQuery.java    |    3 +-
 .../apache/solr/search/facet/FacetRange.java    |    3 +-
 .../apache/solr/search/facet/FacetRequest.java  |   13 +-
 .../org/apache/solr/search/facet/FieldUtil.java |    3 +-
 .../org/apache/solr/search/facet/HLLAgg.java    |    3 +-
 .../apache/solr/search/facet/LegacyFacet.java   |    4 +-
 .../org/apache/solr/search/facet/MaxAgg.java    |    3 +-
 .../org/apache/solr/search/facet/MinAgg.java    |    3 +-
 .../apache/solr/search/facet/PercentileAgg.java |    3 +-
 .../solr/search/facet/SimpleAggValueSource.java |    3 +-
 .../org/apache/solr/search/facet/SlotAcc.java   |    3 +-
 .../solr/search/facet/StrAggValueSource.java    |    3 +-
 .../org/apache/solr/search/facet/SumAgg.java    |    3 +-
 .../org/apache/solr/search/facet/SumsqAgg.java  |    3 +-
 .../solr/search/facet/UnInvertedField.java      |    1 -
 .../org/apache/solr/search/facet/UniqueAgg.java |    3 +-
 .../apache/solr/search/facet/UniqueSlotAcc.java |    3 +-
 .../search/function/CollapseScoreFunction.java  |    1 -
 .../solr/search/function/OrdFieldSource.java    |    1 -
 .../search/function/ReverseOrdFieldSource.java  |    1 -
 .../search/function/ValueSourceRangeFilter.java |    1 -
 .../distance/GeoDistValueSourceParser.java      |    3 +-
 .../function/distance/GeohashFunction.java      |    3 +-
 .../distance/GeohashHaversineFunction.java      |    4 +-
 .../distance/HaversineConstFunction.java        |    3 +-
 .../function/distance/HaversineFunction.java    |    3 +-
 .../distance/SquaredEuclideanFunction.java      |    3 +-
 .../distance/StringDistanceFunction.java        |    3 +-
 .../distance/VectorDistanceFunction.java        |    3 +-
 .../apache/solr/search/grouping/Command.java    |    3 +-
 .../solr/search/grouping/CommandHandler.java    |    3 +-
 .../search/grouping/GroupingSpecification.java  |    3 +-
 .../grouping/collector/FilterCollector.java     |    3 +-
 .../distributed/ShardRequestFactory.java        |    3 +-
 .../distributed/ShardResponseProcessor.java     |    3 +-
 .../distributed/command/GroupConverter.java     |    3 +-
 .../distributed/command/QueryCommand.java       |    3 +-
 .../distributed/command/QueryCommandResult.java |    3 +-
 .../command/SearchGroupsFieldCommand.java       |    3 +-
 .../command/SearchGroupsFieldCommandResult.java |    3 +-
 .../command/TopGroupsFieldCommand.java          |    3 +-
 .../SearchGroupsRequestFactory.java             |    3 +-
 .../StoredFieldsShardRequestFactory.java        |    3 +-
 .../TopGroupsShardRequestFactory.java           |    3 +-
 .../SearchGroupShardResponseProcessor.java      |    3 +-
 .../StoredFieldsShardResponseProcessor.java     |    3 +-
 .../TopGroupsShardResponseProcessor.java        |    3 +-
 .../SearchGroupsResultTransformer.java          |    3 +-
 .../ShardResultTransformer.java                 |    3 +-
 .../TopGroupsResultTransformer.java             |    3 +-
 .../EndResultTransformer.java                   |    3 +-
 .../GroupedEndResultTransformer.java            |    3 +-
 .../MainEndResultTransformer.java               |    3 +-
 .../SimpleEndResultTransformer.java             |    3 +-
 .../apache/solr/search/join/BitSetSlice.java    |    1 -
 .../solr/search/join/BlockJoinChildQParser.java |    1 -
 .../join/BlockJoinChildQParserPlugin.java       |    1 -
 .../join/BlockJoinDocSetFacetComponent.java     |   33 +-
 .../search/join/BlockJoinFacetCollector.java    |    3 +-
 .../search/join/BlockJoinFacetComponent.java    |    3 +-
 .../solr/search/join/BlockJoinFacetFilter.java  |    3 +-
 .../join/BlockJoinFieldFacetAccumulator.java    |    3 +-
 .../search/join/BlockJoinParentQParser.java     |    1 -
 .../join/BlockJoinParentQParserPlugin.java      |    5 -
 .../apache/solr/search/join/FrontierQuery.java  |    3 +-
 .../solr/search/join/GraphQParserPlugin.java    |    7 +-
 .../org/apache/solr/search/join/GraphQuery.java |   92 +-
 .../solr/search/join/GraphQueryParser.java      |    3 +-
 .../solr/search/join/GraphTermsCollector.java   |    5 +-
 .../search/join/ScoreJoinQParserPlugin.java     |    5 -
 .../solr/search/join/ScoreModeParser.java       |   19 +-
 .../apache/solr/search/mlt/CloudMLTQParser.java |    3 +-
 .../solr/search/mlt/MLTQParserPlugin.java       |    8 +-
 .../solr/search/mlt/SimpleMLTQParser.java       |    3 +-
 .../similarities/BM25SimilarityFactory.java     |    3 +-
 .../similarities/ClassicSimilarityFactory.java  |    3 +-
 .../similarities/DFISimilarityFactory.java      |    3 +-
 .../similarities/DFRSimilarityFactory.java      |    3 +-
 .../similarities/IBSimilarityFactory.java       |    3 +-
 .../LMDirichletSimilarityFactory.java           |    3 +-
 .../LMJelinekMercerSimilarityFactory.java       |    3 +-
 .../similarities/SchemaSimilarityFactory.java   |    3 +-
 .../SweetSpotSimilarityFactory.java             |    3 +-
 .../solr/search/stats/CachedSearcherStats.java  |    3 +-
 .../solr/search/stats/CollectionStats.java      |    5 +-
 .../search/stats/ExactSharedStatsCache.java     |    3 +-
 .../solr/search/stats/ExactStatsCache.java      |    3 +-
 .../apache/solr/search/stats/LRUStatsCache.java |    3 +-
 .../solr/search/stats/LocalStatsCache.java      |    7 +-
 .../solr/search/stats/LocalStatsSource.java     |    3 +-
 .../apache/solr/search/stats/StatsCache.java    |    3 +-
 .../apache/solr/search/stats/StatsSource.java   |    3 +-
 .../org/apache/solr/search/stats/StatsUtil.java |    7 +-
 .../org/apache/solr/search/stats/TermStats.java |    3 +-
 .../solr/security/AuthenticationPlugin.java     |   33 +-
 .../solr/security/AuthorizationContext.java     |    3 +-
 .../solr/security/AuthorizationPlugin.java      |    3 +-
 .../solr/security/AuthorizationResponse.java    |    3 +-
 .../apache/solr/security/BasicAuthPlugin.java   |    4 +-
 .../solr/security/ConfigEditablePlugin.java     |    3 +-
 .../security/HttpClientInterceptorPlugin.java   |    4 +-
 .../apache/solr/security/KerberosFilter.java    |   25 +-
 .../apache/solr/security/KerberosPlugin.java    |   33 +-
 .../solr/security/PKIAuthenticationPlugin.java  |    3 +-
 .../security/RuleBasedAuthorizationPlugin.java  |   42 +-
 .../solr/security/SecurityPluginHolder.java     |    4 +-
 .../security/Sha256AuthenticationProvider.java  |    3 +-
 .../org/apache/solr/servlet/BaseSolrFilter.java |    1 -
 .../apache/solr/servlet/BaseSolrServlet.java    |    1 -
 .../solr/servlet/CheckLoggingConfiguration.java |    1 -
 .../solr/servlet/DirectSolrConnection.java      |    1 -
 .../org/apache/solr/servlet/HttpSolrCall.java   |   42 +-
 .../apache/solr/servlet/LoadAdminUiServlet.java |    1 -
 .../apache/solr/servlet/RedirectServlet.java    |    1 -
 .../org/apache/solr/servlet/ResponseUtils.java  |   11 +-
 .../apache/solr/servlet/SolrDispatchFilter.java |  110 +-
 .../apache/solr/servlet/SolrRequestParsers.java |    1 -
 .../solr/servlet/cache/HttpCacheHeaderUtil.java |    1 -
 .../org/apache/solr/servlet/cache/Method.java   |    1 -
 .../spelling/AbstractLuceneSpellChecker.java    |   13 +-
 .../spelling/ConjunctionSolrSpellChecker.java   |    3 +-
 .../solr/spelling/DirectSolrSpellChecker.java   |    3 +-
 .../solr/spelling/IndexBasedSpellChecker.java   |    3 +-
 .../solr/spelling/PossibilityIterator.java      |    3 +-
 .../apache/solr/spelling/QueryConverter.java    |    3 +-
 .../org/apache/solr/spelling/ResultEntry.java   |    3 +-
 .../apache/solr/spelling/SolrSpellChecker.java  |    3 +-
 .../solr/spelling/SpellCheckCollation.java      |    3 +-
 .../solr/spelling/SpellCheckCollator.java       |    3 +-
 .../solr/spelling/SpellCheckCorrection.java     |    3 +-
 .../apache/solr/spelling/SpellingOptions.java   |   17 +-
 .../solr/spelling/SpellingQueryConverter.java   |    1 -
 .../apache/solr/spelling/SpellingResult.java    |    3 +-
 .../solr/spelling/SuggestQueryConverter.java    |    3 +-
 .../spelling/WordBreakSolrSpellChecker.java     |    3 +-
 .../spelling/suggest/DictionaryFactory.java     |    3 +-
 .../suggest/DocumentDictionaryFactory.java      |    3 +-
 .../DocumentExpressionDictionaryFactory.java    |    3 +-
 .../spelling/suggest/FileDictionaryFactory.java |    3 +-
 .../suggest/HighFrequencyDictionaryFactory.java |    3 +-
 .../solr/spelling/suggest/LookupFactory.java    |    3 +-
 .../solr/spelling/suggest/SolrSuggester.java    |    3 +-
 .../apache/solr/spelling/suggest/Suggester.java |    1 -
 .../solr/spelling/suggest/SuggesterOptions.java |    3 +-
 .../solr/spelling/suggest/SuggesterParams.java  |    3 +-
 .../solr/spelling/suggest/SuggesterResult.java  |    3 +-
 .../fst/AnalyzingInfixLookupFactory.java        |    3 +-
 .../suggest/fst/AnalyzingLookupFactory.java     |    3 +-
 .../suggest/fst/BlendedInfixLookupFactory.java  |    3 +-
 .../spelling/suggest/fst/FSTLookupFactory.java  |    3 +-
 .../suggest/fst/FreeTextLookupFactory.java      |   23 +-
 .../suggest/fst/FuzzyLookupFactory.java         |    3 +-
 .../spelling/suggest/fst/WFSTLookupFactory.java |    3 +-
 .../suggest/jaspell/JaspellLookupFactory.java   |    7 +-
 .../spelling/suggest/tst/TSTLookupFactory.java  |    3 +-
 .../solr/store/blockcache/BlockCache.java       |    3 +-
 .../solr/store/blockcache/BlockCacheKey.java    |    4 +-
 .../store/blockcache/BlockCacheLocation.java    |    3 +-
 .../solr/store/blockcache/BlockDirectory.java   |    5 +-
 .../store/blockcache/BlockDirectoryCache.java   |    3 +-
 .../solr/store/blockcache/BlockLocks.java       |    3 +-
 .../solr/store/blockcache/BufferStore.java      |    3 +-
 .../org/apache/solr/store/blockcache/Cache.java |    3 +-
 .../store/blockcache/CachedIndexOutput.java     |    3 +-
 .../blockcache/CustomBufferedIndexInput.java    |    3 +-
 .../apache/solr/store/blockcache/Metrics.java   |    3 +-
 .../blockcache/ReusedBufferedIndexOutput.java   |    3 +-
 .../org/apache/solr/store/blockcache/Store.java |    3 +-
 .../apache/solr/store/hdfs/HdfsDirectory.java   |    3 +-
 .../apache/solr/store/hdfs/HdfsFileReader.java  |    3 +-
 .../apache/solr/store/hdfs/HdfsFileWriter.java  |    3 +-
 .../solr/store/hdfs/HdfsLocalityReporter.java   |    3 +-
 .../apache/solr/store/hdfs/HdfsLockFactory.java |    3 +-
 .../apache/solr/update/AddUpdateCommand.java    |    1 -
 .../apache/solr/update/CdcrTransactionLog.java  |    3 +-
 .../org/apache/solr/update/CdcrUpdateLog.java   |    3 +-
 .../org/apache/solr/update/CommitTracker.java   |    7 +-
 .../apache/solr/update/CommitUpdateCommand.java |    1 -
 .../solr/update/DefaultSolrCoreState.java       |   21 +-
 .../solr/update/DeleteByQueryWrapper.java       |    3 +-
 .../apache/solr/update/DeleteUpdateCommand.java |    1 -
 .../solr/update/DirectUpdateHandler2.java       |    7 +-
 .../org/apache/solr/update/DocumentBuilder.java |    1 -
 .../apache/solr/update/HdfsTransactionLog.java  |   37 +-
 .../org/apache/solr/update/HdfsUpdateLog.java   |    1 -
 .../apache/solr/update/IndexFingerprint.java    |  201 +++
 .../apache/solr/update/LoggingInfoStream.java   |    1 -
 .../org/apache/solr/update/MemOutputStream.java |    1 -
 .../apache/solr/update/MergeIndexesCommand.java |    1 -
 .../java/org/apache/solr/update/PeerSync.java   |   79 +-
 .../solr/update/RollbackUpdateCommand.java      |    1 -
 .../apache/solr/update/SolrCmdDistributor.java  |   11 +-
 .../org/apache/solr/update/SolrCoreState.java   |   11 +-
 .../org/apache/solr/update/SolrIndexConfig.java |  110 +-
 .../apache/solr/update/SolrIndexSplitter.java   |    1 -
 .../org/apache/solr/update/SolrIndexWriter.java |    1 -
 .../apache/solr/update/SplitIndexCommand.java   |    1 -
 .../solr/update/StreamingSolrClients.java       |    7 +-
 .../org/apache/solr/update/TransactionLog.java  |    1 -
 .../org/apache/solr/update/UpdateCommand.java   |    1 -
 .../org/apache/solr/update/UpdateHandler.java   |    1 -
 .../java/org/apache/solr/update/UpdateLog.java  |    9 +-
 .../apache/solr/update/UpdateShardHandler.java  |    3 +-
 .../solr/update/UpdateShardHandlerConfig.java   |    3 +-
 .../org/apache/solr/update/VersionBucket.java   |    1 -
 .../org/apache/solr/update/VersionInfo.java     |    1 -
 ...tractDefaultValueUpdateProcessorFactory.java |    1 -
 .../AddSchemaFieldsUpdateProcessorFactory.java  |    1 -
 ...aluesOrNoneFieldMutatingUpdateProcessor.java |    1 -
 .../processor/AtomicUpdateDocumentMerger.java   |    7 +-
 .../update/processor/CdcrUpdateProcessor.java   |    3 +-
 .../processor/CdcrUpdateProcessorFactory.java   |    3 +-
 .../ConcatFieldUpdateProcessorFactory.java      |    1 -
 .../CountFieldValuesUpdateProcessorFactory.java |    1 -
 .../DefaultValueUpdateProcessorFactory.java     |    1 -
 .../processor/DistributedUpdateProcessor.java   |   19 +-
 .../DistributedUpdateProcessorFactory.java      |    3 +-
 .../DistributingUpdateProcessorFactory.java     |    1 -
 ...BasedVersionConstraintsProcessorFactory.java |    1 -
 .../DocExpirationUpdateProcessorFactory.java    |    1 -
 .../FieldLengthUpdateProcessorFactory.java      |    1 -
 .../processor/FieldMutatingUpdateProcessor.java |    1 -
 .../FieldMutatingUpdateProcessorFactory.java    |    1 -
 ...FieldNameMutatingUpdateProcessorFactory.java |    4 +-
 .../FieldValueMutatingUpdateProcessor.java      |    1 -
 .../FieldValueSubsetUpdateProcessorFactory.java |    1 -
 .../FirstFieldValueUpdateProcessorFactory.java  |    1 -
 .../HTMLStripFieldUpdateProcessorFactory.java   |    1 -
 ...oreCommitOptimizeUpdateProcessorFactory.java |    1 -
 .../IgnoreFieldUpdateProcessorFactory.java      |    1 -
 .../LastFieldValueUpdateProcessorFactory.java   |    1 -
 .../processor/LogUpdateProcessorFactory.java    |    1 -
 .../solr/update/processor/Lookup3Signature.java |    3 +-
 .../solr/update/processor/MD5Signature.java     |    3 +-
 .../MaxFieldValueUpdateProcessorFactory.java    |    1 -
 .../MinFieldValueUpdateProcessorFactory.java    |    1 -
 .../NoOpDistributingUpdateProcessorFactory.java |    1 -
 ...ParseBooleanFieldUpdateProcessorFactory.java |    1 -
 .../ParseDateFieldUpdateProcessorFactory.java   |    1 -
 .../ParseDoubleFieldUpdateProcessorFactory.java |    1 -
 .../ParseFloatFieldUpdateProcessorFactory.java  |    1 -
 .../ParseIntFieldUpdateProcessorFactory.java    |    1 -
 .../ParseLongFieldUpdateProcessorFactory.java   |    1 -
 ...ParseNumericFieldUpdateProcessorFactory.java |    1 -
 .../PreAnalyzedUpdateProcessorFactory.java      |   33 +-
 .../RemoveBlankFieldUpdateProcessorFactory.java |    1 -
 .../processor/RunUpdateProcessorFactory.java    |    1 -
 .../processor/ScriptEngineCustomizer.java       |    1 -
 .../apache/solr/update/processor/Signature.java |    3 +-
 .../SignatureUpdateProcessorFactory.java        |    3 +-
 .../processor/SimpleUpdateProcessorFactory.java |    3 +-
 .../StatelessScriptUpdateProcessorFactory.java  |    3 +-
 .../update/processor/TextProfileSignature.java  |    3 +-
 .../TimestampUpdateProcessorFactory.java        |    1 -
 .../TrimFieldUpdateProcessorFactory.java        |    1 -
 .../TruncateFieldUpdateProcessorFactory.java    |    1 -
 .../processor/UUIDUpdateProcessorFactory.java   |    1 -
 .../UniqFieldsUpdateProcessorFactory.java       |    3 +-
 .../processor/UpdateRequestProcessor.java       |    1 -
 .../processor/UpdateRequestProcessorChain.java  |    1 -
 .../UpdateRequestProcessorFactory.java          |    1 -
 .../apache/solr/util/AdjustableSemaphore.java   |    3 +-
 .../org/apache/solr/util/BoundedTreeSet.java    |    2 -
 .../org/apache/solr/util/CommandOperation.java  |    3 +-
 .../apache/solr/util/ConcurrentLFUCache.java    |    3 +-
 .../apache/solr/util/ConcurrentLRUCache.java    |    3 +-
 .../java/org/apache/solr/util/CryptoKeys.java   |    3 +-
 .../src/java/org/apache/solr/util/DOMUtil.java  |    3 +-
 .../org/apache/solr/util/DateFormatUtil.java    |    3 +-
 .../org/apache/solr/util/DateMathParser.java    |    1 -
 .../solr/util/DefaultSolrThreadFactory.java     |    3 +-
 .../org/apache/solr/util/DistanceUnits.java     |   19 +-
 .../java/org/apache/solr/util/FSHDFSUtils.java  |    3 +-
 .../java/org/apache/solr/util/FastWriter.java   |    3 +-
 .../java/org/apache/solr/util/FileUtils.java    |    3 +-
 .../src/java/org/apache/solr/util/HdfsUtil.java |   17 +-
 .../org/apache/solr/util/LongPriorityQueue.java |    7 +-
 .../java/org/apache/solr/util/MapListener.java  |    3 +-
 .../java/org/apache/solr/util/NumberUtils.java  |    1 -
 .../org/apache/solr/util/PivotListEntry.java    |    3 +-
 .../java/org/apache/solr/util/PrimUtils.java    |    3 +-
 .../apache/solr/util/PropertiesInputStream.java |    3 +-
 .../solr/util/PropertiesOutputStream.java       |    3 +-
 .../org/apache/solr/util/PropertiesUtil.java    |    3 +-
 .../src/java/org/apache/solr/util/RTimer.java   |    3 +-
 .../java/org/apache/solr/util/RTimerTree.java   |    3 +-
 .../apache/solr/util/RecordingJSONParser.java   |    4 +-
 .../java/org/apache/solr/util/RefCounted.java   |    1 -
 .../org/apache/solr/util/RegexFileFilter.java   |    3 +-
 .../org/apache/solr/util/SimplePostTool.java    |    3 +-
 .../src/java/org/apache/solr/util/SolrCLI.java  |    3 +-
 .../org/apache/solr/util/SolrLogLayout.java     |   33 +-
 .../org/apache/solr/util/SolrPluginUtils.java   |  111 +-
 .../java/org/apache/solr/util/SpatialUtils.java |    3 +-
 .../org/apache/solr/util/SystemIdResolver.java  |    3 +-
 .../org/apache/solr/util/TestInjection.java     |   97 +-
 .../src/java/org/apache/solr/util/TimeOut.java  |    3 +-
 .../org/apache/solr/util/TimeZoneUtils.java     |    1 -
 .../org/apache/solr/util/VersionedFile.java     |    1 -
 .../hll/BigEndianAscendingWordDeserializer.java |    3 +-
 .../hll/BigEndianAscendingWordSerializer.java   |    3 +-
 .../java/org/apache/solr/util/hll/BitUtil.java  |    3 +-
 .../org/apache/solr/util/hll/BitVector.java     |    3 +-
 .../src/java/org/apache/solr/util/hll/HLL.java  |    3 +-
 .../org/apache/solr/util/hll/HLLMetadata.java   |    3 +-
 .../java/org/apache/solr/util/hll/HLLType.java  |    3 +-
 .../java/org/apache/solr/util/hll/HLLUtil.java  |    3 +-
 .../org/apache/solr/util/hll/IHLLMetadata.java  |    3 +-
 .../apache/solr/util/hll/ISchemaVersion.java    |    3 +-
 .../apache/solr/util/hll/IWordDeserializer.java |    3 +-
 .../apache/solr/util/hll/IWordSerializer.java   |    3 +-
 .../org/apache/solr/util/hll/LongIterator.java  |    3 +-
 .../org/apache/solr/util/hll/NumberUtil.java    |    3 +-
 .../apache/solr/util/hll/SchemaVersionOne.java  |    3 +-
 .../apache/solr/util/hll/SerializationUtil.java |    3 +-
 .../solr/util/plugin/AbstractPluginLoader.java  |    1 -
 .../solr/util/plugin/MapInitializedPlugin.java  |    1 -
 .../solr/util/plugin/MapPluginLoader.java       |    1 -
 .../util/plugin/NamedListInitializedPlugin.java |    1 -
 .../solr/util/plugin/NamedListPluginLoader.java |    1 -
 .../apache/solr/util/plugin/SolrCoreAware.java  |    1 -
 .../java/org/apache/solr/util/stats/Clock.java  |    1 -
 .../java/org/apache/solr/util/stats/EWMA.java   |    1 -
 .../util/stats/ExponentiallyDecayingSample.java |    1 -
 .../org/apache/solr/util/stats/Histogram.java   |    1 -
 .../java/org/apache/solr/util/stats/Meter.java  |    1 -
 .../java/org/apache/solr/util/stats/Sample.java |    1 -
 .../org/apache/solr/util/stats/Snapshot.java    |    1 -
 .../java/org/apache/solr/util/stats/Timer.java  |    1 -
 .../apache/solr/util/stats/TimerContext.java    |    1 -
 .../apache/solr/util/stats/UniformSample.java   |    1 -
 .../solr/util/xslt/TransformerProvider.java     |    1 -
 .../resources/EditableSolrConfigAttributes.json |   56 +
 solr/core/src/resources/ImplicitPlugins.json    |  102 ++
 .../src/resources/WellKnownPermissions.json     |   47 +
 .../runtimecode/RuntimeLibReqHandler.java       |    4 +-
 .../runtimecode/RuntimeLibResponseWriter.java   |   18 +-
 .../runtimecode/RuntimeLibSearchComponent.java  |    4 +-
 .../collection1/conf/bad-mpf-solrconfig.xml     |   37 +
 .../solr/collection1/conf/schema-sql.xml        |    2 +-
 .../collection1/conf/solrconfig-delpolicy1.xml  |    3 +-
 .../collection1/conf/solrconfig-delpolicy2.xml  |    3 +-
 ...olrconfig-indexconfig-mergepolicyfactory.xml |   31 +
 .../conf/solrconfig-logmergepolicyfactory.xml   |   37 +
 .../solrconfig-mergepolicyfactory-nocfs.xml     |   34 +
 .../solrconfig-sortingmergepolicyfactory.xml    |   50 +
 .../conf/solrconfig-spellcheckcomponent.xml     |    3 +-
 .../solrconfig-tieredmergepolicyfactory.xml     |   41 +
 ...lrconfig-warmer-randommergepolicyfactory.xml |   46 +
 .../solrconfig.snippet.randomindexconfig.xml    |    3 +-
 .../bad-mergepolicy/conf/solrconfig.xml         |    5 +-
 .../solr/AnalysisAfterCoreReloadTest.java       |    3 +-
 .../org/apache/solr/BasicFunctionalityTest.java |    1 -
 .../org/apache/solr/ConvertedLegacyTest.java    |    1 -
 .../test/org/apache/solr/CursorPagingTest.java  |    1 -
 .../apache/solr/DisMaxRequestHandlerTest.java   |    1 -
 .../solr/DistributedIntervalFacetingTest.java   |   28 +-
 .../test/org/apache/solr/EchoParamsTest.java    |    1 -
 .../test/org/apache/solr/MinimalSchemaTest.java |    1 -
 .../test/org/apache/solr/OutputWriterTest.java  |    1 -
 .../src/test/org/apache/solr/SampleTest.java    |    1 -
 .../org/apache/solr/SolrTestCaseJ4Test.java     |    3 +-
 .../test/org/apache/solr/TestCrossCoreJoin.java |    1 -
 .../solr/TestCursorMarkWithoutUniqueKey.java    |    1 -
 .../apache/solr/TestDistributedGrouping.java    |    3 +-
 .../apache/solr/TestDistributedMissingSort.java |    1 -
 .../org/apache/solr/TestDistributedSearch.java  |   16 +-
 .../org/apache/solr/TestDocumentBuilder.java    |    4 +-
 .../org/apache/solr/TestGroupingSearch.java     |   13 +-
 .../apache/solr/TestHighlightDedupGrouping.java |    1 -
 .../core/src/test/org/apache/solr/TestJoin.java |    1 -
 .../org/apache/solr/TestRandomDVFaceting.java   |   10 +-
 .../org/apache/solr/TestRandomFaceting.java     |    1 -
 .../solr/TestSimpleTrackingShardHandler.java    |    1 -
 .../org/apache/solr/TestTolerantSearch.java     |   33 +-
 .../PathHierarchyTokenizerFactoryTest.java      |    1 -
 .../apache/solr/analysis/TestCharFilters.java   |    3 +-
 .../TestReversedWildcardFilterFactory.java      |    3 +-
 .../TestWordDelimiterFilterFactory.java         |    3 +-
 .../ThrowingMockTokenFilterFactory.java         |    3 +-
 .../solr/client/solrj/ConnectionReuseTest.java  |    5 +-
 .../TestEmbeddedSolrServerConstructors.java     |    3 +-
 .../solrj/embedded/TestJettySolrRunner.java     |    3 +-
 .../apache/solr/cloud/ActionThrottleTest.java   |    3 +-
 .../apache/solr/cloud/AliasIntegrationTest.java |    3 +-
 .../test/org/apache/solr/cloud/AssignTest.java  |    3 +-
 .../AsyncCallRequestStatusResponseTest.java     |   15 +-
 .../solr/cloud/AsyncMigrateRouteKeyTest.java    |    3 +-
 .../solr/cloud/BaseCdcrDistributedZkTest.java   |    3 +-
 .../solr/cloud/BasicDistributedZk2Test.java     |    3 +-
 .../solr/cloud/BasicDistributedZkTest.java      |  103 +-
 .../test/org/apache/solr/cloud/BasicZkTest.java |    3 +-
 .../cloud/CdcrReplicationDistributedZkTest.java |    3 +-
 .../solr/cloud/CdcrReplicationHandlerTest.java  |    3 +-
 .../solr/cloud/CdcrRequestHandlerTest.java      |    3 +-
 .../solr/cloud/CdcrVersionReplicationTest.java  |    3 +-
 .../cloud/ChaosMonkeyNothingIsSafeTest.java     |    5 +-
 .../solr/cloud/ChaosMonkeySafeLeaderTest.java   |    3 +-
 .../solr/cloud/ChaosMonkeyShardSplitTest.java   |    3 +-
 .../apache/solr/cloud/CleanupOldIndexTest.java  |    3 +-
 .../cloud/CloudExitableDirectoryReaderTest.java |   34 +-
 .../org/apache/solr/cloud/ClusterStateTest.java |   27 +-
 .../solr/cloud/ClusterStateUpdateTest.java      |    3 +-
 .../apache/solr/cloud/CollectionReloadTest.java |    3 +-
 .../solr/cloud/CollectionStateFormat2Test.java  |    3 +-
 .../cloud/CollectionTooManyReplicasTest.java    |    3 +-
 .../CollectionsAPIAsyncDistributedZkTest.java   |    3 +-
 .../cloud/CollectionsAPIDistributedZkTest.java  |  109 +-
 .../solr/cloud/CollectionsAPISolrJTests.java    |    3 +-
 ...ConcurrentDeleteAndCreateCollectionTest.java |    3 +-
 .../apache/solr/cloud/ConfigSetsAPITest.java    |    3 +-
 .../solr/cloud/ConnectionManagerTest.java       |   73 +-
 .../apache/solr/cloud/CustomCollectionTest.java |    3 +-
 .../solr/cloud/DeleteInactiveReplicaTest.java   |    3 +-
 .../DeleteLastCustomShardedReplicaTest.java     |    3 +-
 .../apache/solr/cloud/DeleteReplicaTest.java    |    3 +-
 .../org/apache/solr/cloud/DeleteShardTest.java  |    3 +-
 .../org/apache/solr/cloud/DeleteStatusTest.java |  118 ++
 .../cloud/DistribJoinFromCollectionTest.java    |    3 +-
 .../apache/solr/cloud/DistributedQueueTest.java |   22 +-
 .../solr/cloud/DistributedVersionInfoTest.java  |    3 +-
 .../org/apache/solr/cloud/ForceLeaderTest.java  |    3 +-
 .../cloud/FullSolrCloudDistribCmdsTest.java     |    3 +-
 .../apache/solr/cloud/HttpPartitionTest.java    |    3 +-
 .../org/apache/solr/cloud/KerberosTestUtil.java |   29 +-
 .../cloud/LeaderElectionIntegrationTest.java    |    3 +-
 .../apache/solr/cloud/LeaderElectionTest.java   |   28 +-
 .../cloud/LeaderFailoverAfterPartitionTest.java |    3 +-
 .../LeaderInitiatedRecoveryOnCommitTest.java    |    3 +-
 ...aderInitiatedRecoveryOnShardRestartTest.java |    3 +-
 .../apache/solr/cloud/MigrateRouteKeyTest.java  |    3 +-
 .../apache/solr/cloud/MultiThreadedOCPTest.java |    3 +-
 ...utOfBoxZkACLAndCredentialsProvidersTest.java |   33 +-
 ...rriddenZkACLAndCredentialsProvidersTest.java |   33 +-
 ...verseerCollectionConfigSetProcessorTest.java |    3 +-
 .../apache/solr/cloud/OverseerRolesTest.java    |    4 +-
 .../apache/solr/cloud/OverseerStatusTest.java   |    3 +-
 .../solr/cloud/OverseerTaskQueueTest.java       |   22 +-
 .../org/apache/solr/cloud/OverseerTest.java     |    9 +-
 .../solr/cloud/RecoveryAfterSoftCommitTest.java |    3 +-
 .../org/apache/solr/cloud/RecoveryZkTest.java   |    3 +-
 .../apache/solr/cloud/RemoteQueryErrorTest.java |    3 +-
 .../solr/cloud/ReplicaPropertiesBase.java       |    3 +-
 .../solr/cloud/ReplicationFactorTest.java       |    3 +-
 .../solr/cloud/RestartWhileUpdatingTest.java    |    3 +-
 .../apache/solr/cloud/RollingRestartTest.java   |    3 +-
 .../org/apache/solr/cloud/SSLMigrationTest.java |    3 +-
 .../solr/cloud/SaslZkACLProviderTest.java       |   33 +-
 .../cloud/SegmentTerminateEarlyTestState.java   |  255 ++++
 .../solr/cloud/ShardRoutingCustomTest.java      |    3 +-
 .../org/apache/solr/cloud/ShardRoutingTest.java |    3 +-
 .../org/apache/solr/cloud/ShardSplitTest.java   |    3 +-
 .../cloud/SharedFSAutoReplicaFailoverTest.java  |    3 +-
 .../SharedFSAutoReplicaFailoverUtilsTest.java   |    3 +-
 .../cloud/SimpleCollectionCreateDeleteTest.java |    3 +-
 .../org/apache/solr/cloud/SliceStateTest.java   |   27 +-
 .../apache/solr/cloud/SolrCloudExampleTest.java |    3 +-
 .../org/apache/solr/cloud/SolrXmlInZkTest.java  |   22 +-
 .../org/apache/solr/cloud/SyncSliceTest.java    |    3 +-
 .../solr/cloud/TestAuthenticationFramework.java |    3 +-
 .../apache/solr/cloud/TestCloudInspectUtil.java |    7 +-
 .../apache/solr/cloud/TestCollectionAPI.java    |  107 +-
 .../apache/solr/cloud/TestConfigSetsAPI.java    |    1 -
 .../cloud/TestConfigSetsAPIExclusivity.java     |    1 -
 .../solr/cloud/TestConfigSetsAPIZkFailure.java  |    1 -
 .../org/apache/solr/cloud/TestCryptoKeys.java   |    3 +-
 .../solr/cloud/TestDistribDocBasedVersion.java  |    3 +-
 .../solr/cloud/TestDownShardTolerantSearch.java |    3 +-
 .../TestExclusionRuleCollectionAccess.java      |    3 +-
 .../apache/solr/cloud/TestHashPartitioner.java  |   27 +-
 .../solr/cloud/TestLeaderElectionZkExpiry.java  |    3 +-
 .../TestLeaderInitiatedRecoveryThread.java      |   31 +-
 .../solr/cloud/TestMiniSolrCloudCluster.java    |   75 +-
 .../cloud/TestMiniSolrCloudClusterBase.java     |   16 +-
 .../cloud/TestMiniSolrCloudClusterKerberos.java |    3 +-
 .../solr/cloud/TestMiniSolrCloudClusterSSL.java |    3 +-
 .../cloud/TestRandomRequestDistribution.java    |    3 +-
 .../apache/solr/cloud/TestRebalanceLeaders.java |    3 +-
 .../solr/cloud/TestReplicaProperties.java       |    4 +-
 .../solr/cloud/TestRequestForwarding.java       |    3 +-
 .../cloud/TestRequestStatusCollectionAPI.java   |    3 +-
 .../solr/cloud/TestShortCircuitedRequests.java  |    3 +-
 .../cloud/TestSolrCloudWithKerberosAlt.java     |   15 +-
 .../org/apache/solr/cloud/TestZkChroot.java     |    3 +-
 .../TlogReplayBufferedWhileIndexingTest.java    |  146 +++
 .../cloud/TriLevelCompositeIdRoutingTest.java   |    3 +-
 .../solr/cloud/UnloadDistributedZkTest.java     |    3 +-
 ...MParamsZkACLAndCredentialsProvidersTest.java |   33 +-
 .../test/org/apache/solr/cloud/ZkCLITest.java   |    3 +-
 .../org/apache/solr/cloud/ZkControllerTest.java |   28 +-
 .../org/apache/solr/cloud/ZkNodePropsTest.java  |   27 +-
 .../org/apache/solr/cloud/ZkSolrClientTest.java |   27 +-
 .../cloud/hdfs/HdfsBasicDistributedZk2Test.java |    3 +-
 .../cloud/hdfs/HdfsBasicDistributedZkTest.java  |    3 +-
 .../hdfs/HdfsChaosMonkeyNothingIsSafeTest.java  |    5 +-
 .../hdfs/HdfsChaosMonkeySafeLeaderTest.java     |    3 +-
 .../HdfsCollectionsAPIDistributedZkTest.java    |    3 +-
 .../solr/cloud/hdfs/HdfsNNFailoverTest.java     |    1 -
 .../solr/cloud/hdfs/HdfsRecoverLeaseTest.java   |    3 +-
 .../solr/cloud/hdfs/HdfsRecoveryZkTest.java     |    3 +-
 .../hdfs/HdfsRestartWhileUpdatingTest.java      |    3 +-
 .../solr/cloud/hdfs/HdfsSyncSliceTest.java      |    3 +-
 .../apache/solr/cloud/hdfs/HdfsTestUtil.java    |   33 +-
 .../solr/cloud/hdfs/HdfsThreadLeakTest.java     |    3 +-
 ...HdfsTlogReplayBufferedWhileIndexingTest.java |   62 +
 .../cloud/hdfs/HdfsUnloadDistributedZkTest.java |    3 +-
 .../HdfsWriteToMultipleCollectionsTest.java     |    1 -
 .../apache/solr/cloud/hdfs/StressHdfsTest.java  |    1 -
 .../cloud/overseer/TestClusterStateMutator.java |    3 +-
 .../solr/cloud/overseer/ZkStateReaderTest.java  |    3 +-
 .../solr/cloud/overseer/ZkStateWriterTest.java  |    3 +-
 .../solr/cloud/rule/ImplicitSnitchTest.java     |  186 +++
 .../apache/solr/cloud/rule/RuleEngineTest.java  |    3 +-
 .../org/apache/solr/cloud/rule/RulesTest.java   |   84 +-
 .../solr/core/BlobStoreTestRequestHandler.java  |   20 +-
 .../solr/core/CachingDirectoryFactoryTest.java  |   33 +-
 .../solr/core/CountUsageValueSourceParser.java  |    3 +-
 .../apache/solr/core/DirectoryFactoryTest.java  |    1 -
 .../solr/core/DummyValueSourceParser.java       |    3 +-
 .../solr/core/ExitableDirectoryReaderTest.java  |    4 +-
 .../solr/core/HdfsDirectoryFactoryTest.java     |    1 -
 .../org/apache/solr/core/MockInfoMBean.java     |   13 +-
 .../solr/core/MockShardHandlerFactory.java      |    3 +-
 .../solr/core/OpenCloseCoreStressTest.java      |    1 -
 .../org/apache/solr/core/PluginInfoTest.java    |    3 +-
 .../apache/solr/core/QueryResultKeyTest.java    |    1 -
 .../solr/core/RAMDirectoryFactoryTest.java      |    1 -
 .../apache/solr/core/RequestHandlersTest.java   |    1 -
 .../apache/solr/core/ResourceLoaderTest.java    |    1 -
 .../test/org/apache/solr/core/SOLR749Test.java  |    3 +-
 .../core/SolrCoreCheckLockOnStartupTest.java    |    3 +-
 .../test/org/apache/solr/core/SolrCoreTest.java |    1 -
 .../org/apache/solr/core/TestBadConfig.java     |    3 +-
 .../org/apache/solr/core/TestCodecSupport.java  |    3 +-
 .../test/org/apache/solr/core/TestConfig.java   |    8 +-
 .../org/apache/solr/core/TestConfigOverlay.java |    3 +-
 .../solr/core/TestConfigSetImmutable.java       |    3 +-
 .../solr/core/TestConfigSetProperties.java      |    3 +-
 .../org/apache/solr/core/TestConfigSets.java    |    3 +-
 .../org/apache/solr/core/TestCoreContainer.java |    1 -
 .../org/apache/solr/core/TestCoreDiscovery.java |    3 +-
 .../apache/solr/core/TestDynamicLoading.java    |    4 +-
 .../solr/core/TestImplicitCoreProperties.java   |   32 +-
 .../apache/solr/core/TestInfoStreamLogging.java |    3 +-
 .../org/apache/solr/core/TestInitParams.java    |    3 +-
 .../org/apache/solr/core/TestLazyCores.java     |    3 +-
 .../apache/solr/core/TestMergePolicyConfig.java |   40 +-
 .../test/org/apache/solr/core/TestNRTOpen.java  |   11 +-
 .../solr/core/TestQuerySenderListener.java      |    1 -
 .../solr/core/TestQuerySenderNoQuery.java       |    3 +-
 .../solr/core/TestReloadAndDeleteDocs.java      |    1 -
 .../solr/core/TestShardHandlerFactory.java      |    1 -
 .../apache/solr/core/TestSolrConfigHandler.java |    6 +-
 .../apache/solr/core/TestSolrIndexConfig.java   |    5 +-
 .../test/org/apache/solr/core/TestSolrXml.java  |    3 +-
 .../apache/solr/core/TestXIncludeConfig.java    |    3 +-
 .../handler/AnalysisRequestHandlerTestBase.java |    1 -
 .../solr/handler/CSVRequestHandlerTest.java     |    1 -
 .../apache/solr/handler/CheckBackupStatus.java  |    3 +-
 .../DocumentAnalysisRequestHandlerTest.java     |    1 -
 .../FieldAnalysisRequestHandlerTest.java        |    1 -
 .../org/apache/solr/handler/JsonLoaderTest.java |    1 -
 .../solr/handler/MoreLikeThisHandlerTest.java   |    1 -
 .../solr/handler/PingRequestHandlerTest.java    |    4 +-
 .../apache/solr/handler/RequestLoggingTest.java |    3 +-
 .../handler/StandardRequestHandlerTest.java     |    1 -
 .../apache/solr/handler/TestBlobHandler.java    |    3 +-
 .../org/apache/solr/handler/TestCSVLoader.java  |    1 -
 .../apache/solr/handler/TestConfigReload.java   |    3 +-
 .../handler/TestReplicationHandlerBackup.java   |    3 +-
 .../apache/solr/handler/TestReqParamsAPI.java   |   82 +-
 .../apache/solr/handler/TestRestoreCore.java    |    4 +-
 .../org/apache/solr/handler/TestSQLHandler.java |   59 +-
 .../handler/TestSolrConfigHandlerCloud.java     |   11 +-
 .../TestSolrConfigHandlerConcurrent.java        |    6 +-
 .../handler/ThrowErrorOnInitRequestHandler.java |    1 -
 .../admin/CoreAdminCreateDiscoverTest.java      |    1 -
 .../handler/admin/CoreAdminHandlerTest.java     |   62 +-
 .../admin/CoreAdminRequestStatusTest.java       |    3 +-
 .../admin/CoreMergeIndexesAdminHandlerTest.java |    3 +-
 .../solr/handler/admin/InfoHandlerTest.java     |    1 -
 .../solr/handler/admin/LoggingHandlerTest.java  |    1 -
 .../handler/admin/LukeRequestHandlerTest.java   |    1 -
 .../solr/handler/admin/MBeansHandlerTest.java   |    1 -
 .../handler/admin/SecurityConfHandlerTest.java  |    4 +-
 .../admin/SegmentsInfoRequestHandlerTest.java   |    3 +-
 .../admin/ShowFileRequestHandlerTest.java       |    3 +-
 .../handler/admin/SystemInfoHandlerTest.java    |    1 -
 .../handler/component/BadComponentTest.java     |    5 +-
 .../handler/component/DebugComponentTest.java   |    3 +-
 .../DistributedDebugComponentTest.java          |   33 +-
 .../DistributedExpandComponentTest.java         |    3 +-
 .../DistributedFacetPivotLargeTest.java         |    3 +-
 .../DistributedFacetPivotLongTailTest.java      |    3 +-
 .../DistributedFacetPivotSmallAdvancedTest.java |    3 +-
 .../DistributedFacetPivotSmallTest.java         |    3 +-
 .../DistributedFacetPivotWhiteBoxTest.java      |    3 +-
 .../component/DistributedMLTComponentTest.java  |    3 +-
 ...DistributedQueryComponentCustomSortTest.java |    3 +-
 ...stributedQueryComponentOptimizationTest.java |    3 +-
 .../DistributedQueryElevationComponentTest.java |    3 +-
 .../DistributedSpellCheckComponentTest.java     |    3 +-
 .../DistributedSuggestComponentTest.java        |    3 +-
 .../DistributedTermsComponentTest.java          |    3 +-
 .../component/DummyCustomParamSpellChecker.java |   26 +-
 .../handler/component/FacetPivotSmallTest.java  |    3 +-
 .../component/QueryElevationComponentTest.java  |    1 -
 .../component/ResponseLogComponentTest.java     |   17 +-
 .../handler/component/SearchHandlerTest.java    |   48 +-
 .../component/SpatialHeatmapFacetsTest.java     |    3 +-
 .../component/SpellCheckComponentTest.java      |    1 -
 .../handler/component/StatsComponentTest.java   |    3 +-
 .../SuggestComponentContextFilterQueryTest.java |    3 +-
 .../handler/component/SuggestComponentTest.java |    3 +-
 .../TermVectorComponentDistributedTest.java     |    1 -
 .../component/TermVectorComponentTest.java      |   18 +-
 .../handler/component/TermsComponentTest.java   |    3 +-
 ...estDistributedStatsComponentCardinality.java |    7 +-
 .../handler/component/TestExpandComponent.java  |   31 +-
 .../handler/component/TestPivotHelperCode.java  |    5 +-
 .../TestTrackingShardHandlerFactory.java        |    3 +-
 .../solr/handler/loader/JavabinLoaderTest.java  |    3 +-
 .../highlight/FastVectorHighlighterTest.java    |    1 -
 .../highlight/HighlighterMaxOffsetTest.java     |    3 +-
 .../apache/solr/highlight/HighlighterTest.java  |    1 -
 .../highlight/TestPostingsSolrHighlighter.java  |    3 +-
 .../solr/index/DummyMergePolicyFactory.java     |   33 +
 .../index/WrapperMergePolicyFactoryTest.java    |  135 ++
 .../solr/index/hdfs/CheckHdfsIndexTest.java     |    3 +-
 .../apache/solr/internal/csv/CSVParserTest.java |    6 +-
 .../solr/internal/csv/CSVPrinterTest.java       |    6 +-
 .../solr/internal/csv/CSVStrategyTest.java      |    6 +-
 .../apache/solr/internal/csv/CSVUtilsTest.java  |    6 +-
 .../solr/internal/csv/CharBufferTest.java       |   26 +-
 .../csv/ExtendedBufferedReaderTest.java         |    6 +-
 .../csv/writer/CSVConfigGuesserTest.java        |   26 +-
 .../solr/internal/csv/writer/CSVConfigTest.java |   26 +-
 .../solr/internal/csv/writer/CSVFieldTest.java  |   26 +-
 .../solr/internal/csv/writer/CSVWriterTest.java |   26 +-
 .../org/apache/solr/logging/TestLogWatcher.java |    3 +-
 .../org/apache/solr/request/JSONWriterTest.java |    1 -
 .../apache/solr/request/SimpleFacetsTest.java   |  139 +-
 .../apache/solr/request/SmileWriterTest.java    |    4 +-
 .../org/apache/solr/request/TestFaceting.java   |   90 +-
 .../solr/request/TestIntervalFaceting.java      |    1 -
 .../solr/request/TestRemoteStreaming.java       |    3 +-
 .../org/apache/solr/request/TestWriterPerf.java |    1 -
 .../apache/solr/request/macro/TestMacros.java   |    4 +-
 .../solr/response/TestCSVResponseWriter.java    |    1 -
 .../solr/response/TestChildDocTransformer.java  |    3 +-
 .../solr/response/TestCustomDocTransformer.java |    3 +-
 .../TestPHPSerializedResponseWriter.java        |    1 -
 .../solr/response/TestRawResponseWriter.java    |    1 -
 .../solr/response/TestRawTransformer.java       |    3 +-
 .../solr/response/TestSolrQueryResponse.java    |    9 +-
 .../response/TestSortingResponseWriter.java     |    6 +-
 .../apache/solr/rest/SolrRestletTestBase.java   |    3 +-
 .../apache/solr/rest/TestManagedResource.java   |    3 +-
 .../solr/rest/TestManagedResourceStorage.java   |    3 +-
 .../org/apache/solr/rest/TestRestManager.java   |    3 +-
 .../solr/rest/schema/TestBulkSchemaAPI.java     |   86 +-
 .../rest/schema/TestClassNameShortening.java    |    3 +-
 .../schema/TestCopyFieldCollectionResource.java |    3 +-
 .../schema/TestDefaultSearchFieldResource.java  |    3 +-
 .../TestDynamicFieldCollectionResource.java     |    3 +-
 .../rest/schema/TestDynamicFieldResource.java   |    3 +-
 .../schema/TestFieldCollectionResource.java     |    3 +-
 .../solr/rest/schema/TestFieldResource.java     |    3 +-
 .../schema/TestFieldTypeCollectionResource.java |    3 +-
 .../solr/rest/schema/TestFieldTypeResource.java |    4 +-
 .../TestManagedSchemaDynamicFieldResource.java  |    3 +-
 .../schema/TestManagedSchemaFieldResource.java  |    3 +-
 .../TestManagedSchemaFieldTypeResource.java     |    3 +-
 .../schema/TestRemoveLastDynamicCopyField.java  |    4 +-
 .../rest/schema/TestSchemaNameResource.java     |    3 +-
 .../solr/rest/schema/TestSchemaResource.java    |    4 +-
 .../schema/TestSchemaSimilarityResource.java    |    3 +-
 .../rest/schema/TestSchemaVersionResource.java  |    3 +-
 .../TestSerializedLuceneMatchVersion.java       |    3 +-
 ...tSolrQueryParserDefaultOperatorResource.java |    3 +-
 .../schema/TestSolrQueryParserResource.java     |    3 +-
 .../rest/schema/TestUniqueKeyFieldResource.java |    3 +-
 .../analysis/TestManagedStopFilterFactory.java  |    3 +-
 .../TestManagedSynonymFilterFactory.java        |    3 +-
 .../solr/schema/AbstractCurrencyFieldTest.java  |    3 +-
 .../apache/solr/schema/BadCopyFieldTest.java    |    1 -
 .../apache/solr/schema/BadIndexSchemaTest.java  |    1 -
 .../solr/schema/ChangedSchemaMergeTest.java     |    1 -
 .../org/apache/solr/schema/CopyFieldTest.java   |    1 -
 .../schema/CurrencyFieldOpenExchangeTest.java   |    3 +-
 .../solr/schema/CurrencyFieldXmlFileTest.java   |    3 +-
 .../solr/schema/CustomAnalyzerStrField.java     |    3 +-
 .../org/apache/solr/schema/DateFieldTest.java   |    1 -
 .../apache/solr/schema/DateRangeFieldTest.java  |    5 +-
 .../solr/schema/DocValuesMissingTest.java       |    3 +-
 .../apache/solr/schema/DocValuesMultiTest.java  |    3 +-
 .../org/apache/solr/schema/DocValuesTest.java   |    3 +-
 .../org/apache/solr/schema/EnumFieldTest.java   |    3 +-
 .../solr/schema/ExternalFileFieldSortTest.java  |   19 +-
 .../schema/IndexSchemaRuntimeFieldTest.java     |    3 +-
 .../org/apache/solr/schema/IndexSchemaTest.java |    1 -
 .../solr/schema/MockExchangeRateProvider.java   |    3 +-
 .../org/apache/solr/schema/MultiTermTest.java   |    3 +-
 .../apache/solr/schema/MyCrazyCustomField.java  |    3 +-
 .../solr/schema/NotRequiredUniqueKeyTest.java   |    1 -
 .../apache/solr/schema/NumericFieldsTest.java   |    1 -
 .../OpenExchangeRatesOrgProviderTest.java       |    3 +-
 .../org/apache/solr/schema/PolyFieldTest.java   |    3 +-
 .../solr/schema/PreAnalyzedFieldTest.java       |    3 +-
 .../solr/schema/PrimitiveFieldTypeTest.java     |    1 -
 .../apache/solr/schema/RequiredFieldsTest.java  |    1 -
 .../SchemaVersionSpecificBehaviorTest.java      |    1 -
 .../apache/solr/schema/SortableBinaryField.java |    3 +-
 .../solr/schema/SpatialRPTFieldTypeTest.java    |    3 +-
 .../solr/schema/SynonymTokenizerTest.java       |    3 +-
 .../org/apache/solr/schema/TestBinaryField.java |    1 -
 .../solr/schema/TestBulkSchemaConcurrent.java   |    4 +-
 .../solr/schema/TestCloudManagedSchema.java     |    3 +-
 .../TestCloudManagedSchemaConcurrent.java       |    3 +-
 .../apache/solr/schema/TestCloudSchemaless.java |    3 +-
 .../apache/solr/schema/TestCollationField.java  |    1 -
 .../schema/TestCollationFieldDocValues.java     |    1 -
 .../apache/solr/schema/TestManagedSchema.java   |    3 +-
 .../apache/solr/schema/TestOmitPositions.java   |    3 +-
 .../apache/solr/schema/TestSchemaManager.java   |    3 +-
 .../solr/schema/TestUseDocValuesAsStored.java   |    3 +-
 .../solr/schema/TestUseDocValuesAsStored2.java  |    3 +-
 .../solr/schema/ThrowErrorOnInitFieldType.java  |    3 +-
 .../TrieIntPrefixActsAsRangeQueryFieldType.java |    3 +-
 .../org/apache/solr/schema/WrappedIntField.java |    3 +-
 .../solr/search/AnalyticsMergeStrategyTest.java |    3 +-
 .../apache/solr/search/AnalyticsQueryTest.java  |    1 -
 .../org/apache/solr/search/CursorMarkTest.java  |    1 -
 .../solr/search/DelayingSearchComponent.java    |    3 +-
 .../test/org/apache/solr/search/DocSetPerf.java |    1 -
 .../apache/solr/search/FooQParserPlugin.java    |    5 -
 .../apache/solr/search/MergeStrategyTest.java   |    3 +-
 .../apache/solr/search/MockSearchComponent.java |    3 +-
 .../apache/solr/search/QueryEqualityTest.java   |   16 +-
 .../apache/solr/search/QueryParsingTest.java    |    3 +-
 .../org/apache/solr/search/RankQueryTest.java   |    1 -
 .../apache/solr/search/ReturnFieldsTest.java    |    1 -
 .../apache/solr/search/SortSpecParsingTest.java |    3 +-
 .../apache/solr/search/SpatialFilterTest.java   |    4 +-
 .../solr/search/TestAddFieldRealTimeGet.java    |    3 +-
 .../solr/search/TestAnalyticsQParserPlugin.java |    5 -
 .../solr/search/TestCollapseQParserPlugin.java  |    1 -
 .../search/TestComplexPhraseQParserPlugin.java  |    3 +-
 .../apache/solr/search/TestComponentsName.java  |    3 +-
 .../org/apache/solr/search/TestCustomSort.java  |    3 +-
 .../test/org/apache/solr/search/TestDocSet.java |    1 -
 .../solr/search/TestElisionMultitermQuery.java  |   11 +-
 .../solr/search/TestExtendedDismaxParser.java   |    1 -
 .../apache/solr/search/TestFieldSortValues.java |    3 +-
 .../solr/search/TestFilteredDocIdSet.java       |    3 +-
 .../org/apache/solr/search/TestFiltering.java   |    1 -
 .../solr/search/TestFoldingMultitermQuery.java  |    3 +-
 .../solr/search/TestHashQParserPlugin.java      |    1 -
 .../apache/solr/search/TestIndexSearcher.java   |   11 +-
 .../org/apache/solr/search/TestInitQParser.java |    3 +-
 .../org/apache/solr/search/TestLFUCache.java    |    3 +-
 .../org/apache/solr/search/TestLRUCache.java    |    3 +-
 .../solr/search/TestMaxScoreQueryParser.java    |    3 +-
 .../apache/solr/search/TestMissingGroups.java   |    1 -
 .../apache/solr/search/TestNoOpRegenerator.java |    3 +-
 ...OverriddenPrefixQueryForCustomFieldType.java |    3 +-
 .../solr/search/TestPseudoReturnFields.java     |    1 -
 .../org/apache/solr/search/TestQueryUtils.java  |    1 -
 .../solr/search/TestQueryWrapperFilter.java     |    4 +-
 .../search/TestRandomCollapseQParserPlugin.java |    1 -
 .../apache/solr/search/TestRankQueryPlugin.java |    5 -
 .../solr/search/TestReRankQParserPlugin.java    |   64 +-
 .../apache/solr/search/TestReloadDeadlock.java  |    5 +-
 .../org/apache/solr/search/TestSearchPerf.java  |    1 -
 .../solr/search/TestSimpleQParserPlugin.java    |    3 +-
 .../apache/solr/search/TestSmileRequest.java    |    4 +-
 .../apache/solr/search/TestSolr4Spatial.java    |    3 +-
 .../apache/solr/search/TestSolr4Spatial2.java   |    3 +-
 .../test/org/apache/solr/search/TestSolrJ.java  |    1 -
 .../apache/solr/search/TestSolrQueryParser.java |  231 ++--
 .../test/org/apache/solr/search/TestSort.java   |    1 -
 .../solr/search/TestStandardQParsers.java       |    3 +-
 .../solr/search/TestStressUserVersions.java     |    5 +-
 .../solr/search/TestSurroundQueryParser.java    |    3 +-
 .../org/apache/solr/search/TestTrieFacet.java   |    1 -
 .../solr/search/TestValueSourceCache.java       |    3 +-
 .../org/apache/solr/search/TestXmlQParser.java  |    5 +-
 .../solr/search/facet/TestJsonFacets.java       |   40 +-
 .../search/function/NvlValueSourceParser.java   |    1 -
 .../search/function/SortByFunctionTest.java     |    3 +-
 .../solr/search/function/TestFunctionQuery.java |    1 -
 .../function/TestMinMaxOnMultiValuedField.java  |    1 -
 .../solr/search/function/TestOrdValues.java     |    3 +-
 .../function/TestSortByMinMaxFunction.java      |    3 +-
 .../function/distance/DistanceFunctionTest.java |    3 +-
 .../apache/solr/search/join/BJQParserTest.java  |    1 -
 .../search/join/BlockJoinFacetDistribTest.java  |    3 +-
 .../search/join/BlockJoinFacetRandomTest.java   |    3 +-
 .../search/join/BlockJoinFacetSimpleTest.java   |    3 +-
 .../apache/solr/search/join/GraphQueryTest.java |   26 +-
 .../search/join/TestScoreJoinQPNoScore.java     |    1 -
 .../solr/search/join/TestScoreJoinQPScore.java  |    1 -
 .../solr/search/json/TestJsonRequest.java       |    3 +-
 .../solr/search/mlt/CloudMLTQParserTest.java    |    3 +-
 .../solr/search/mlt/SimpleMLTQParserTest.java   |    3 +-
 .../similarities/BaseSimilarityTestCase.java    |    3 +-
 .../similarities/TestBM25SimilarityFactory.java |    3 +-
 .../TestClassicSimilarityFactory.java           |    3 +-
 .../similarities/TestDFISimilarityFactory.java  |    3 +-
 .../similarities/TestDFRSimilarityFactory.java  |    3 +-
 .../similarities/TestIBSimilarityFactory.java   |    3 +-
 .../TestLMDirichletSimilarityFactory.java       |    3 +-
 .../TestLMJelinekMercerSimilarityFactory.java   |    3 +-
 .../TestNonDefinedSimilarityFactory.java        |    3 +-
 .../similarities/TestPerFieldSimilarity.java    |    3 +-
 .../TestPerFieldSimilarityClassic.java          |    3 +-
 ...stPerFieldSimilarityWithDefaultOverride.java |    3 +-
 .../TestSweetSpotSimilarityFactory.java         |    3 +-
 .../solr/search/stats/TestBaseStatsCache.java   |    3 +-
 .../search/stats/TestDefaultStatsCache.java     |    3 +-
 .../solr/search/stats/TestDistribIDF.java       |    3 +-
 .../search/stats/TestExactSharedStatsCache.java |    4 +-
 .../solr/search/stats/TestExactStatsCache.java  |    4 +-
 .../solr/search/stats/TestLRUStatsCache.java    |    4 +-
 .../solr/security/BasicAuthIntegrationTest.java |   32 +-
 .../solr/security/MockAuthenticationPlugin.java |    4 +-
 .../solr/security/MockAuthorizationPlugin.java  |    3 +-
 .../PKIAuthenticationIntegrationTest.java       |    4 +-
 .../security/TestAuthorizationFramework.java    |    7 +-
 .../security/TestPKIAuthenticationPlugin.java   |    3 +-
 .../TestRuleBasedAuthorizationPlugin.java       |    3 +-
 .../TestSha256AuthenticationProvider.java       |    3 +-
 .../solr/servlet/DirectSolrConnectionTest.java  |    1 -
 .../apache/solr/servlet/ResponseHeaderTest.java |    3 +-
 .../solr/servlet/SolrRequestParserTest.java     |    1 -
 .../ConjunctionSolrSpellCheckerTest.java        |   23 +-
 .../spelling/DirectSolrSpellCheckerTest.java    |    3 +-
 .../spelling/FileBasedSpellCheckerTest.java     |    1 -
 .../apache/solr/spelling/SampleComparator.java  |    3 +-
 .../solr/spelling/SpellCheckCollatorTest.java   |    3 +-
 .../spelling/SpellPossibilityIteratorTest.java  |    3 +-
 .../spelling/SpellingQueryConverterTest.java    |    1 -
 .../spelling/TestSuggestSpellingConverter.java  |    3 +-
 .../spelling/WordBreakSolrSpellCheckerTest.java |    3 +-
 .../solr/spelling/suggest/SuggesterFSTTest.java |    3 +-
 .../solr/spelling/suggest/SuggesterTSTTest.java |    3 +-
 .../solr/spelling/suggest/SuggesterTest.java    |    1 -
 .../spelling/suggest/SuggesterWFSTTest.java     |    3 +-
 .../suggest/TestAnalyzeInfixSuggestions.java    |   11 +-
 .../suggest/TestAnalyzedSuggestions.java        |    3 +-
 .../suggest/TestBlendedInfixSuggestions.java    |    3 +-
 .../suggest/TestFileDictionaryLookup.java       |    3 +-
 .../suggest/TestFreeTextSuggestions.java        |    3 +-
 .../suggest/TestFuzzyAnalyzedSuggestions.java   |   11 +-
 .../TestHighFrequencyDictionaryFactory.java     |    3 +-
 .../spelling/suggest/TestPhraseSuggestions.java |    3 +-
 .../solr/store/blockcache/BlockCacheTest.java   |    3 +-
 .../store/blockcache/BlockDirectoryTest.java    |    3 +-
 .../solr/store/blockcache/BufferStoreTest.java  |    3 +-
 .../solr/store/hdfs/HdfsDirectoryTest.java      |    3 +-
 .../solr/store/hdfs/HdfsLockFactoryTest.java    |    3 +-
 .../apache/solr/update/AddBlockUpdateTest.java  |   25 +-
 .../solr/update/AnalysisErrorHandlingTest.java  |    3 +-
 .../org/apache/solr/update/AutoCommitTest.java  |    1 -
 .../apache/solr/update/CdcrUpdateLogTest.java   |    3 +-
 .../solr/update/DataDrivenBlockJoinTest.java    |   23 +-
 .../update/DirectUpdateHandlerOptimizeTest.java |    3 +-
 .../solr/update/DirectUpdateHandlerTest.java    |    7 +-
 .../apache/solr/update/DocumentBuilderTest.java |    1 -
 .../apache/solr/update/DummyMergePolicy.java    |    3 +-
 .../apache/solr/update/HardAutoCommitTest.java  |    1 -
 .../solr/update/MockStreamingSolrClients.java   |    3 +-
 .../org/apache/solr/update/PeerSyncTest.java    |   34 +-
 .../apache/solr/update/SoftAutoCommitTest.java  |    1 -
 .../solr/update/SolrCmdDistributorTest.java     |   15 +-
 .../apache/solr/update/SolrIndexConfigTest.java |   72 +-
 .../solr/update/SolrIndexSplitterTest.java      |    3 +-
 .../update/TestDocBasedVersionConstraints.java  |    1 -
 .../solr/update/TestExceedMaxTermLength.java    |    3 +-
 .../apache/solr/update/TestHdfsUpdateLog.java   |    3 +-
 .../solr/update/TestIndexingPerformance.java    |    1 -
 .../apache/solr/update/UpdateParamsTest.java    |    1 -
 .../org/apache/solr/update/VersionInfoTest.java |    3 +-
 ...dSchemaFieldsUpdateProcessorFactoryTest.java |    1 -
 .../update/processor/AtomicUpdatesTest.java     |   31 +-
 .../CloneFieldUpdateProcessorFactoryTest.java   |    1 -
 .../processor/CustomUpdateRequestProcessor.java |    1 -
 .../CustomUpdateRequestProcessorFactory.java    |    1 -
 .../DefaultValueUpdateProcessorTest.java        |    1 -
 ...DocExpirationUpdateProcessorFactoryTest.java |    1 -
 .../FieldMutatingUpdateProcessorTest.java       |    1 -
 ...ommitOptimizeUpdateProcessorFactoryTest.java |    3 +-
 .../ParsingFieldUpdateProcessorsTest.java       |    1 -
 .../PreAnalyzedUpdateProcessorTest.java         |   13 +-
 .../RecordingUpdateProcessorFactory.java        |    1 -
 .../solr/update/processor/RuntimeUrp.java       |    3 +-
 .../solr/update/processor/ScriptEngineTest.java |    1 -
 .../SignatureUpdateProcessorFactoryTest.java    |    1 -
 ...atelessScriptUpdateProcessorFactoryTest.java |    3 +-
 .../processor/TestNamedUpdateProcessors.java    |    4 +-
 .../TestPartialUpdateDeduplication.java         |    3 +-
 .../UUIDUpdateProcessorFallbackTest.java        |    3 +-
 .../UniqFieldsUpdateProcessorFactoryTest.java   |    1 -
 .../processor/UpdateProcessorTestBase.java      |    3 +-
 .../UpdateRequestProcessorFactoryTest.java      |    1 -
 .../test/org/apache/solr/util/BitSetPerf.java   |    1 -
 .../org/apache/solr/util/CircularListTest.java  |    1 -
 .../test/org/apache/solr/util/DOMUtilTest.java  |    3 +-
 .../apache/solr/util/DateMathParserTest.java    |    1 -
 .../org/apache/solr/util/DistanceUnitsTest.java |    9 +-
 .../org/apache/solr/util/FileUtilsTest.java     |    3 +-
 .../org/apache/solr/util/MockCoreContainer.java |    3 +-
 .../org/apache/solr/util/PrimUtilsTest.java     |   14 +-
 .../apache/solr/util/SimplePostToolTest.java    |    3 +-
 .../apache/solr/util/SolrPluginUtilsTest.java   |    1 -
 .../apache/solr/util/TestFastOutputStream.java  |    1 -
 .../org/apache/solr/util/TestFastWriter.java    |    1 -
 .../solr/util/TestObjectReleaseTracker.java     |    3 +-
 .../org/apache/solr/util/TestRTimerTree.java    |    3 +-
 .../solr/util/TestRandomForceMergePolicy.java   |   36 -
 .../apache/solr/util/TestRandomMergePolicy.java |   74 --
 .../apache/solr/util/TestSolrCLIRunExample.java |    3 +-
 .../apache/solr/util/TestSystemIdResolver.java  |    3 +-
 .../org/apache/solr/util/TestTestInjection.java |    3 +-
 .../test/org/apache/solr/util/TestUtils.java    |    1 -
 .../org/apache/solr/util/TimeZoneUtilsTest.java |    1 -
 .../BigEndianAscendingWordDeserializerTest.java |    1 -
 .../BigEndianAscendingWordSerializerTest.java   |    1 -
 .../org/apache/solr/util/hll/BitVectorTest.java |    1 -
 .../apache/solr/util/hll/ExplicitHLLTest.java   |    1 -
 .../org/apache/solr/util/hll/FullHLLTest.java   |    1 -
 .../solr/util/hll/HLLSerializationTest.java     |    1 -
 .../org/apache/solr/util/hll/HLLUtilTest.java   |    1 -
 .../solr/util/hll/IntegrationTestGenerator.java |    1 -
 .../solr/util/hll/ProbabilisticTestUtil.java    |    1 -
 .../org/apache/solr/util/hll/SparseHLLTest.java |    1 -
 .../example-DIH/solr/db/conf/solrconfig.xml     |   20 +-
 .../example-DIH/solr/mail/conf/solrconfig.xml   |   20 +-
 .../example-DIH/solr/rss/conf/solrconfig.xml    |   18 +-
 .../example-DIH/solr/solr/conf/solrconfig.xml   |   18 +-
 .../example-DIH/solr/tika/conf/solrconfig.xml   |   18 +-
 solr/example/files/conf/solrconfig.xml          |   18 +-
 solr/licenses/attributes-binder-1.2.3.jar.sha1  |    1 -
 solr/licenses/attributes-binder-1.3.1.jar.sha1  |    1 +
 solr/licenses/carrot2-mini-3.10.4.jar.sha1      |    1 -
 solr/licenses/carrot2-mini-3.12.0.jar.sha1      |    1 +
 solr/licenses/icu4j-54.1.jar.sha1               |    1 -
 solr/licenses/icu4j-56.1.jar.sha1               |    1 +
 ...jetty-continuation-9.2.13.v20150730.jar.sha1 |    1 -
 .../jetty-continuation-9.3.6.v20151106.jar.sha1 |    1 +
 .../jetty-deploy-9.2.13.v20150730.jar.sha1      |    1 -
 .../jetty-deploy-9.3.6.v20151106.jar.sha1       |    1 +
 .../jetty-http-9.2.13.v20150730.jar.sha1        |    1 -
 .../jetty-http-9.3.6.v20151106.jar.sha1         |    1 +
 .../licenses/jetty-io-9.2.13.v20150730.jar.sha1 |    1 -
 solr/licenses/jetty-io-9.3.6.v20151106.jar.sha1 |    1 +
 .../jetty-jmx-9.2.13.v20150730.jar.sha1         |    1 -
 .../licenses/jetty-jmx-9.3.6.v20151106.jar.sha1 |    1 +
 .../jetty-rewrite-9.2.13.v20150730.jar.sha1     |    1 -
 .../jetty-rewrite-9.3.6.v20151106.jar.sha1      |    1 +
 .../jetty-security-9.2.13.v20150730.jar.sha1    |    1 -
 .../jetty-security-9.3.6.v20151106.jar.sha1     |    1 +
 .../jetty-server-9.2.13.v20150730.jar.sha1      |    1 -
 .../jetty-server-9.3.6.v20151106.jar.sha1       |    1 +
 .../jetty-servlet-9.2.13.v20150730.jar.sha1     |    1 -
 .../jetty-servlet-9.3.6.v20151106.jar.sha1      |    1 +
 .../jetty-servlets-9.2.13.v20150730.jar.sha1    |    1 -
 .../jetty-servlets-9.3.6.v20151106.jar.sha1     |    1 +
 .../jetty-util-9.2.13.v20150730.jar.sha1        |    1 -
 .../jetty-util-9.3.6.v20151106.jar.sha1         |    1 +
 .../jetty-webapp-9.2.13.v20150730.jar.sha1      |    1 -
 .../jetty-webapp-9.3.6.v20151106.jar.sha1       |    1 +
 .../jetty-xml-9.2.13.v20150730.jar.sha1         |    1 -
 .../licenses/jetty-xml-9.3.6.v20151106.jar.sha1 |    1 +
 solr/licenses/mahout-collections-1.0.jar.sha1   |    1 -
 .../licenses/mahout-collections-LICENSE-ASL.txt |  202 ---
 solr/licenses/mahout-collections-NOTICE.txt     |   56 -
 solr/licenses/mahout-math-0.6.jar.sha1          |    1 -
 solr/licenses/mahout-math-LICENSE-ASL.txt       |  202 ---
 solr/licenses/mahout-math-NOTICE.txt            |   56 -
 solr/licenses/morfologik-fsa-2.0.1.jar.sha1     |    1 -
 solr/licenses/morfologik-fsa-2.1.0.jar.sha1     |    1 +
 solr/licenses/morfologik-fsa-LICENSE-BSD.txt    |    2 +-
 solr/licenses/morfologik-polish-2.0.1.jar.sha1  |    1 -
 solr/licenses/morfologik-polish-2.1.0.jar.sha1  |    1 +
 solr/licenses/morfologik-polish-LICENSE-BSD.txt |   16 +-
 .../licenses/morfologik-stemming-2.0.1.jar.sha1 |    1 -
 .../licenses/morfologik-stemming-2.1.0.jar.sha1 |    1 +
 .../morfologik-stemming-LICENSE-BSD.txt         |    2 +-
 solr/licenses/start.jar.sha1                    |    2 +-
 .../conf/solrconfig.xml                         |   16 +-
 .../conf/solrconfig.xml                         |   16 +-
 .../solr/client/solrj/ResponseParser.java       |    1 -
 .../apache/solr/client/solrj/SolrClient.java    |    1 -
 .../org/apache/solr/client/solrj/SolrQuery.java |    1 -
 .../apache/solr/client/solrj/SolrRequest.java   |    1 -
 .../apache/solr/client/solrj/SolrResponse.java  |    1 -
 .../solr/client/solrj/SolrServerException.java  |    1 -
 .../client/solrj/StreamingResponseCallback.java |    1 -
 .../client/solrj/beans/BindingException.java    |    3 +-
 .../solr/client/solrj/impl/CloudSolrClient.java |   16 +-
 .../solrj/impl/ConcurrentUpdateSolrClient.java  |    5 +-
 .../client/solrj/impl/HttpClientConfigurer.java |    4 +-
 .../solr/client/solrj/impl/HttpSolrClient.java  |    9 +-
 .../solrj/impl/InputStreamResponseParser.java   |    3 +-
 .../solrj/impl/Krb5HttpClientConfigurer.java    |    3 +-
 .../client/solrj/impl/NoOpResponseParser.java   |    3 +-
 .../solrj/impl/SolrHttpRequestRetryHandler.java |    3 +-
 .../impl/SolrPortAwareCookieSpecFactory.java    |   33 +-
 .../client/solrj/impl/XMLResponseParser.java    |    1 -
 .../solr/client/solrj/io/SolrClientCache.java   |   16 +-
 .../org/apache/solr/client/solrj/io/Tuple.java  |    3 +-
 .../client/solrj/io/comp/ComparatorLambda.java  |   11 +-
 .../client/solrj/io/comp/ComparatorOrder.java   |    7 +-
 .../client/solrj/io/comp/FieldComparator.java   |    1 -
 .../solr/client/solrj/io/comp/HashKey.java      |   14 +-
 .../solrj/io/comp/MultipleFieldComparator.java  |    1 -
 .../client/solrj/io/comp/StreamComparator.java  |    1 -
 .../solr/client/solrj/io/eq/Equalitor.java      |    5 +-
 .../solr/client/solrj/io/eq/FieldEqualitor.java |    1 -
 .../solrj/io/eq/MultipleFieldEqualitor.java     |    1 -
 .../client/solrj/io/eq/StreamEqualitor.java     |    1 -
 .../client/solrj/io/ops/ConcatOperation.java    |   23 +-
 .../client/solrj/io/ops/DistinctOperation.java  |   33 +-
 .../client/solrj/io/ops/GroupOperation.java     |   33 +-
 .../client/solrj/io/ops/ReduceOperation.java    |    6 +-
 .../client/solrj/io/ops/ReplaceOperation.java   |   21 +-
 .../solrj/io/ops/ReplaceWithFieldOperation.java |   23 +-
 .../solrj/io/ops/ReplaceWithValueOperation.java |   23 +-
 .../client/solrj/io/ops/StreamOperation.java    |   19 +-
 .../client/solrj/io/sql/ConnectionImpl.java     |   58 +-
 .../solrj/io/sql/DatabaseMetaDataImpl.java      |  111 +-
 .../solr/client/solrj/io/sql/DriverImpl.java    |    7 +-
 .../solr/client/solrj/io/sql/ResultSetImpl.java |  245 +++-
 .../solrj/io/sql/ResultSetMetaDataImpl.java     |   55 +-
 .../solr/client/solrj/io/sql/StatementImpl.java |   57 +-
 .../client/solrj/io/stream/BiJoinStream.java    |    1 -
 .../client/solrj/io/stream/CloudSolrStream.java |   21 +-
 .../solrj/io/stream/ComplementStream.java       |    1 -
 .../client/solrj/io/stream/DaemonStream.java    |   30 +-
 .../client/solrj/io/stream/ExceptionStream.java |    1 -
 .../client/solrj/io/stream/FacetStream.java     |    3 +-
 .../client/solrj/io/stream/HashJoinStream.java  |    1 -
 .../client/solrj/io/stream/InnerJoinStream.java |    1 -
 .../client/solrj/io/stream/IntersectStream.java |    1 -
 .../solr/client/solrj/io/stream/JDBCStream.java |    1 -
 .../client/solrj/io/stream/JSONTupleStream.java |   33 +-
 .../solr/client/solrj/io/stream/JoinStream.java |   33 +-
 .../solrj/io/stream/LeftOuterJoinStream.java    |    1 -
 .../client/solrj/io/stream/MergeStream.java     |    1 -
 .../solrj/io/stream/OuterHashJoinStream.java    |    1 -
 .../client/solrj/io/stream/ParallelStream.java  |    4 +-
 .../client/solrj/io/stream/PushBackStream.java  |    1 -
 .../solr/client/solrj/io/stream/RankStream.java |    1 -
 .../client/solrj/io/stream/ReducerStream.java   |    1 -
 .../client/solrj/io/stream/RollupStream.java    |    8 +-
 .../client/solrj/io/stream/SelectStream.java    |    1 -
 .../solr/client/solrj/io/stream/SolrStream.java |   25 +-
 .../client/solrj/io/stream/StatsStream.java     |    3 +-
 .../client/solrj/io/stream/StreamContext.java   |    1 -
 .../client/solrj/io/stream/TopicStream.java     |  463 +++++++
 .../client/solrj/io/stream/TupleStream.java     |    4 +-
 .../client/solrj/io/stream/UniqueStream.java    |    1 -
 .../solrj/io/stream/expr/Expressible.java       |    7 +-
 .../solrj/io/stream/expr/StreamExpression.java  |    9 +-
 .../expr/StreamExpressionNamedParameter.java    |    7 +-
 .../stream/expr/StreamExpressionParameter.java  |    3 +-
 .../io/stream/expr/StreamExpressionParser.java  |   22 +-
 .../io/stream/expr/StreamExpressionValue.java   |    3 +-
 .../solrj/io/stream/expr/StreamFactory.java     |   33 +-
 .../client/solrj/io/stream/metrics/Bucket.java  |   11 +-
 .../solrj/io/stream/metrics/CountMetric.java    |    3 +-
 .../solrj/io/stream/metrics/MaxMetric.java      |    3 +-
 .../solrj/io/stream/metrics/MeanMetric.java     |    3 +-
 .../client/solrj/io/stream/metrics/Metric.java  |    3 +-
 .../solrj/io/stream/metrics/MinMetric.java      |    3 +-
 .../solrj/io/stream/metrics/SumMetric.java      |    3 +-
 .../solrj/request/AbstractUpdateRequest.java    |    3 +-
 .../solrj/request/CollectionAdminRequest.java   |  375 ++++--
 .../solrj/request/ConfigSetAdminRequest.java    |    1 -
 .../request/ContentStreamUpdateRequest.java     |    4 +-
 .../client/solrj/request/CoreAdminRequest.java  |   34 +-
 .../client/solrj/request/DirectXmlRequest.java  |    1 -
 .../solrj/request/DocumentAnalysisRequest.java  |    1 -
 .../solrj/request/FieldAnalysisRequest.java     |    1 -
 .../solrj/request/GenericSolrRequest.java       |    3 +-
 .../client/solrj/request/IsUpdateRequest.java   |    4 +-
 .../solr/client/solrj/request/LukeRequest.java  |    1 -
 .../solr/client/solrj/request/QueryRequest.java |    1 -
 .../client/solrj/request/RequestWriter.java     |    1 -
 .../solr/client/solrj/request/SolrPing.java     |    1 -
 .../client/solrj/request/UpdateRequest.java     |    3 +-
 .../request/schema/AbstractSchemaRequest.java   |    3 +-
 .../request/schema/AnalyzerDefinition.java      |    3 +-
 .../request/schema/FieldTypeDefinition.java     |    3 +-
 .../solrj/request/schema/SchemaRequest.java     |    3 +-
 .../solrj/response/AnalysisResponseBase.java    |    1 -
 .../solr/client/solrj/response/Cluster.java     |    3 +-
 .../solrj/response/ClusteringResponse.java      |    3 +-
 .../solrj/response/CollectionAdminResponse.java |    1 -
 .../solrj/response/ConfigSetAdminResponse.java  |    1 -
 .../solrj/response/CoreAdminResponse.java       |    1 -
 .../response/DocumentAnalysisResponse.java      |    1 -
 .../solr/client/solrj/response/FacetField.java  |    1 -
 .../solrj/response/FieldAnalysisResponse.java   |    1 -
 .../solr/client/solrj/response/Group.java       |    3 +-
 .../client/solrj/response/GroupCommand.java     |    3 +-
 .../client/solrj/response/GroupResponse.java    |    3 +-
 .../client/solrj/response/IntervalFacet.java    |    8 +-
 .../client/solrj/response/LukeResponse.java     |    1 -
 .../solr/client/solrj/response/PivotField.java  |    1 -
 .../client/solrj/response/QueryResponse.java    |    1 -
 .../solr/client/solrj/response/RangeFacet.java  |    3 +-
 .../solrj/response/SimpleSolrResponse.java      |    4 +-
 .../client/solrj/response/SolrPingResponse.java |    1 -
 .../client/solrj/response/SolrResponseBase.java |    1 -
 .../solrj/response/SpellCheckResponse.java      |    3 +-
 .../solrj/response/SuggesterResponse.java       |    3 +-
 .../solr/client/solrj/response/Suggestion.java  |    2 +-
 .../client/solrj/response/TermsResponse.java    |    3 +-
 .../client/solrj/response/UpdateResponse.java   |    1 -
 .../schema/FieldTypeRepresentation.java         |    3 +-
 .../response/schema/SchemaRepresentation.java   |    3 +-
 .../solrj/response/schema/SchemaResponse.java   |    3 +-
 .../solr/client/solrj/util/ClientUtils.java     |    1 -
 .../solrj/util/SolrIdentifierValidator.java     |   51 +
 .../java/org/apache/solr/common/Callable.java   |    3 +-
 .../apache/solr/common/EmptyEntityResolver.java |    3 +-
 .../org/apache/solr/common/EnumFieldValue.java  |    3 +-
 .../solr/common/NonExistentCoreException.java   |   25 +
 .../org/apache/solr/common/SolrDocument.java    |    1 -
 .../apache/solr/common/SolrDocumentBase.java    |   13 +-
 .../apache/solr/common/SolrDocumentList.java    |    1 -
 .../org/apache/solr/common/SolrException.java   |   11 +-
 .../apache/solr/common/SolrInputDocument.java   |    1 -
 .../org/apache/solr/common/SolrInputField.java  |    1 -
 .../org/apache/solr/common/StringUtils.java     |    3 +-
 .../org/apache/solr/common/cloud/Aliases.java   |    3 +-
 .../solr/common/cloud/BeforeReconnect.java      |   27 +-
 .../solr/common/cloud/ClosableThread.java       |    3 +-
 .../apache/solr/common/cloud/ClusterState.java  |    3 +-
 .../solr/common/cloud/ClusterStateUtil.java     |   31 +-
 .../solr/common/cloud/CompositeIdRouter.java    |    3 +-
 .../solr/common/cloud/ConnectionManager.java    |  103 +-
 .../common/cloud/DefaultConnectionStrategy.java |   27 +-
 .../solr/common/cloud/DefaultZkACLProvider.java |   13 +-
 .../cloud/DefaultZkCredentialsProvider.java     |    9 +-
 .../apache/solr/common/cloud/DocCollection.java |    3 +-
 .../org/apache/solr/common/cloud/DocRouter.java |    3 +-
 .../solr/common/cloud/HashBasedRouter.java      |    3 +-
 .../solr/common/cloud/ImplicitDocRouter.java    |    3 +-
 .../apache/solr/common/cloud/OnReconnect.java   |   27 +-
 .../apache/solr/common/cloud/PlainIdRouter.java |    5 +-
 .../org/apache/solr/common/cloud/Replica.java   |    3 +-
 .../apache/solr/common/cloud/RoutingRule.java   |    3 +-
 .../solr/common/cloud/SaslZkACLProvider.java    |    3 +-
 .../org/apache/solr/common/cloud/Slice.java     |    3 +-
 .../apache/solr/common/cloud/SolrZkClient.java  |   23 +-
 .../apache/solr/common/cloud/SolrZooKeeper.java |    3 +-
 ...ParamsAllAndReadonlyDigestZkACLProvider.java |   23 +-
 ...tCredentialsDigestZkCredentialsProvider.java |   17 +-
 .../apache/solr/common/cloud/ZkACLProvider.java |   11 +-
 .../cloud/ZkClientConnectionStrategy.java       |   27 +-
 .../apache/solr/common/cloud/ZkCmdExecutor.java |    3 +-
 .../solr/common/cloud/ZkConfigManager.java      |    1 -
 .../solr/common/cloud/ZkCoreNodeProps.java      |   27 +-
 .../common/cloud/ZkCredentialsProvider.java     |    7 +-
 .../apache/solr/common/cloud/ZkNodeProps.java   |    3 +-
 .../apache/solr/common/cloud/ZkOperation.java   |    6 +-
 .../apache/solr/common/cloud/ZkStateReader.java |   59 +-
 .../solr/common/cloud/ZooKeeperException.java   |    4 +-
 .../org/apache/solr/common/luke/FieldFlag.java  |    4 +-
 .../solr/common/params/AnalysisParams.java      |    1 -
 .../solr/common/params/AppendedSolrParams.java  |    1 -
 .../common/params/CollectionAdminParams.java    |   24 +
 .../solr/common/params/CollectionParams.java    |    4 +-
 .../solr/common/params/CommonAdminParams.java   |    1 -
 .../apache/solr/common/params/CommonParams.java |    7 +-
 .../solr/common/params/ConfigSetParams.java     |    3 +-
 .../solr/common/params/CoreAdminParams.java     |    1 -
 .../solr/common/params/CursorMarkParams.java    |    1 -
 .../solr/common/params/DefaultSolrParams.java   |    1 -
 .../apache/solr/common/params/DisMaxParams.java |    1 -
 .../apache/solr/common/params/EventParams.java  |    4 +-
 .../apache/solr/common/params/ExpandParams.java |    1 -
 .../apache/solr/common/params/FacetParams.java  |    6 +-
 .../apache/solr/common/params/GroupParams.java  |    1 -
 .../solr/common/params/HighlightParams.java     |    1 -
 .../solr/common/params/MapSolrParams.java       |    1 -
 .../common/params/ModifiableSolrParams.java     |    1 -
 .../solr/common/params/MoreLikeThisParams.java  |    1 -
 .../solr/common/params/MultiMapSolrParams.java  |    1 -
 .../common/params/QueryElevationParams.java     |    4 +-
 .../solr/common/params/RequiredSolrParams.java  |    1 -
 .../apache/solr/common/params/ShardParams.java  |    1 -
 .../apache/solr/common/params/SimpleParams.java |    3 +-
 .../apache/solr/common/params/SolrParams.java   |    1 -
 .../solr/common/params/SpatialParams.java       |    4 +-
 .../solr/common/params/SpellingParams.java      |    1 -
 .../apache/solr/common/params/StatsParams.java  |    1 -
 .../solr/common/params/TermVectorParams.java    |    4 +-
 .../apache/solr/common/params/TermsParams.java  |    1 -
 .../apache/solr/common/params/UpdateParams.java |    1 -
 .../org/apache/solr/common/util/ByteUtils.java  |    1 -
 .../java/org/apache/solr/common/util/Cache.java |    3 +-
 .../apache/solr/common/util/ContentStream.java  |    1 -
 .../solr/common/util/ContentStreamBase.java     |    1 -
 .../solr/common/util/DataInputInputStream.java  |    1 -
 .../org/apache/solr/common/util/DateUtil.java   |    3 +-
 .../apache/solr/common/util/ExecutorUtil.java   |   11 +-
 .../solr/common/util/FastInputStream.java       |    1 -
 .../solr/common/util/FastOutputStream.java      |    1 -
 .../java/org/apache/solr/common/util/Hash.java  |    3 +-
 .../org/apache/solr/common/util/IOUtils.java    |   15 +-
 .../apache/solr/common/util/IteratorChain.java  |    1 -
 .../org/apache/solr/common/util/NamedList.java  |    1 -
 .../solr/common/util/ObjectReleaseTracker.java  |    3 +-
 .../java/org/apache/solr/common/util/Pair.java  |    3 +-
 .../org/apache/solr/common/util/RetryUtil.java  |   11 +-
 .../solr/common/util/SimpleOrderedMap.java      |    3 +-
 .../common/util/SolrjNamedThreadFactory.java    |    9 +-
 .../org/apache/solr/common/util/StrUtils.java   |    1 -
 .../solr/common/util/SuppressForbidden.java     |    3 +-
 .../org/apache/solr/common/util/URLUtil.java    |    1 -
 .../java/org/apache/solr/common/util/Utils.java |   60 +-
 .../java/org/apache/solr/common/util/XML.java   |    1 -
 .../apache/solr/common/util/XMLErrorLogger.java |    1 -
 .../solr/collection1/conf/schema-streaming.xml  |    1 +
 ...ollectionAdminRequestRequiredParamsTest.java |    3 +-
 .../apache/solr/client/solrj/GetByIdTest.java   |    3 +-
 .../solr/client/solrj/LargeVolumeTestBase.java  |    1 -
 .../solrj/MergeIndexesExampleTestBase.java      |    1 -
 .../client/solrj/SolrExampleBinaryTest.java     |    1 -
 .../solr/client/solrj/SolrExampleTestBase.java  |    1 -
 .../solr/client/solrj/SolrExampleTests.java     |    1 -
 .../solr/client/solrj/SolrExampleTestsBase.java |    1 -
 .../solr/client/solrj/SolrExampleXMLTest.java   |    1 -
 .../solr/client/solrj/SolrExceptionTest.java    |    1 -
 .../apache/solr/client/solrj/SolrQueryTest.java |    1 -
 .../client/solrj/SolrSchemalessExampleTest.java |    1 -
 .../solr/client/solrj/StartSolrJetty.java       |    1 -
 .../solr/client/solrj/TestLBHttpSolrClient.java |    1 -
 .../client/solrj/TestSolrJErrorHandling.java    |    7 +-
 .../AbstractEmbeddedSolrServerTestCase.java     |    3 +-
 .../client/solrj/embedded/JettyWebappTest.java  |    1 -
 .../solrj/embedded/LargeVolumeEmbeddedTest.java |    1 -
 .../solrj/embedded/LargeVolumeJettyTest.java    |    1 -
 .../embedded/MergeIndexesEmbeddedTest.java      |    1 -
 .../solrj/embedded/SolrExampleEmbeddedTest.java |    1 -
 .../solrj/embedded/SolrExampleJettyTest.java    |    1 -
 .../SolrExampleStreamingBinaryTest.java         |    3 +-
 .../embedded/SolrExampleStreamingTest.java      |    1 -
 .../solrj/embedded/TestEmbeddedSolrServer.java  |    3 +-
 .../solrj/embedded/TestSolrProperties.java      |    1 -
 .../solrj/impl/BasicHttpSolrClientTest.java     |    7 +-
 .../CloudSolrClientMultiConstructorTest.java    |   21 +-
 .../client/solrj/impl/CloudSolrClientTest.java  |    3 +-
 .../impl/ConcurrentUpdateSolrClientTest.java    |    3 -
 .../solrj/impl/ExternalHttpClientTest.java      |    3 +-
 .../client/solrj/impl/LBHttpSolrClientTest.java |    1 -
 .../solrj/impl/SolrPortAwareCookieSpecTest.java |    3 +-
 .../impl/TestCloudSolrClientConnections.java    |    3 +-
 .../client/solrj/io/sql/JdbcDriverTest.java     |    3 +-
 .../solr/client/solrj/io/sql/JdbcTest.java      |  697 +++++++---
 .../client/solrj/io/stream/JDBCStreamTest.java  |    3 +-
 .../solrj/io/stream/RecordCountStream.java      |    2 +-
 .../solrj/io/stream/StreamExpressionTest.java   |  246 +++-
 .../stream/StreamExpressionToExpessionTest.java |   42 +-
 .../client/solrj/io/stream/StreamingTest.java   |    3 +-
 .../stream/expr/StreamExpressionParserTest.java |    3 +-
 .../io/stream/ops/ConcatOperationTest.java      |    3 +-
 .../solrj/io/stream/ops/OperationsTest.java     |    3 +-
 .../solr/client/solrj/request/SchemaTest.java   |    3 +-
 .../solr/client/solrj/request/SolrPingTest.java |    3 +-
 .../request/TestCollectionAdminRequest.java     |   85 ++
 .../request/TestConfigSetAdminRequest.java      |    1 -
 .../client/solrj/request/TestCoreAdmin.java     |   39 +-
 .../client/solrj/request/TestUpdateRequest.java |    3 +-
 .../solrj/response/AnlysisResponseBaseTest.java |    1 -
 .../response/DocumentAnalysisResponseTest.java  |    1 -
 .../client/solrj/response/FacetFieldTest.java   |    3 +-
 .../response/FieldAnalysisResponseTest.java     |    1 -
 .../solrj/response/NoOpResponseParserTest.java  |    3 +-
 .../solrj/response/QueryResponseTest.java       |    1 -
 .../solrj/response/TermsResponseTest.java       |    3 +-
 .../solrj/response/TestClusteringResponse.java  |    3 +-
 .../solrj/response/TestSpellCheckResponse.java  |    3 +-
 .../solrj/response/TestSuggesterResponse.java   |    3 +-
 .../solr/client/solrj/util/ClientUtilsTest.java |    1 -
 .../apache/solr/common/SolrDocumentTest.java    |    1 -
 .../solr/common/cloud/SolrZkClientTest.java     |    3 +-
 .../solr/common/cloud/TestZkConfigManager.java  |    1 -
 .../common/params/CommonAdminParamsTest.java    |    1 -
 .../solr/common/params/CommonParamsTest.java    |    1 -
 .../common/params/ModifiableSolrParamsTest.java |   25 +-
 .../solr/common/params/ShardParamsTest.java     |    3 +-
 .../solr/common/params/SolrParamTest.java       |    1 -
 .../solr/common/util/ContentStreamTest.java     |    1 -
 .../solr/common/util/IteratorChainTest.java     |    1 -
 .../apache/solr/common/util/NamedListTest.java  |    1 -
 .../apache/solr/common/util/TestDateUtil.java   |    3 +-
 .../org/apache/solr/common/util/TestHash.java   |    3 +-
 .../solr/common/util/TestJavaBinCodec.java      |    3 +-
 .../solr/common/util/TestJsonRecordReader.java  |    3 +-
 .../apache/solr/common/util/TestRetryUtil.java  |    3 +-
 .../solr/common/util/TestXMLEscaping.java       |    1 -
 .../apache/solr/common/util/URLUtilTest.java    |    1 -
 .../solr/BaseDistributedSearchTestCase.java     |    3 +-
 .../src/java/org/apache/solr/JSONTestUtil.java  |    1 -
 .../apache/solr/SolrIgnoredThreadsFilter.java   |   13 +-
 .../java/org/apache/solr/SolrJettyTestBase.java |    3 +-
 .../java/org/apache/solr/SolrTestCaseHS.java    |    4 +-
 .../java/org/apache/solr/SolrTestCaseJ4.java    |   46 +-
 .../solr/analysis/MockCharFilterFactory.java    |    3 +-
 .../solr/analysis/MockTokenFilterFactory.java   |    3 +-
 .../solr/analysis/MockTokenizerFactory.java     |    3 +-
 .../analysis/StringMockSolrResourceLoader.java  |    3 +-
 .../solr/cloud/AbstractDistribZkTestBase.java   |    3 +-
 .../cloud/AbstractFullDistribZkTestBase.java    |    1 +
 .../apache/solr/cloud/AbstractZkTestCase.java   |    3 +-
 .../java/org/apache/solr/cloud/ChaosMonkey.java |    7 +-
 .../org/apache/solr/cloud/CloudInspectUtil.java |   33 +-
 .../java/org/apache/solr/cloud/IpTables.java    |    4 +-
 .../apache/solr/cloud/MiniSolrCloudCluster.java |    3 +-
 .../org/apache/solr/cloud/MockSolrZkClient.java |    3 +-
 .../apache/solr/cloud/MockZkStateReader.java    |    3 +-
 .../java/org/apache/solr/cloud/SocketProxy.java |    3 +-
 .../solr/cloud/StoppableIndexingThread.java     |   25 +-
 .../solr/cloud/StoppableSearchThread.java       |    7 +-
 .../org/apache/solr/cloud/ZkTestServer.java     |   27 +-
 .../solr/core/AbstractBadConfigTestBase.java    |    1 -
 .../apache/solr/core/MockDirectoryFactory.java  |    6 +-
 .../solr/core/MockFSDirectoryFactory.java       |    4 +-
 .../component/TrackingShardHandlerFactory.java  |    3 +-
 .../processor/BufferingRequestProcessor.java    |    1 -
 .../apache/solr/util/AbstractSolrTestCase.java  |    2 -
 .../apache/solr/util/BadHdfsThreadsFilter.java  |    3 +-
 .../solr/util/BadMrClusterThreadsFilter.java    |    3 +-
 .../solr/util/BadZookeeperThreadsFilter.java    |    3 +-
 .../org/apache/solr/util/BaseTestHarness.java   |    3 +-
 .../org/apache/solr/util/DOMUtilTestBase.java   |    1 -
 .../org/apache/solr/util/ExternalPaths.java     |    3 +-
 .../apache/solr/util/RESTfulServerProvider.java |    3 +-
 .../solr/util/RandomForceMergePolicy.java       |    1 -
 .../util/RandomForceMergePolicyFactory.java     |   37 +
 .../org/apache/solr/util/RandomMergePolicy.java |   52 +-
 .../solr/util/RandomMergePolicyFactory.java     |   35 +
 .../apache/solr/util/ReadOnlyCoresLocator.java  |    3 +-
 .../java/org/apache/solr/util/RestTestBase.java |    3 +-
 .../org/apache/solr/util/RestTestHarness.java   |    3 +-
 .../util/RevertDefaultThreadHandlerRule.java    |   23 +-
 .../org/apache/solr/util/SSLTestConfig.java     |    6 +-
 .../java/org/apache/solr/util/TestHarness.java  |    1 -
 5524 files changed, 41136 insertions(+), 30337 deletions(-)
----------------------------------------------------------------------



[28/53] [abbrv] lucene-solr git commit: Merge remote-tracking branch 'origin/master'

Posted by no...@apache.org.
Merge remote-tracking branch 'origin/master'


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/261681cd
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/261681cd
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/261681cd

Branch: refs/heads/apiv2
Commit: 261681cdc2b604e6238accc368ae7b233ae3e2af
Parents: 1d0084a da28b98
Author: Noble Paul <no...@apache.org>
Authored: Mon Feb 22 05:41:43 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Mon Feb 22 05:41:43 2016 +0530

----------------------------------------------------------------------
 lucene/JRE_VERSION_MIGRATION.txt                                 | 2 +-
 .../src/java/org/apache/lucene/store/BaseDirectoryTestCase.java  | 3 +++
 .../src/java/org/apache/lucene/store/MockDirectoryWrapper.java   | 4 +---
 3 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[22/53] [abbrv] lucene-solr git commit: SOLR-8700 eliminate the java class for implicit plugins

Posted by no...@apache.org.
SOLR-8700 eliminate the java class for implicit plugins


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5a15fed9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5a15fed9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5a15fed9

Branch: refs/heads/apiv2
Commit: 5a15fed9f5249cf658ddfbccae55733bb5855190
Parents: 2b3529c
Author: Noble Paul <no...@apache.org>
Authored: Sun Feb 21 20:49:55 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Sun Feb 21 20:49:55 2016 +0530

----------------------------------------------------------------------
 .../org/apache/solr/core/ImplicitPlugins.java   | 152 -------------------
 .../org/apache/solr/core/RequestHandlers.java   |   2 +-
 .../src/java/org/apache/solr/core/SolrCore.java |  16 ++
 .../apache/solr/core/SolrResourceLoader.java    |   2 +-
 .../org/apache/solr/handler/SchemaHandler.java  |  11 +-
 .../apache/solr/handler/SolrConfigHandler.java  |  26 ++--
 solr/core/src/resources/ImplicitPlugins.json    | 102 +++++++++++++
 7 files changed, 143 insertions(+), 168 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a15fed9/solr/core/src/java/org/apache/solr/core/ImplicitPlugins.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/ImplicitPlugins.java b/solr/core/src/java/org/apache/solr/core/ImplicitPlugins.java
deleted file mode 100644
index f6a74da..0000000
--- a/solr/core/src/java/org/apache/solr/core/ImplicitPlugins.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.core;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.handler.PingRequestHandler;
-import org.apache.solr.handler.RealTimeGetHandler;
-import org.apache.solr.handler.ReplicationHandler;
-import org.apache.solr.handler.SQLHandler;
-import org.apache.solr.handler.SchemaHandler;
-import org.apache.solr.handler.SolrConfigHandler;
-import org.apache.solr.handler.StreamHandler;
-import org.apache.solr.handler.UpdateRequestHandler;
-import org.apache.solr.handler.admin.LoggingHandler;
-import org.apache.solr.handler.admin.LukeRequestHandler;
-import org.apache.solr.handler.admin.PluginInfoHandler;
-import org.apache.solr.handler.admin.PropertiesRequestHandler;
-import org.apache.solr.handler.admin.SegmentsInfoRequestHandler;
-import org.apache.solr.handler.admin.ShowFileRequestHandler;
-import org.apache.solr.handler.admin.SolrInfoMBeanHandler;
-import org.apache.solr.handler.admin.SystemInfoHandler;
-import org.apache.solr.handler.admin.ThreadDumpHandler;
-import org.apache.solr.handler.component.SearchHandler;
-import org.apache.solr.request.SolrRequestHandler;
-
-import static java.util.Collections.singletonMap;
-import static org.apache.solr.common.params.CommonParams.JSON;
-import static org.apache.solr.common.params.CommonParams.NAME;
-import static org.apache.solr.common.params.CommonParams.WT;
-import static org.apache.solr.common.util.Utils.makeMap;
-import static org.apache.solr.core.PluginInfo.APPENDS;
-import static org.apache.solr.core.PluginInfo.DEFAULTS;
-import static org.apache.solr.core.PluginInfo.INVARIANTS;
-
-public class ImplicitPlugins {
-
-  public static List<PluginInfo> getHandlers(SolrCore solrCore){
-    List<PluginInfo> implicits = new ArrayList<>();
-
-    //update handle implicits
-    implicits.add(createPluginInfoWithDefaults("/update", UpdateRequestHandler.class, null));
-    implicits.add(createPluginInfoWithDefaults(UpdateRequestHandler.JSON_PATH, UpdateRequestHandler.class, singletonMap("update.contentType", "application/json")));
-    implicits.add(createPluginInfoWithDefaults(UpdateRequestHandler.CSV_PATH, UpdateRequestHandler.class, singletonMap("update.contentType", "application/csv")));
-    implicits.add(createPluginInfoWithDefaults(UpdateRequestHandler.DOC_PATH, UpdateRequestHandler.class, makeMap("update.contentType", "application/json", "json.command", "false")));
-
-    //solrconfighandler
-    PluginInfo config = createPluginInfoWithDefaults("/config", SolrConfigHandler.class, null);
-    if (solrCore.getConfigSetProperties() != null) {
-      config.initArgs.addAll(solrCore.getConfigSetProperties());
-    }
-    implicits.add(config);
-    //schemahandler
-    PluginInfo schema = createPluginInfoWithDefaults("/schema", SchemaHandler.class, null);
-    if (solrCore.getConfigSetProperties() != null) {
-      schema.initArgs.addAll(solrCore.getConfigSetProperties());
-    }
-    implicits.add(schema);
-    //register replicationhandler always for SolrCloud
-    implicits.add(createPluginInfoWithDefaults("/replication", ReplicationHandler.class,null));
-
-    implicits.add(createPluginInfoWithDefaults("/get", RealTimeGetHandler.class,
-        makeMap(
-            "omitHeader", "true",
-            WT, JSON,
-            "indent", "true")));
-
-    PluginInfo exportInitArgs = createPluginInfo("/export", SearchHandler.class,
-        null, // defaults
-        null, // appends
-        // we need invariants here
-        makeMap(
-            "rq", "{!xport}",
-            "wt", "xsort",
-            "distrib", "false"
-        ));
-    exportInitArgs.initArgs.add("components", Collections.singletonList("query"));
-    implicits.add(exportInitArgs);
-
-    implicits.add(createPluginInfo("/stream", StreamHandler.class,
-        null, // defaults
-        null, // appends
-        // we need invariants here
-        makeMap(
-            "wt", "json",
-            "distrib", "false"
-        )));
-
-    implicits.add(createPluginInfo("/sql", SQLHandler.class,
-        null, // defaults
-        null, // appends
-        // we need invariants here
-        makeMap(
-            "wt", "json",
-            "distrib", "false"
-        )));
-
-    //register adminHandlers
-    implicits.add(createPluginInfoWithDefaults("/admin/luke", LukeRequestHandler.class, null));
-    implicits.add(createPluginInfoWithDefaults("/admin/system", SystemInfoHandler.class, null));
-    implicits.add(createPluginInfoWithDefaults("/admin/mbeans", SolrInfoMBeanHandler.class, null));
-    implicits.add(createPluginInfoWithDefaults("/admin/plugins", PluginInfoHandler.class, null));
-    implicits.add(createPluginInfoWithDefaults("/admin/threads", ThreadDumpHandler.class, null));
-    implicits.add(createPluginInfoWithDefaults("/admin/properties", PropertiesRequestHandler.class, null));
-    implicits.add(createPluginInfoWithDefaults("/admin/logging", LoggingHandler.class, null));
-    implicits.add(createPluginInfoWithDefaults("/admin/file", ShowFileRequestHandler.class, null));
-    implicits.add(createPluginInfo("/admin/ping", PingRequestHandler.class,
-        null, // defaults
-        null, // appends
-        // invariants
-        makeMap("echoParams", "all", "q", "{!lucene}*:*")));
-    implicits.add(createPluginInfoWithDefaults("/admin/segments", SegmentsInfoRequestHandler.class, null));
-    return implicits;
-  }
-
-  public static PluginInfo createPluginInfoWithDefaults(String name, Class clz, Map defaults) {
-    return createPluginInfo(name, clz, defaults, null, null);
-  }
-
-  public static PluginInfo createPluginInfo(String name, Class clz, Map defaults, Map appends, Map invariants) {
-    if (defaults == null) defaults = Collections.emptyMap();
-    Map m = makeMap(NAME, name, "class", clz.getName());
-    Map<String, Object> args = new HashMap<>(1);
-    args.put(DEFAULTS, new NamedList<>(defaults));
-    if (appends != null)  {
-      args.put(APPENDS, new NamedList<>(appends));
-    }
-    if (invariants != null) {
-      args.put(INVARIANTS, new NamedList<>(invariants));
-    }
-    return new PluginInfo(SolrRequestHandler.TYPE, m, new NamedList<>(args), null);
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a15fed9/solr/core/src/java/org/apache/solr/core/RequestHandlers.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/RequestHandlers.java b/solr/core/src/java/org/apache/solr/core/RequestHandlers.java
index d2fbdf9..0f5022a 100644
--- a/solr/core/src/java/org/apache/solr/core/RequestHandlers.java
+++ b/solr/core/src/java/org/apache/solr/core/RequestHandlers.java
@@ -115,7 +115,7 @@ public final class RequestHandlers {
    */
 
   void initHandlersFromConfig(SolrConfig config) {
-    List<PluginInfo> implicits = ImplicitPlugins.getHandlers(core);
+    List<PluginInfo> implicits = core.getImplicitHandlers();
     // use link map so we iterate in the same order
     Map<String, PluginInfo> infoMap= new LinkedHashMap<>();
     //deduping implicit and explicit requesthandlers

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a15fed9/solr/core/src/java/org/apache/solr/core/SolrCore.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java
index 70954d5..5d7ebdc 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java
@@ -66,6 +66,7 @@ import org.apache.solr.common.util.IOUtils;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.ObjectReleaseTracker;
 import org.apache.solr.common.util.SimpleOrderedMap;
+import org.apache.solr.common.util.Utils;
 import org.apache.solr.core.DirectoryFactory.DirContext;
 import org.apache.solr.handler.IndexFetcher;
 import org.apache.solr.handler.ReplicationHandler;
@@ -117,6 +118,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+import static org.apache.solr.common.params.CommonParams.NAME;
 import static org.apache.solr.common.params.CommonParams.PATH;
 
 /**
@@ -2668,6 +2670,20 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
       cleanupThread.start();
     }
   }
+
+  private static final Map implicitPluginsInfo = (Map) Utils.fromJSONResource("ImplicitPlugins.json");
+
+  public List<PluginInfo> getImplicitHandlers() {
+    List<PluginInfo> implicits = new ArrayList<>();
+    Map requestHandlers = (Map) implicitPluginsInfo.get(SolrRequestHandler.TYPE);
+    for (Object o : requestHandlers.entrySet()) {
+      Map.Entry<String, Map> entry = (Map.Entry<String, Map>) o;
+      Map info = Utils.getDeepCopy(entry.getValue(), 4);
+      info.put(NAME, entry.getKey());
+      implicits.add(new PluginInfo(SolrRequestHandler.TYPE, info));
+    }
+    return implicits;
+  }
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a15fed9/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
index 5db04ca..ae6739e 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
@@ -87,7 +87,7 @@ public class SolrResourceLoader implements ResourceLoader,Closeable
   static final String[] packages = {
       "", "analysis.", "schema.", "handler.", "search.", "update.", "core.", "response.", "request.",
       "update.processor.", "util.", "spelling.", "handler.component.", "handler.dataimport.",
-      "spelling.suggest.", "spelling.suggest.fst.", "rest.schema.analysis.", "security."
+      "spelling.suggest.", "spelling.suggest.fst.", "rest.schema.analysis.", "security.","handler.admin."
   };
 
   protected URLClassLoader classLoader;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a15fed9/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java b/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
index 67d6610..046de46 100644
--- a/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/SchemaHandler.java
@@ -29,6 +29,7 @@ import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.ContentStream;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SimpleOrderedMap;
+import org.apache.solr.core.SolrCore;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.request.SolrRequestHandler;
 import org.apache.solr.response.SolrQueryResponse;
@@ -36,21 +37,20 @@ import org.apache.solr.schema.IndexSchema;
 import org.apache.solr.schema.ManagedIndexSchema;
 import org.apache.solr.schema.SchemaManager;
 import org.apache.solr.schema.ZkIndexSchemaReader;
+import org.apache.solr.util.plugin.SolrCoreAware;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static org.apache.solr.common.params.CommonParams.JSON;
 import static org.apache.solr.core.ConfigSetProperties.IMMUTABLE_CONFIGSET_ARG;
 
-public class SchemaHandler extends RequestHandlerBase {
+public class SchemaHandler extends RequestHandlerBase implements SolrCoreAware {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   private boolean isImmutableConfigSet = false;
 
   @Override
   public void init(NamedList args) {
     super.init(args);
-    Object immutable = args.get(IMMUTABLE_CONFIGSET_ARG);
-    isImmutableConfigSet = immutable  != null ? Boolean.parseBoolean(immutable.toString()) : false;
   }
 
   @Override
@@ -180,4 +180,9 @@ public class SchemaHandler extends RequestHandlerBase {
   public String getDescription() {
     return "CRUD operations over the Solr schema";
   }
+
+  @Override
+  public void inform(SolrCore core) {
+    isImmutableConfigSet = SolrConfigHandler.getImmutable(core);
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a15fed9/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
index e862e05..a566c0e 100644
--- a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
@@ -48,7 +48,6 @@ import org.apache.solr.common.SolrException;
 import org.apache.solr.common.cloud.ClusterState;
 import org.apache.solr.common.cloud.Replica;
 import org.apache.solr.common.cloud.Slice;
-import org.apache.solr.common.cloud.ZkNodeProps;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.MapSolrParams;
 import org.apache.solr.common.params.ModifiableSolrParams;
@@ -59,7 +58,6 @@ import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.StrUtils;
 import org.apache.solr.common.util.Utils;
 import org.apache.solr.core.ConfigOverlay;
-import org.apache.solr.core.ImplicitPlugins;
 import org.apache.solr.core.PluginInfo;
 import org.apache.solr.core.RequestParams;
 import org.apache.solr.core.SolrConfig;
@@ -72,6 +70,7 @@ import org.apache.solr.schema.SchemaManager;
 import org.apache.solr.util.CommandOperation;
 import org.apache.solr.util.DefaultSolrThreadFactory;
 import org.apache.solr.util.RTimer;
+import org.apache.solr.util.plugin.SolrCoreAware;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -87,7 +86,7 @@ import static org.apache.solr.core.SolrConfig.PluginOpts.REQUIRE_NAME;
 import static org.apache.solr.core.SolrConfig.PluginOpts.REQUIRE_NAME_IN_OVERLAY;
 import static org.apache.solr.schema.FieldType.CLASS_NAME;
 
-public class SolrConfigHandler extends RequestHandlerBase {
+public class SolrConfigHandler extends RequestHandlerBase implements SolrCoreAware {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   public static final String CONFIGSET_EDITING_DISABLED_ARG = "disable.configEdit";
   public static final boolean configEditing_disabled = Boolean.getBoolean(CONFIGSET_EDITING_DISABLED_ARG);
@@ -106,13 +105,6 @@ public class SolrConfigHandler extends RequestHandlerBase {
   }
 
   @Override
-  public void init(NamedList args) {
-    super.init(args);
-    Object immutable = args.get(IMMUTABLE_CONFIGSET_ARG);
-    isImmutableConfigSet = immutable  != null ? Boolean.parseBoolean(immutable.toString()) : false;
-  }
-
-  @Override
   public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
 
     setWt(req, CommonParams.JSON);
@@ -133,6 +125,18 @@ public class SolrConfigHandler extends RequestHandlerBase {
     }
   }
 
+  @Override
+  public void inform(SolrCore core) {
+    isImmutableConfigSet = getImmutable(core);
+  }
+
+  public static boolean getImmutable(SolrCore core) {
+    NamedList configSetProperties = core.getConfigSetProperties();
+    if(configSetProperties == null) return false;
+    Object immutable = configSetProperties.get(IMMUTABLE_CONFIGSET_ARG);
+    return immutable != null ? Boolean.parseBoolean(immutable.toString()) : false;
+  }
+
 
   private class Command {
     private final SolrQueryRequest req;
@@ -232,7 +236,7 @@ public class SolrConfigHandler extends RequestHandlerBase {
       Map<String, Object> map = req.getCore().getSolrConfig().toMap();
       Map reqHandlers = (Map) map.get(SolrRequestHandler.TYPE);
       if (reqHandlers == null) map.put(SolrRequestHandler.TYPE, reqHandlers = new LinkedHashMap<>());
-      List<PluginInfo> plugins = ImplicitPlugins.getHandlers(req.getCore());
+      List<PluginInfo> plugins = req.getCore().getImplicitHandlers();
       for (PluginInfo plugin : plugins) {
         if (SolrRequestHandler.TYPE.equals(plugin.type)) {
           if (!reqHandlers.containsKey(plugin.name)) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5a15fed9/solr/core/src/resources/ImplicitPlugins.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/ImplicitPlugins.json b/solr/core/src/resources/ImplicitPlugins.json
new file mode 100644
index 0000000..8c0549a
--- /dev/null
+++ b/solr/core/src/resources/ImplicitPlugins.json
@@ -0,0 +1,102 @@
+{
+  "requestHandler": {
+    "/update": {
+      "class": "solr.UpdateRequestHandler"
+    },
+    "/update/json": {
+      "class": "solr.UpdateRequestHandler",
+      "invariants": {
+        "update.contentType": "application/json"
+      }
+    },
+    "/update/csv": {
+      "class": "solr.UpdateRequestHandler",
+      "invariants": {
+        "update.contentType": "application/csv"
+      }
+    },
+    "/update/json/docs": {
+      "class": "solr.UpdateRequestHandler",
+      "invariants": {
+        "update.contentType": "application/json",
+        "json.command": "false"
+      }
+    },
+    "/config": {
+      "class": "solr.SolrConfigHandler"
+    },
+    "/schema": {
+      "class": "solr.SchemaHandler"
+    },
+    "/replication": {
+      "class": "solr.ReplicationHandler"
+    },
+    "/get": {
+      "class": "solr.RealTimeGetHandler",
+      "defaults": {
+        "omitHeader": true,
+        "wt": "json",
+        "indent": true
+      }
+    },
+    "/admin/ping": {
+      "class": "solr.PingRequestHandler",
+      "invariants": {
+        "echoParams": "all",
+        "q": "{!lucene}*:*"
+      }
+    },
+    "/admin/segments": {
+      "class": "solr.SegmentsInfoRequestHandler"
+    },
+    "/admin/luke": {
+      "class": "solr.LukeRequestHandler"
+    },
+    "/admin/system": {
+      "class": "solr.SystemInfoHandler"
+    },
+    "/admin/mbeans": {
+      "class": "solr.SolrInfoMBeanHandler"
+    },
+    "/admin/plugins": {
+      "class": "solr.PluginInfoHandler"
+    },
+    "/admin/threads": {
+      "class": "solr.ThreadDumpHandler"
+    },
+    "/admin/properties": {
+      "class": "solr.PropertiesRequestHandler"
+    },
+    "/admin/logging": {
+      "class": "solr.LoggingHandler"
+    },
+    "/admin/file": {
+      "class": "solr.ShowFileRequestHandler"
+    },
+    "/export": {
+      "class": "solr.SearchHandler",
+      "components": [
+        "query"
+      ],
+      "invariants": {
+        "rq": "{!xport}",
+        "wt": "xsort",
+        "distrib": false
+      }
+    },
+    "/stream": {
+      "class": "solr.StreamHandler",
+      "invariants": {
+        "wt": "json",
+        "distrib": false
+      }
+    },
+    "/sql": {
+      "class": "solr.SQLHandler",
+      "invariants": {
+        "wt": "json",
+        "distrib": false
+      }
+    }
+  }
+}
\ No newline at end of file


[48/53] [abbrv] lucene-solr git commit: SOLR-8719 renamed classes to make their usage generic

Posted by no...@apache.org.
SOLR-8719 renamed classes to make their usage generic


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/4d9d0c00
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/4d9d0c00
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/4d9d0c00

Branch: refs/heads/apiv2
Commit: 4d9d0c0011de8653fbe404af702e822883e8fb13
Parents: cf96432
Author: Noble Paul <no...@apache.org>
Authored: Tue Feb 23 16:14:49 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Tue Feb 23 16:14:49 2016 +0530

----------------------------------------------------------------------
 .../org/apache/solr/core/BlobRepository.java    | 254 +++++++++++++++++++
 .../org/apache/solr/core/CoreContainer.java     |   6 +-
 .../org/apache/solr/core/JarRepository.java     | 222 ----------------
 .../java/org/apache/solr/core/PluginBag.java    |  10 +-
 4 files changed, 262 insertions(+), 230 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/4d9d0c00/solr/core/src/java/org/apache/solr/core/BlobRepository.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/BlobRepository.java b/solr/core/src/java/org/apache/solr/core/BlobRepository.java
new file mode 100644
index 0000000..6739826
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/core/BlobRepository.java
@@ -0,0 +1,254 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.core;
+
+import static org.apache.solr.common.SolrException.ErrorCode.SERVICE_UNAVAILABLE;
+import static org.apache.solr.common.cloud.ZkStateReader.BASE_URL_PROP;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.invoke.MethodHandles;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.cloud.ClusterState;
+import org.apache.solr.common.cloud.DocCollection;
+import org.apache.solr.common.cloud.Replica;
+import org.apache.solr.common.cloud.Slice;
+import org.apache.solr.common.cloud.ZkStateReader;
+import org.apache.solr.handler.admin.CollectionsHandler;
+import org.apache.solr.util.CryptoKeys;
+import org.apache.solr.util.SimplePostTool;
+import org.apache.zookeeper.server.ByteBufferInputStream;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The purpose of this class is to store the Jars loaded in memory and to keep only one copy of the Jar in a single node.
+ */
+public class BlobRepository {
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+  static final Random RANDOM;
+
+  static {
+    // We try to make things reproducible in the context of our tests by initializing the random instance
+    // based on the current seed
+    String seed = System.getProperty("tests.seed");
+    if (seed == null) {
+      RANDOM = new Random();
+    } else {
+      RANDOM = new Random(seed.hashCode());
+    }
+  }
+
+  private final CoreContainer coreContainer;
+  private Map<String, BlobContent> blobs = new ConcurrentHashMap<>();
+
+  public BlobRepository(CoreContainer coreContainer) {
+    this.coreContainer = coreContainer;
+  }
+
+  public static ByteBuffer getFileContent(BlobContent blobContent, String entryName) throws IOException {
+    ByteArrayInputStream zipContents = new ByteArrayInputStream(blobContent.buffer.array(), blobContent.buffer.arrayOffset(), blobContent.buffer.limit());
+    ZipInputStream zis = new ZipInputStream(zipContents);
+    try {
+      ZipEntry entry;
+      while ((entry = zis.getNextEntry()) != null) {
+        if (entryName == null || entryName.equals(entry.getName())) {
+          SimplePostTool.BAOS out = new SimplePostTool.BAOS();
+          byte[] buffer = new byte[2048];
+          int size;
+          while ((size = zis.read(buffer, 0, buffer.length)) != -1) {
+            out.write(buffer, 0, size);
+          }
+          out.close();
+          return out.getByteBuffer();
+        }
+      }
+    } finally {
+      zis.closeEntry();
+    }
+    return null;
+  }
+
+  /**
+   * Returns the contents of a jar and increments a reference count. Please return the same object to decrease the refcount
+   *
+   * @param key it is a combination of blobname and version like blobName/version
+   * @return The reference of a jar
+   */
+  public BlobContentRef getBlobIncRef(String key) {
+    BlobContent aBlob = blobs.get(key);
+    if (aBlob == null) {
+      if (this.coreContainer.isZooKeeperAware()) {
+        Replica replica = getSystemCollReplica();
+        String url = replica.getStr(BASE_URL_PROP) + "/.system/blob/" + key + "?wt=filestream";
+
+        HttpClient httpClient = coreContainer.getUpdateShardHandler().getHttpClient();
+        HttpGet httpGet = new HttpGet(url);
+        ByteBuffer b;
+        try {
+          HttpResponse entity = httpClient.execute(httpGet);
+          int statusCode = entity.getStatusLine().getStatusCode();
+          if (statusCode != 200) {
+            throw new SolrException(SolrException.ErrorCode.NOT_FOUND, "no such blob or version available: " + key);
+          }
+          b = SimplePostTool.inputStreamToByteArray(entity.getEntity().getContent());
+        } catch (Exception e) {
+          if (e instanceof SolrException) {
+            throw (SolrException) e;
+          } else {
+            throw new SolrException(SolrException.ErrorCode.NOT_FOUND, "could not load : " + key, e);
+          }
+        } finally {
+          httpGet.releaseConnection();
+        }
+        blobs.put(key, aBlob = new BlobContent(key, b));
+      } else {
+        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Jar loading is not supported in non-cloud mode");
+        // todo
+      }
+
+    }
+
+    BlobContentRef ref = new BlobContentRef(aBlob);
+    synchronized (aBlob.references) {
+      aBlob.references.add(ref);
+    }
+    return ref;
+
+  }
+
+  private Replica getSystemCollReplica() {
+    ZkStateReader zkStateReader = this.coreContainer.getZkController().getZkStateReader();
+    ClusterState cs = zkStateReader.getClusterState();
+    DocCollection coll = cs.getCollectionOrNull(CollectionsHandler.SYSTEM_COLL);
+    if (coll == null) throw new SolrException(SERVICE_UNAVAILABLE, ".system collection not available");
+    ArrayList<Slice> slices = new ArrayList<>(coll.getActiveSlices());
+    if (slices.isEmpty()) throw new SolrException(SERVICE_UNAVAILABLE, "No active slices for .system collection");
+    Collections.shuffle(slices, RANDOM); //do load balancing
+
+    Replica replica = null;
+    for (Slice slice : slices) {
+      List<Replica> replicas = new ArrayList<>(slice.getReplicasMap().values());
+      Collections.shuffle(replicas, RANDOM);
+      for (Replica r : replicas) {
+        if (r.getState() == Replica.State.ACTIVE) {
+          if(zkStateReader.getClusterState().getLiveNodes().contains(r.get(ZkStateReader.NODE_NAME_PROP))){
+            replica = r;
+            break;
+          } else {
+            log.info("replica {} says it is active but not a member of live nodes", r.get(ZkStateReader.NODE_NAME_PROP));
+          }
+        }
+      }
+    }
+    if (replica == null) {
+      throw new SolrException(SERVICE_UNAVAILABLE, ".no active replica available for .system collection");
+    }
+    return replica;
+  }
+
+  /**
+   * This is to decrement a ref count
+   *
+   * @param ref The reference that is already there. Doing multiple calls with same ref will not matter
+   */
+  public void decrementBlobRefCount(BlobContentRef ref) {
+    if (ref == null) return;
+    synchronized (ref.blob.references) {
+      if (!ref.blob.references.remove(ref)) {
+        log.error("Multiple releases for the same reference");
+      }
+      if (ref.blob.references.isEmpty()) {
+        blobs.remove(ref.blob.key);
+      }
+    }
+
+  }
+
+  public static class BlobContent {
+    private final String key;
+    private Map<String, Object> decodedObjects = null;
+    // TODO move this off-heap
+    private final ByteBuffer buffer;
+    // ref counting mechanism
+    private final Set<BlobContentRef> references = new HashSet<>();
+
+
+    public BlobContent(String key, ByteBuffer buffer) {
+      this.key = key;
+      this.buffer = buffer;
+    }
+
+    /**
+     * This method decodes the byte[] to a custom Object
+     *
+     * @param key     The key is used to store the decoded Object. it is possible to have multiple
+     *                decoders for the same blob (may be unusual).
+     * @param decoder A decoder instance
+     * @return the decoded Object . If it was already decoded, then return from the cache
+     */
+    public <T> T decodeAndCache(String key, Decoder<T> decoder) {
+      if (decodedObjects == null) {
+        synchronized (this) {
+          if (decodedObjects == null) decodedObjects = new ConcurrentHashMap<>();
+        }
+      }
+
+      Object t = decodedObjects.get(key);
+      if (t != null) return (T) t;
+      t = decoder.decode(new ByteBufferInputStream(buffer));
+      decodedObjects.put(key, t);
+      return (T) t;
+
+    }
+
+    public String checkSignature(String base64Sig, CryptoKeys keys) {
+      return keys.verify(base64Sig, buffer);
+    }
+
+  }
+
+  public interface Decoder<T> {
+
+    T decode(InputStream inputStream);
+  }
+
+  public static class BlobContentRef {
+    public final BlobContent blob;
+
+    private BlobContentRef(BlobContent blob) {
+      this.blob = blob;
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/4d9d0c00/solr/core/src/java/org/apache/solr/core/CoreContainer.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
index 7703721..7a55e05 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
@@ -134,7 +134,7 @@ public class CoreContainer {
 
   private String hostName;
 
-  private final JarRepository jarRepository = new JarRepository(this);
+  private final BlobRepository blobRepository = new BlobRepository(this);
 
   private PluginBag<SolrRequestHandler> containerHandlers = new PluginBag<>(SolrRequestHandler.class, null);
 
@@ -1098,8 +1098,8 @@ public class CoreContainer {
     return core;
   }
 
-  public JarRepository getJarRepository(){
-    return jarRepository;
+  public BlobRepository getBlobRepository(){
+    return blobRepository;
   }
   
   /**

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/4d9d0c00/solr/core/src/java/org/apache/solr/core/JarRepository.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/JarRepository.java b/solr/core/src/java/org/apache/solr/core/JarRepository.java
deleted file mode 100644
index c760b59..0000000
--- a/solr/core/src/java/org/apache/solr/core/JarRepository.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.core;
-
-import static org.apache.solr.common.SolrException.ErrorCode.SERVICE_UNAVAILABLE;
-import static org.apache.solr.common.cloud.ZkStateReader.BASE_URL_PROP;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.cloud.ClusterState;
-import org.apache.solr.common.cloud.DocCollection;
-import org.apache.solr.common.cloud.Replica;
-import org.apache.solr.common.cloud.Slice;
-import org.apache.solr.common.cloud.ZkStateReader;
-import org.apache.solr.handler.admin.CollectionsHandler;
-import org.apache.solr.util.CryptoKeys;
-import org.apache.solr.util.SimplePostTool;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The purpose of this class is to store the Jars loaded in memory and to keep only one copy of the Jar in a single node.
- */
-public class JarRepository {
-  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-  static final Random RANDOM;
-
-  static {
-    // We try to make things reproducible in the context of our tests by initializing the random instance
-    // based on the current seed
-    String seed = System.getProperty("tests.seed");
-    if (seed == null) {
-      RANDOM = new Random();
-    } else {
-      RANDOM = new Random(seed.hashCode());
-    }
-  }
-
-  private final CoreContainer coreContainer;
-  private Map<String, JarContent> jars = new ConcurrentHashMap<>();
-
-  public JarRepository(CoreContainer coreContainer) {
-    this.coreContainer = coreContainer;
-  }
-
-  /**
-   * Returns the contents of a jar and increments a reference count. Please return the same object to decrease the refcount
-   *
-   * @param key it is a combination of blobname and version like blobName/version
-   * @return The reference of a jar
-   */
-  public JarContentRef getJarIncRef(String key) {
-    JarContent jar = jars.get(key);
-    if (jar == null) {
-      if (this.coreContainer.isZooKeeperAware()) {
-        Replica replica = getSystemCollReplica();
-        String url = replica.getStr(BASE_URL_PROP) + "/.system/blob/" + key + "?wt=filestream";
-
-        HttpClient httpClient = coreContainer.getUpdateShardHandler().getHttpClient();
-        HttpGet httpGet = new HttpGet(url);
-        ByteBuffer b;
-        try {
-          HttpResponse entity = httpClient.execute(httpGet);
-          int statusCode = entity.getStatusLine().getStatusCode();
-          if (statusCode != 200) {
-            throw new SolrException(SolrException.ErrorCode.NOT_FOUND, "no such blob or version available: " + key);
-          }
-          b = SimplePostTool.inputStreamToByteArray(entity.getEntity().getContent());
-        } catch (Exception e) {
-          if (e instanceof SolrException) {
-            throw (SolrException) e;
-          } else {
-            throw new SolrException(SolrException.ErrorCode.NOT_FOUND, "could not load : " + key, e);
-          }
-        } finally {
-          httpGet.releaseConnection();
-        }
-        jars.put(key, jar = new JarContent(key, b));
-      } else {
-        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Jar loading is not supported in non-cloud mode");
-        // todo
-      }
-
-    }
-
-    JarContentRef ref = new JarContentRef(jar);
-    synchronized (jar.references) {
-      jar.references.add(ref);
-    }
-    return ref;
-
-  }
-
-  private Replica getSystemCollReplica() {
-    ZkStateReader zkStateReader = this.coreContainer.getZkController().getZkStateReader();
-    ClusterState cs = zkStateReader.getClusterState();
-    DocCollection coll = cs.getCollectionOrNull(CollectionsHandler.SYSTEM_COLL);
-    if (coll == null) throw new SolrException(SERVICE_UNAVAILABLE, ".system collection not available");
-    ArrayList<Slice> slices = new ArrayList<>(coll.getActiveSlices());
-    if (slices.isEmpty()) throw new SolrException(SERVICE_UNAVAILABLE, "No active slices for .system collection");
-    Collections.shuffle(slices, RANDOM); //do load balancing
-
-    Replica replica = null;
-    for (Slice slice : slices) {
-      List<Replica> replicas = new ArrayList<>(slice.getReplicasMap().values());
-      Collections.shuffle(replicas, RANDOM);
-      for (Replica r : replicas) {
-        if (r.getState() == Replica.State.ACTIVE) {
-          if(zkStateReader.getClusterState().getLiveNodes().contains(r.get(ZkStateReader.NODE_NAME_PROP))){
-            replica = r;
-            break;
-          } else {
-            log.info("replica {} says it is active but not a member of live nodes", r.get(ZkStateReader.NODE_NAME_PROP));
-          }
-        }
-      }
-    }
-    if (replica == null) {
-      throw new SolrException(SERVICE_UNAVAILABLE, ".no active replica available for .system collection");
-    }
-    return replica;
-  }
-
-  /**
-   * This is to decrement a ref count
-   *
-   * @param ref The reference that is already there. Doing multiple calls with same ref will not matter
-   */
-  public void decrementJarRefCount(JarContentRef ref) {
-    if (ref == null) return;
-    synchronized (ref.jar.references) {
-      if (!ref.jar.references.remove(ref)) {
-        log.error("Multiple releases for the same reference");
-      }
-      if (ref.jar.references.isEmpty()) {
-        jars.remove(ref.jar.key);
-      }
-    }
-
-  }
-
-  public static class JarContent {
-    private final String key;
-    // TODO move this off-heap
-    private final ByteBuffer buffer;
-    // ref counting mechanism
-    private final Set<JarContentRef> references = new HashSet<>();
-
-    public JarContent(String key, ByteBuffer buffer) {
-      this.key = key;
-      this.buffer = buffer;
-    }
-
-    public ByteBuffer getFileContent(String entryName) throws IOException {
-      ByteArrayInputStream zipContents = new ByteArrayInputStream(buffer.array(), buffer.arrayOffset(), buffer.limit());
-      ZipInputStream zis = new ZipInputStream(zipContents);
-      try {
-        ZipEntry entry;
-        while ((entry = zis.getNextEntry()) != null) {
-          if (entryName == null || entryName.equals(entry.getName())) {
-            SimplePostTool.BAOS out = new SimplePostTool.BAOS();
-            byte[] buffer = new byte[2048];
-            int size;
-            while ((size = zis.read(buffer, 0, buffer.length)) != -1) {
-              out.write(buffer, 0, size);
-            }
-            out.close();
-            return out.getByteBuffer();
-          }
-        }
-      } finally {
-        zis.closeEntry();
-      }
-      return null;
-    }
-
-    public String checkSignature(String base64Sig, CryptoKeys keys) {
-      return keys.verify(base64Sig, buffer);
-    }
-
-  }
-
-  public static class JarContentRef {
-    public final JarContent jar;
-
-    private JarContentRef(JarContent jar) {
-      this.jar = jar;
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/4d9d0c00/solr/core/src/java/org/apache/solr/core/PluginBag.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/PluginBag.java b/solr/core/src/java/org/apache/solr/core/PluginBag.java
index 454633d..0defdad 100644
--- a/solr/core/src/java/org/apache/solr/core/PluginBag.java
+++ b/solr/core/src/java/org/apache/solr/core/PluginBag.java
@@ -386,7 +386,7 @@ public class PluginBag<T> implements AutoCloseable {
    */
   public static class RuntimeLib implements PluginInfoInitialized, AutoCloseable {
     private String name, version, sig;
-    private JarRepository.JarContentRef jarContent;
+    private BlobRepository.BlobContentRef jarContent;
     private final CoreContainer coreContainer;
     private boolean verified = false;
 
@@ -410,7 +410,7 @@ public class PluginBag<T> implements AutoCloseable {
       if (jarContent != null) return;
       synchronized (this) {
         if (jarContent != null) return;
-        jarContent = coreContainer.getJarRepository().getJarIncRef(name + "/" + version);
+        jarContent = coreContainer.getBlobRepository().getBlobIncRef(name + "/" + version);
       }
     }
 
@@ -430,13 +430,13 @@ public class PluginBag<T> implements AutoCloseable {
     public ByteBuffer getFileContent(String entryName) throws IOException {
       if (jarContent == null)
         throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "jar not available: " + name + "/" + version);
-      return jarContent.jar.getFileContent(entryName);
+      return BlobRepository.getFileContent(jarContent.blob, entryName);
 
     }
 
     @Override
     public void close() throws Exception {
-      if (jarContent != null) coreContainer.getJarRepository().decrementJarRefCount(jarContent);
+      if (jarContent != null) coreContainer.getBlobRepository().decrementBlobRefCount(jarContent);
     }
 
     public static List<RuntimeLib> getLibObjects(SolrCore core, List<PluginInfo> libs) {
@@ -472,7 +472,7 @@ public class PluginBag<T> implements AutoCloseable {
       }
 
       try {
-        String matchedKey = jarContent.jar.checkSignature(sig, new CryptoKeys(keys));
+        String matchedKey = jarContent.blob.checkSignature(sig, new CryptoKeys(keys));
         if (matchedKey == null)
           throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "No key matched signature for jar : " + name + " version: " + version);
         log.info("Jar {} signed with {} successfully verified", name, matchedKey);


[12/53] [abbrv] lucene-solr git commit: SOLR-8656: PeerSync should use same nUpdates everywhere.

Posted by no...@apache.org.
SOLR-8656: PeerSync should use same nUpdates everywhere.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/771f14cb
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/771f14cb
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/771f14cb

Branch: refs/heads/apiv2
Commit: 771f14cb6e476373e94169be05c1eadf816ca5b6
Parents: 8cd53a0
Author: markrmiller <ma...@apache.org>
Authored: Fri Feb 19 16:41:49 2016 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Fri Feb 19 16:41:49 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                         |  2 ++
 .../src/java/org/apache/solr/cloud/SyncStrategy.java     | 11 ++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/771f14cb/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 035a1f6..e090126 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -190,6 +190,8 @@ Bug Fixes
 
 * SOLR-8633: DistributedUpdateProcess processCommit/deleteByQuery call finish on DUP and 
   SolrCmdDistributor, which violates the lifecycle and can cause bugs. (hossman via Mark Miller)
+  
+* SOLR-8656: PeerSync should use same nUpdates everywhere. (Ramsey Haddad via Mark Miller)
 
 Optimizations
 ----------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/771f14cb/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java b/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java
index 28b81bd..cedcff9 100644
--- a/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java
+++ b/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java
@@ -141,7 +141,7 @@ public class SyncStrategy {
       if (success) {
         log.info("Sync Success - now sync replicas to me");
         
-        syncToMe(zkController, collection, shardId, leaderProps, core.getCoreDescriptor());
+        syncToMe(zkController, collection, shardId, leaderProps, core.getCoreDescriptor(), core.getUpdateHandler().getUpdateLog().getNumRecordsToKeep());
         
       } else {
         log.info("Leader's attempt to sync with shard failed, moving to the next candidate");
@@ -181,7 +181,8 @@ public class SyncStrategy {
   }
   
   private void syncToMe(ZkController zkController, String collection,
-      String shardId, ZkNodeProps leaderProps, CoreDescriptor cd) {
+                        String shardId, ZkNodeProps leaderProps, CoreDescriptor cd,
+                        int nUpdates) {
     
     // sync everyone else
     // TODO: we should do this in parallel at least
@@ -199,7 +200,7 @@ public class SyncStrategy {
       try {
         log.info(ZkCoreNodeProps.getCoreUrl(leaderProps) + ": try and ask " + node.getCoreUrl() + " to sync");
         
-        requestSync(node.getBaseUrl(), node.getCoreUrl(), zkLeader.getCoreUrl(), node.getCoreName());
+        requestSync(node.getBaseUrl(), node.getCoreUrl(), zkLeader.getCoreUrl(), node.getCoreName(), nUpdates);
         
       } catch (Exception e) {
         SolrException.log(log, "Error syncing replica to leader", e);
@@ -250,7 +251,7 @@ public class SyncStrategy {
     return success;
   }
 
-  private void requestSync(String baseUrl, String replica, String leaderUrl, String coreName) {
+  private void requestSync(String baseUrl, String replica, String leaderUrl, String coreName, int nUpdates) {
     ShardCoreRequest sreq = new ShardCoreRequest();
     sreq.coreName = coreName;
     sreq.baseUrl = baseUrl;
@@ -260,7 +261,7 @@ public class SyncStrategy {
     sreq.params = new ModifiableSolrParams();
     sreq.params.set("qt","/get");
     sreq.params.set("distrib",false);
-    sreq.params.set("getVersions",Integer.toString(100));
+    sreq.params.set("getVersions",Integer.toString(nUpdates));
     sreq.params.set("sync",leaderUrl);
     
     shardHandler.submit(sreq, replica, sreq.params);