You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2014/03/12 15:39:39 UTC
svn commit: r1576755 [9/27] - in /lucene/dev/trunk: lucene/
lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/
lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/
lucene/analysis/common/src/java/org/apache/lucene/an...
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestBasics.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestBasics.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestBasics.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestBasics.java Wed Mar 12 14:39:17 2014
@@ -499,7 +499,7 @@ public class TestBasics extends LuceneTe
snq = new SpanNearQuery(clauses, 0, true);
pay = new BytesRef(("pos: " + 0).getBytes("UTF-8"));
pay2 = new BytesRef(("pos: " + 1).getBytes("UTF-8"));
- list = new ArrayList<byte[]>();
+ list = new ArrayList<>();
list.add(pay.bytes);
list.add(pay2.bytes);
query = new SpanNearPayloadCheckQuery(snq, list);
@@ -513,7 +513,7 @@ public class TestBasics extends LuceneTe
pay = new BytesRef(("pos: " + 0).getBytes("UTF-8"));
pay2 = new BytesRef(("pos: " + 1).getBytes("UTF-8"));
BytesRef pay3 = new BytesRef(("pos: " + 2).getBytes("UTF-8"));
- list = new ArrayList<byte[]>();
+ list = new ArrayList<>();
list.add(pay.bytes);
list.add(pay2.bytes);
list.add(pay3.bytes);
@@ -540,7 +540,7 @@ public class TestBasics extends LuceneTe
query = new SpanPositionRangeQuery(oneThousHunThree, 0, 6);
checkHits(query, new int[]{1103, 1203,1303,1403,1503,1603,1703,1803,1903});
- Collection<byte[]> payloads = new ArrayList<byte[]>();
+ Collection<byte[]> payloads = new ArrayList<>();
BytesRef pay = new BytesRef(("pos: " + 0).getBytes("UTF-8"));
BytesRef pay2 = new BytesRef(("pos: " + 1).getBytes("UTF-8"));
BytesRef pay3 = new BytesRef(("pos: " + 3).getBytes("UTF-8"));
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java Wed Mar 12 14:39:17 2014
@@ -138,7 +138,7 @@ public class TestFieldMaskingSpanQuery e
QueryUtils.checkEqual(q, qr);
- Set<Term> terms = new HashSet<Term>();
+ Set<Term> terms = new HashSet<>();
qr.extractTerms(terms);
assertEquals(1, terms.size());
}
@@ -158,7 +158,7 @@ public class TestFieldMaskingSpanQuery e
QueryUtils.checkUnequal(q, qr);
- Set<Term> terms = new HashSet<Term>();
+ Set<Term> terms = new HashSet<>();
qr.extractTerms(terms);
assertEquals(2, terms.size());
}
@@ -172,7 +172,7 @@ public class TestFieldMaskingSpanQuery e
QueryUtils.checkEqual(q, qr);
- HashSet<Term> set = new HashSet<Term>();
+ HashSet<Term> set = new HashSet<>();
qr.extractTerms(set);
assertEquals(2, set.size());
}
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java Wed Mar 12 14:39:17 2014
@@ -270,7 +270,7 @@ public class TestPayloadSpans extends Lu
Spans spans = MultiSpansWrapper.wrap(is.getTopReaderContext(), snq);
TopDocs topDocs = is.search(snq, 1);
- Set<String> payloadSet = new HashSet<String>();
+ Set<String> payloadSet = new HashSet<>();
for (int i = 0; i < topDocs.scoreDocs.length; i++) {
while (spans.next()) {
Collection<byte[]> payloads = spans.getPayload();
@@ -306,7 +306,7 @@ public class TestPayloadSpans extends Lu
Spans spans = MultiSpansWrapper.wrap(is.getTopReaderContext(), snq);
TopDocs topDocs = is.search(snq, 1);
- Set<String> payloadSet = new HashSet<String>();
+ Set<String> payloadSet = new HashSet<>();
for (int i = 0; i < topDocs.scoreDocs.length; i++) {
while (spans.next()) {
Collection<byte[]> payloads = spans.getPayload();
@@ -341,7 +341,7 @@ public class TestPayloadSpans extends Lu
Spans spans = MultiSpansWrapper.wrap(is.getTopReaderContext(), snq);
TopDocs topDocs = is.search(snq, 1);
- Set<String> payloadSet = new HashSet<String>();
+ Set<String> payloadSet = new HashSet<>();
for (int i = 0; i < topDocs.scoreDocs.length; i++) {
while (spans.next()) {
Collection<byte[]> payloads = spans.getPayload();
@@ -479,8 +479,8 @@ public class TestPayloadSpans extends Lu
}
final class PayloadFilter extends TokenFilter {
- Set<String> entities = new HashSet<String>();
- Set<String> nopayload = new HashSet<String>();
+ Set<String> entities = new HashSet<>();
+ Set<String> nopayload = new HashSet<>();
int pos;
PayloadAttribute payloadAtt;
CharTermAttribute termAtt;
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanMultiTermQueryWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanMultiTermQueryWrapper.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanMultiTermQueryWrapper.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/spans/TestSpanMultiTermQueryWrapper.java Wed Mar 12 14:39:17 2014
@@ -67,7 +67,7 @@ public class TestSpanMultiTermQueryWrapp
public void testWildcard() throws Exception {
WildcardQuery wq = new WildcardQuery(new Term("field", "bro?n"));
- SpanQuery swq = new SpanMultiTermQueryWrapper<WildcardQuery>(wq);
+ SpanQuery swq = new SpanMultiTermQueryWrapper<>(wq);
// will only match quick brown fox
SpanFirstQuery sfq = new SpanFirstQuery(swq, 2);
assertEquals(1, searcher.search(sfq, 10).totalHits);
@@ -75,7 +75,7 @@ public class TestSpanMultiTermQueryWrapp
public void testPrefix() throws Exception {
WildcardQuery wq = new WildcardQuery(new Term("field", "extrem*"));
- SpanQuery swq = new SpanMultiTermQueryWrapper<WildcardQuery>(wq);
+ SpanQuery swq = new SpanMultiTermQueryWrapper<>(wq);
// will only match "jumps over extremely very lazy broxn dog"
SpanFirstQuery sfq = new SpanFirstQuery(swq, 3);
assertEquals(1, searcher.search(sfq, 10).totalHits);
@@ -83,7 +83,7 @@ public class TestSpanMultiTermQueryWrapp
public void testFuzzy() throws Exception {
FuzzyQuery fq = new FuzzyQuery(new Term("field", "broan"));
- SpanQuery sfq = new SpanMultiTermQueryWrapper<FuzzyQuery>(fq);
+ SpanQuery sfq = new SpanMultiTermQueryWrapper<>(fq);
// will not match quick brown fox
SpanPositionRangeQuery sprq = new SpanPositionRangeQuery(sfq, 3, 6);
assertEquals(2, searcher.search(sprq, 10).totalHits);
@@ -92,7 +92,7 @@ public class TestSpanMultiTermQueryWrapp
public void testFuzzy2() throws Exception {
// maximum of 1 term expansion
FuzzyQuery fq = new FuzzyQuery(new Term("field", "broan"), 1, 0, 1, false);
- SpanQuery sfq = new SpanMultiTermQueryWrapper<FuzzyQuery>(fq);
+ SpanQuery sfq = new SpanMultiTermQueryWrapper<>(fq);
// will only match jumps over lazy broun dog
SpanPositionRangeQuery sprq = new SpanPositionRangeQuery(sfq, 0, 100);
assertEquals(1, searcher.search(sprq, 10).totalHits);
@@ -100,7 +100,7 @@ public class TestSpanMultiTermQueryWrapp
public void testNoSuchMultiTermsInNear() throws Exception {
//test to make sure non existent multiterms aren't throwing null pointer exceptions
FuzzyQuery fuzzyNoSuch = new FuzzyQuery(new Term("field", "noSuch"), 1, 0, 1, false);
- SpanQuery spanNoSuch = new SpanMultiTermQueryWrapper<FuzzyQuery>(fuzzyNoSuch);
+ SpanQuery spanNoSuch = new SpanMultiTermQueryWrapper<>(fuzzyNoSuch);
SpanQuery term = new SpanTermQuery(new Term("field", "brown"));
SpanQuery near = new SpanNearQuery(new SpanQuery[]{term, spanNoSuch}, 1, true);
assertEquals(0, searcher.search(near, 10).totalHits);
@@ -109,17 +109,17 @@ public class TestSpanMultiTermQueryWrapp
assertEquals(0, searcher.search(near, 10).totalHits);
WildcardQuery wcNoSuch = new WildcardQuery(new Term("field", "noSuch*"));
- SpanQuery spanWCNoSuch = new SpanMultiTermQueryWrapper<WildcardQuery>(wcNoSuch);
+ SpanQuery spanWCNoSuch = new SpanMultiTermQueryWrapper<>(wcNoSuch);
near = new SpanNearQuery(new SpanQuery[]{term, spanWCNoSuch}, 1, true);
assertEquals(0, searcher.search(near, 10).totalHits);
RegexpQuery rgxNoSuch = new RegexpQuery(new Term("field", "noSuch"));
- SpanQuery spanRgxNoSuch = new SpanMultiTermQueryWrapper<RegexpQuery>(rgxNoSuch);
+ SpanQuery spanRgxNoSuch = new SpanMultiTermQueryWrapper<>(rgxNoSuch);
near = new SpanNearQuery(new SpanQuery[]{term, spanRgxNoSuch}, 1, true);
assertEquals(0, searcher.search(near, 10).totalHits);
PrefixQuery prfxNoSuch = new PrefixQuery(new Term("field", "noSuch"));
- SpanQuery spanPrfxNoSuch = new SpanMultiTermQueryWrapper<PrefixQuery>(prfxNoSuch);
+ SpanQuery spanPrfxNoSuch = new SpanMultiTermQueryWrapper<>(prfxNoSuch);
near = new SpanNearQuery(new SpanQuery[]{term, spanPrfxNoSuch}, 1, true);
assertEquals(0, searcher.search(near, 10).totalHits);
@@ -136,7 +136,7 @@ public class TestSpanMultiTermQueryWrapp
public void testNoSuchMultiTermsInNotNear() throws Exception {
//test to make sure non existent multiterms aren't throwing non-matching field exceptions
FuzzyQuery fuzzyNoSuch = new FuzzyQuery(new Term("field", "noSuch"), 1, 0, 1, false);
- SpanQuery spanNoSuch = new SpanMultiTermQueryWrapper<FuzzyQuery>(fuzzyNoSuch);
+ SpanQuery spanNoSuch = new SpanMultiTermQueryWrapper<>(fuzzyNoSuch);
SpanQuery term = new SpanTermQuery(new Term("field", "brown"));
SpanNotQuery notNear = new SpanNotQuery(term, spanNoSuch, 0,0);
assertEquals(1, searcher.search(notNear, 10).totalHits);
@@ -150,17 +150,17 @@ public class TestSpanMultiTermQueryWrapp
assertEquals(0, searcher.search(notNear, 10).totalHits);
WildcardQuery wcNoSuch = new WildcardQuery(new Term("field", "noSuch*"));
- SpanQuery spanWCNoSuch = new SpanMultiTermQueryWrapper<WildcardQuery>(wcNoSuch);
+ SpanQuery spanWCNoSuch = new SpanMultiTermQueryWrapper<>(wcNoSuch);
notNear = new SpanNotQuery(term, spanWCNoSuch, 0,0);
assertEquals(1, searcher.search(notNear, 10).totalHits);
RegexpQuery rgxNoSuch = new RegexpQuery(new Term("field", "noSuch"));
- SpanQuery spanRgxNoSuch = new SpanMultiTermQueryWrapper<RegexpQuery>(rgxNoSuch);
+ SpanQuery spanRgxNoSuch = new SpanMultiTermQueryWrapper<>(rgxNoSuch);
notNear = new SpanNotQuery(term, spanRgxNoSuch, 1, 1);
assertEquals(1, searcher.search(notNear, 10).totalHits);
PrefixQuery prfxNoSuch = new PrefixQuery(new Term("field", "noSuch"));
- SpanQuery spanPrfxNoSuch = new SpanMultiTermQueryWrapper<PrefixQuery>(prfxNoSuch);
+ SpanQuery spanPrfxNoSuch = new SpanMultiTermQueryWrapper<>(prfxNoSuch);
notNear = new SpanNotQuery(term, spanPrfxNoSuch, 1, 1);
assertEquals(1, searcher.search(notNear, 10).totalHits);
@@ -169,7 +169,7 @@ public class TestSpanMultiTermQueryWrapp
public void testNoSuchMultiTermsInOr() throws Exception {
//test to make sure non existent multiterms aren't throwing null pointer exceptions
FuzzyQuery fuzzyNoSuch = new FuzzyQuery(new Term("field", "noSuch"), 1, 0, 1, false);
- SpanQuery spanNoSuch = new SpanMultiTermQueryWrapper<FuzzyQuery>(fuzzyNoSuch);
+ SpanQuery spanNoSuch = new SpanMultiTermQueryWrapper<>(fuzzyNoSuch);
SpanQuery term = new SpanTermQuery(new Term("field", "brown"));
SpanOrQuery near = new SpanOrQuery(new SpanQuery[]{term, spanNoSuch});
assertEquals(1, searcher.search(near, 10).totalHits);
@@ -180,17 +180,17 @@ public class TestSpanMultiTermQueryWrapp
WildcardQuery wcNoSuch = new WildcardQuery(new Term("field", "noSuch*"));
- SpanQuery spanWCNoSuch = new SpanMultiTermQueryWrapper<WildcardQuery>(wcNoSuch);
+ SpanQuery spanWCNoSuch = new SpanMultiTermQueryWrapper<>(wcNoSuch);
near = new SpanOrQuery(new SpanQuery[]{term, spanWCNoSuch});
assertEquals(1, searcher.search(near, 10).totalHits);
RegexpQuery rgxNoSuch = new RegexpQuery(new Term("field", "noSuch"));
- SpanQuery spanRgxNoSuch = new SpanMultiTermQueryWrapper<RegexpQuery>(rgxNoSuch);
+ SpanQuery spanRgxNoSuch = new SpanMultiTermQueryWrapper<>(rgxNoSuch);
near = new SpanOrQuery(new SpanQuery[]{term, spanRgxNoSuch});
assertEquals(1, searcher.search(near, 10).totalHits);
PrefixQuery prfxNoSuch = new PrefixQuery(new Term("field", "noSuch"));
- SpanQuery spanPrfxNoSuch = new SpanMultiTermQueryWrapper<PrefixQuery>(prfxNoSuch);
+ SpanQuery spanPrfxNoSuch = new SpanMultiTermQueryWrapper<>(prfxNoSuch);
near = new SpanOrQuery(new SpanQuery[]{term, spanPrfxNoSuch});
assertEquals(1, searcher.search(near, 10).totalHits);
@@ -206,23 +206,23 @@ public class TestSpanMultiTermQueryWrapp
public void testNoSuchMultiTermsInSpanFirst() throws Exception {
//this hasn't been a problem
FuzzyQuery fuzzyNoSuch = new FuzzyQuery(new Term("field", "noSuch"), 1, 0, 1, false);
- SpanQuery spanNoSuch = new SpanMultiTermQueryWrapper<FuzzyQuery>(fuzzyNoSuch);
+ SpanQuery spanNoSuch = new SpanMultiTermQueryWrapper<>(fuzzyNoSuch);
SpanQuery spanFirst = new SpanFirstQuery(spanNoSuch, 10);
assertEquals(0, searcher.search(spanFirst, 10).totalHits);
WildcardQuery wcNoSuch = new WildcardQuery(new Term("field", "noSuch*"));
- SpanQuery spanWCNoSuch = new SpanMultiTermQueryWrapper<WildcardQuery>(wcNoSuch);
+ SpanQuery spanWCNoSuch = new SpanMultiTermQueryWrapper<>(wcNoSuch);
spanFirst = new SpanFirstQuery(spanWCNoSuch, 10);
assertEquals(0, searcher.search(spanFirst, 10).totalHits);
RegexpQuery rgxNoSuch = new RegexpQuery(new Term("field", "noSuch"));
- SpanQuery spanRgxNoSuch = new SpanMultiTermQueryWrapper<RegexpQuery>(rgxNoSuch);
+ SpanQuery spanRgxNoSuch = new SpanMultiTermQueryWrapper<>(rgxNoSuch);
spanFirst = new SpanFirstQuery(spanRgxNoSuch, 10);
assertEquals(0, searcher.search(spanFirst, 10).totalHits);
PrefixQuery prfxNoSuch = new PrefixQuery(new Term("field", "noSuch"));
- SpanQuery spanPrfxNoSuch = new SpanMultiTermQueryWrapper<PrefixQuery>(prfxNoSuch);
+ SpanQuery spanPrfxNoSuch = new SpanMultiTermQueryWrapper<>(prfxNoSuch);
spanFirst = new SpanFirstQuery(spanPrfxNoSuch, 10);
assertEquals(0, searcher.search(spanFirst, 10).totalHits);
}
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java Wed Mar 12 14:39:17 2014
@@ -281,7 +281,7 @@ public class TestBufferedIndexInput exte
private static class MockFSDirectory extends BaseDirectory {
- List<IndexInput> allIndexInputs = new ArrayList<IndexInput>();
+ List<IndexInput> allIndexInputs = new ArrayList<>();
Random rand;
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java Wed Mar 12 14:39:17 2014
@@ -40,7 +40,7 @@ public class TestFileSwitchDirectory ext
* Test if writing doc stores to disk and everything else to ram works.
*/
public void testBasic() throws IOException {
- Set<String> fileExtensions = new HashSet<String>();
+ Set<String> fileExtensions = new HashSet<>();
fileExtensions.add(Lucene40StoredFieldsWriter.FIELDS_EXTENSION);
fileExtensions.add(Lucene40StoredFieldsWriter.FIELDS_INDEX_EXTENSION);
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestFilterDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestFilterDirectory.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestFilterDirectory.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestFilterDirectory.java Wed Mar 12 14:39:17 2014
@@ -30,7 +30,7 @@ public class TestFilterDirectory extends
public void testOverrides() throws Exception {
// verify that all methods of Directory are overridden by FilterDirectory,
// except those under the 'exclude' list
- Set<String> exclude = new HashSet<String>();
+ Set<String> exclude = new HashSet<>();
exclude.add("copy");
exclude.add("createSlicer");
for (Method m : FilterDirectory.class.getMethods()) {
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestHugeRamFile.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestHugeRamFile.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestHugeRamFile.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestHugeRamFile.java Wed Mar 12 14:39:17 2014
@@ -31,7 +31,7 @@ public class TestHugeRamFile extends Luc
* buffers under maxint. */
private static class DenseRAMFile extends RAMFile {
private long capacity = 0;
- private HashMap<Integer,byte[]> singleBuffers = new HashMap<Integer,byte[]>();
+ private HashMap<Integer,byte[]> singleBuffers = new HashMap<>();
@Override
protected byte[] newBuffer(int size) {
capacity += size;
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestNRTCachingDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestNRTCachingDirectory.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestNRTCachingDirectory.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/store/TestNRTCachingDirectory.java Wed Mar 12 14:39:17 2014
@@ -55,7 +55,7 @@ public class TestNRTCachingDirectory ext
System.out.println("TEST: numDocs=" + numDocs);
}
- final List<BytesRef> ids = new ArrayList<BytesRef>();
+ final List<BytesRef> ids = new ArrayList<>();
DirectoryReader r = null;
for(int docCount=0;docCount<numDocs;docCount++) {
final Document doc = docs.nextDoc();
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java Wed Mar 12 14:39:17 2014
@@ -149,11 +149,11 @@ public class StressRamUsageEstimator ext
*/
private void causeGc() {
List<GarbageCollectorMXBean> garbageCollectorMXBeans = ManagementFactory.getGarbageCollectorMXBeans();
- List<Long> ccounts = new ArrayList<Long>();
+ List<Long> ccounts = new ArrayList<>();
for (GarbageCollectorMXBean g : garbageCollectorMXBeans) {
ccounts.add(g.getCollectionCount());
}
- List<Long> ccounts2 = new ArrayList<Long>();
+ List<Long> ccounts2 = new ArrayList<>();
do {
System.gc();
ccounts.clear();
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java Wed Mar 12 14:39:17 2014
@@ -29,7 +29,7 @@ public class TestByteBlockPool extends L
boolean reuseFirst = random().nextBoolean();
for (int j = 0; j < 2; j++) {
- List<BytesRef> list = new ArrayList<BytesRef>();
+ List<BytesRef> list = new ArrayList<>();
int maxLength = atLeast(500);
final int numValues = atLeast(100);
BytesRef ref = new BytesRef();
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestBytesRefArray.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestBytesRefArray.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestBytesRefArray.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestBytesRefArray.java Wed Mar 12 14:39:17 2014
@@ -31,7 +31,7 @@ public class TestBytesRefArray extends L
public void testAppend() throws IOException {
Random random = random();
BytesRefArray list = new BytesRefArray(Counter.newCounter());
- List<String> stringList = new ArrayList<String>();
+ List<String> stringList = new ArrayList<>();
for (int j = 0; j < 2; j++) {
if (j > 0 && random.nextBoolean()) {
list.clear();
@@ -73,7 +73,7 @@ public class TestBytesRefArray extends L
public void testSort() throws IOException {
Random random = random();
BytesRefArray list = new BytesRefArray(Counter.newCounter());
- List<String> stringList = new ArrayList<String>();
+ List<String> stringList = new ArrayList<>();
for (int j = 0; j < 2; j++) {
if (j > 0 && random.nextBoolean()) {
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java Wed Mar 12 14:39:17 2014
@@ -95,7 +95,7 @@ public class TestBytesRefHash extends Lu
BytesRef scratch = new BytesRef();
int num = atLeast(2);
for (int j = 0; j < num; j++) {
- Map<String, Integer> strings = new HashMap<String, Integer>();
+ Map<String, Integer> strings = new HashMap<>();
int uniqueCount = 0;
for (int i = 0; i < 797; i++) {
String str;
@@ -175,7 +175,7 @@ public class TestBytesRefHash extends Lu
BytesRef ref = new BytesRef();
int num = atLeast(2);
for (int j = 0; j < num; j++) {
- SortedSet<String> strings = new TreeSet<String>();
+ SortedSet<String> strings = new TreeSet<>();
for (int i = 0; i < 797; i++) {
String str;
do {
@@ -213,7 +213,7 @@ public class TestBytesRefHash extends Lu
BytesRef scratch = new BytesRef();
int num = atLeast(2);
for (int j = 0; j < num; j++) {
- Set<String> strings = new HashSet<String>();
+ Set<String> strings = new HashSet<>();
int uniqueCount = 0;
for (int i = 0; i < 797; i++) {
String str;
@@ -250,7 +250,7 @@ public class TestBytesRefHash extends Lu
BytesRef scratch = new BytesRef();
int num = atLeast(2);
for (int j = 0; j < num; j++) {
- Set<String> strings = new HashSet<String>();
+ Set<String> strings = new HashSet<>();
int uniqueCount = 0;
for (int i = 0; i < 797; i++) {
String str;
@@ -313,7 +313,7 @@ public class TestBytesRefHash extends Lu
BytesRefHash offsetHash = newHash(pool);
int num = atLeast(2);
for (int j = 0; j < num; j++) {
- Set<String> strings = new HashSet<String>();
+ Set<String> strings = new HashSet<>();
int uniqueCount = 0;
for (int i = 0; i < 797; i++) {
String str;
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestCloseableThreadLocal.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestCloseableThreadLocal.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestCloseableThreadLocal.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestCloseableThreadLocal.java Wed Mar 12 14:39:17 2014
@@ -29,7 +29,7 @@ public class TestCloseableThreadLocal ex
public void testNullValue() throws Exception {
// Tests that null can be set as a valid value (LUCENE-1805). This
// previously failed in get().
- CloseableThreadLocal<Object> ctl = new CloseableThreadLocal<Object>();
+ CloseableThreadLocal<Object> ctl = new CloseableThreadLocal<>();
ctl.set(null);
assertNull(ctl.get());
}
@@ -37,7 +37,7 @@ public class TestCloseableThreadLocal ex
public void testDefaultValueWithoutSetting() throws Exception {
// LUCENE-1805: make sure default get returns null,
// twice in a row
- CloseableThreadLocal<Object> ctl = new CloseableThreadLocal<Object>();
+ CloseableThreadLocal<Object> ctl = new CloseableThreadLocal<>();
assertNull(ctl.get());
}
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestCollectionUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestCollectionUtil.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestCollectionUtil.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestCollectionUtil.java Wed Mar 12 14:39:17 2014
@@ -37,13 +37,13 @@ public class TestCollectionUtil extends
public void testIntroSort() {
for (int i = 0, c = atLeast(500); i < c; i++) {
- List<Integer> list1 = createRandomList(2000), list2 = new ArrayList<Integer>(list1);
+ List<Integer> list1 = createRandomList(2000), list2 = new ArrayList<>(list1);
CollectionUtil.introSort(list1);
Collections.sort(list2);
assertEquals(list2, list1);
list1 = createRandomList(2000);
- list2 = new ArrayList<Integer>(list1);
+ list2 = new ArrayList<>(list1);
CollectionUtil.introSort(list1, Collections.reverseOrder());
Collections.sort(list2, Collections.reverseOrder());
assertEquals(list2, list1);
@@ -56,13 +56,13 @@ public class TestCollectionUtil extends
public void testTimSort() {
for (int i = 0, c = atLeast(500); i < c; i++) {
- List<Integer> list1 = createRandomList(2000), list2 = new ArrayList<Integer>(list1);
+ List<Integer> list1 = createRandomList(2000), list2 = new ArrayList<>(list1);
CollectionUtil.timSort(list1);
Collections.sort(list2);
assertEquals(list2, list1);
list1 = createRandomList(2000);
- list2 = new ArrayList<Integer>(list1);
+ list2 = new ArrayList<>(list1);
CollectionUtil.timSort(list1, Collections.reverseOrder());
Collections.sort(list2, Collections.reverseOrder());
assertEquals(list2, list1);
@@ -82,7 +82,7 @@ public class TestCollectionUtil extends
CollectionUtil.timSort(list, Collections.reverseOrder());
// check that empty non-random access lists pass sorting without ex (as sorting is not needed)
- list = new LinkedList<Integer>();
+ list = new LinkedList<>();
CollectionUtil.introSort(list);
CollectionUtil.timSort(list);
CollectionUtil.introSort(list, Collections.reverseOrder());
@@ -91,7 +91,7 @@ public class TestCollectionUtil extends
public void testOneElementListSort() {
// check that one-element non-random access lists pass sorting without ex (as sorting is not needed)
- List<Integer> list = new LinkedList<Integer>();
+ List<Integer> list = new LinkedList<>();
list.add(1);
CollectionUtil.introSort(list);
CollectionUtil.timSort(list);
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestDoubleBarrelLRUCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestDoubleBarrelLRUCache.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestDoubleBarrelLRUCache.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestDoubleBarrelLRUCache.java Wed Mar 12 14:39:17 2014
@@ -118,7 +118,7 @@ public class TestDoubleBarrelLRUCache ex
final int CACHE_SIZE = 512;
final int OBJ_COUNT = 3*CACHE_SIZE;
- DoubleBarrelLRUCache<CloneableObject,Object> c = new DoubleBarrelLRUCache<CloneableObject,Object>(1024);
+ DoubleBarrelLRUCache<CloneableObject,Object> c = new DoubleBarrelLRUCache<>(1024);
CloneableObject[] objs = new CloneableObject[OBJ_COUNT];
for(int i=0;i<OBJ_COUNT;i++) {
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java Wed Mar 12 14:39:17 2014
@@ -25,7 +25,7 @@ import java.util.NoSuchElementException;
public class TestFilterIterator extends LuceneTestCase {
- private static final Set<String> set = new TreeSet<String>(Arrays.asList("a", "b", "c"));
+ private static final Set<String> set = new TreeSet<>(Arrays.asList("a", "b", "c"));
private static void assertNoMore(Iterator<?> it) {
assertFalse(it.hasNext());
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestIdentityHashSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestIdentityHashSet.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestIdentityHashSet.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestIdentityHashSet.java Wed Mar 12 14:39:17 2014
@@ -28,7 +28,7 @@ public class TestIdentityHashSet extends
Random rnd = random();
Set<Object> jdk = Collections.newSetFromMap(
new IdentityHashMap<Object,Boolean>());
- RamUsageEstimator.IdentityHashSet<Object> us = new RamUsageEstimator.IdentityHashSet<Object>();
+ RamUsageEstimator.IdentityHashSet<Object> us = new RamUsageEstimator.IdentityHashSet<>();
int max = 100000;
int threshold = 256;
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestInPlaceMergeSorter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestInPlaceMergeSorter.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestInPlaceMergeSorter.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestInPlaceMergeSorter.java Wed Mar 12 14:39:17 2014
@@ -30,7 +30,7 @@ public class TestInPlaceMergeSorter exte
@Override
public Sorter newSorter(Entry[] arr) {
- return new ArrayInPlaceMergeSorter<Entry>(arr, ArrayUtil.<Entry>naturalComparator());
+ return new ArrayInPlaceMergeSorter<>(arr, ArrayUtil.<Entry>naturalComparator());
}
}
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestIntroSorter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestIntroSorter.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestIntroSorter.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestIntroSorter.java Wed Mar 12 14:39:17 2014
@@ -26,7 +26,7 @@ public class TestIntroSorter extends Bas
@Override
public Sorter newSorter(Entry[] arr) {
- return new ArrayIntroSorter<Entry>(arr, ArrayUtil.<Entry>naturalComparator());
+ return new ArrayIntroSorter<>(arr, ArrayUtil.<Entry>naturalComparator());
}
}
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestMergedIterator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestMergedIterator.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestMergedIterator.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestMergedIterator.java Wed Mar 12 14:39:17 2014
@@ -30,17 +30,17 @@ public class TestMergedIterator extends
@SuppressWarnings({"rawtypes", "unchecked"})
public void testMergeEmpty() {
- Iterator<Integer> merged = new MergedIterator<Integer>();
+ Iterator<Integer> merged = new MergedIterator<>();
assertFalse(merged.hasNext());
- merged = new MergedIterator<Integer>(new ArrayList<Integer>().iterator());
+ merged = new MergedIterator<>(new ArrayList<Integer>().iterator());
assertFalse(merged.hasNext());
Iterator<Integer>[] itrs = new Iterator[random().nextInt(100)];
for (int i = 0; i < itrs.length; i++) {
itrs[i] = new ArrayList<Integer>().iterator();
}
- merged = new MergedIterator<Integer>( itrs );
+ merged = new MergedIterator<>( itrs );
assertFalse(merged.hasNext());
}
@@ -106,13 +106,13 @@ public class TestMergedIterator extends
private void testCase(int itrsWithVal, int specifiedValsOnItr, boolean removeDups) {
// Build a random number of lists
- List<Integer> expected = new ArrayList<Integer>();
+ List<Integer> expected = new ArrayList<>();
Random random = new Random(random().nextLong());
int numLists = itrsWithVal + random.nextInt(1000 - itrsWithVal);
@SuppressWarnings({"rawtypes", "unchecked"})
List<Integer>[] lists = new List[numLists];
for (int i = 0; i < numLists; i++) {
- lists[i] = new ArrayList<Integer>();
+ lists[i] = new ArrayList<>();
}
int start = random.nextInt(1000000);
int end = start + VALS_TO_MERGE / itrsWithVal / Math.abs(specifiedValsOnItr);
@@ -143,7 +143,7 @@ public class TestMergedIterator extends
itrs[i] = lists[i].iterator();
}
- MergedIterator<Integer> mergedItr = new MergedIterator<Integer>(removeDups, itrs);
+ MergedIterator<Integer> mergedItr = new MergedIterator<>(removeDups, itrs);
Iterator<Integer> expectedItr = expected.iterator();
while (expectedItr.hasNext()) {
assertTrue(mergedItr.hasNext());
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java Wed Mar 12 14:39:17 2014
@@ -86,7 +86,7 @@ public class TestOfflineSorter extends L
}
private byte[][] generateRandom(int howMuchData) {
- ArrayList<byte[]> data = new ArrayList<byte[]>();
+ ArrayList<byte[]> data = new ArrayList<>();
while (howMuchData > 0) {
byte [] current = new byte [random().nextInt(256)];
random().nextBytes(current);
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestRecyclingByteBlockAllocator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestRecyclingByteBlockAllocator.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestRecyclingByteBlockAllocator.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestRecyclingByteBlockAllocator.java Wed Mar 12 14:39:17 2014
@@ -45,7 +45,7 @@ public class TestRecyclingByteBlockAlloc
@Test
public void testAllocate() {
RecyclingByteBlockAllocator allocator = newAllocator();
- HashSet<byte[]> set = new HashSet<byte[]>();
+ HashSet<byte[]> set = new HashSet<>();
byte[] block = allocator.getByteBlock();
set.add(block);
assertNotNull(block);
@@ -65,7 +65,7 @@ public class TestRecyclingByteBlockAlloc
@Test
public void testAllocateAndRecycle() {
RecyclingByteBlockAllocator allocator = newAllocator();
- HashSet<byte[]> allocated = new HashSet<byte[]>();
+ HashSet<byte[]> allocated = new HashSet<>();
byte[] block = allocator.getByteBlock();
allocated.add(block);
@@ -86,7 +86,7 @@ public class TestRecyclingByteBlockAlloc
byte[][] array = allocated.toArray(new byte[0][]);
int begin = random().nextInt(array.length);
int end = begin + random().nextInt(array.length - begin);
- List<byte[]> selected = new ArrayList<byte[]>();
+ List<byte[]> selected = new ArrayList<>();
for (int j = begin; j < end; j++) {
selected.add(array[j]);
}
@@ -102,7 +102,7 @@ public class TestRecyclingByteBlockAlloc
@Test
public void testAllocateAndFree() {
RecyclingByteBlockAllocator allocator = newAllocator();
- HashSet<byte[]> allocated = new HashSet<byte[]>();
+ HashSet<byte[]> allocated = new HashSet<>();
int freeButAllocated = 0;
byte[] block = allocator.getByteBlock();
allocated.add(block);
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestRecyclingIntBlockAllocator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestRecyclingIntBlockAllocator.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestRecyclingIntBlockAllocator.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestRecyclingIntBlockAllocator.java Wed Mar 12 14:39:17 2014
@@ -45,7 +45,7 @@ public class TestRecyclingIntBlockAlloca
@Test
public void testAllocate() {
RecyclingIntBlockAllocator allocator = newAllocator();
- HashSet<int[]> set = new HashSet<int[]>();
+ HashSet<int[]> set = new HashSet<>();
int[] block = allocator.getIntBlock();
set.add(block);
assertNotNull(block);
@@ -65,7 +65,7 @@ public class TestRecyclingIntBlockAlloca
@Test
public void testAllocateAndRecycle() {
RecyclingIntBlockAllocator allocator = newAllocator();
- HashSet<int[]> allocated = new HashSet<int[]>();
+ HashSet<int[]> allocated = new HashSet<>();
int[] block = allocator.getIntBlock();
allocated.add(block);
@@ -86,7 +86,7 @@ public class TestRecyclingIntBlockAlloca
int[][] array = allocated.toArray(new int[0][]);
int begin = random().nextInt(array.length);
int end = begin + random().nextInt(array.length - begin);
- List<int[]> selected = new ArrayList<int[]>();
+ List<int[]> selected = new ArrayList<>();
for (int j = begin; j < end; j++) {
selected.add(array[j]);
}
@@ -102,7 +102,7 @@ public class TestRecyclingIntBlockAlloca
@Test
public void testAllocateAndFree() {
RecyclingIntBlockAllocator allocator = newAllocator();
- HashSet<int[]> allocated = new HashSet<int[]>();
+ HashSet<int[]> allocated = new HashSet<>();
int freeButAllocated = 0;
int[] block = allocator.getIntBlock();
allocated.add(block);
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestSentinelIntSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestSentinelIntSet.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestSentinelIntSet.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestSentinelIntSet.java Wed Mar 12 14:39:17 2014
@@ -56,7 +56,7 @@ public class TestSentinelIntSet extends
int num = random().nextInt(30);
int maxVal = (random().nextBoolean() ? random().nextInt(50) : random().nextInt(Integer.MAX_VALUE)) + 1;
- HashSet<Integer> a = new HashSet<Integer>(initSz);
+ HashSet<Integer> a = new HashSet<>(initSz);
SentinelIntSet b = new SentinelIntSet(initSz, -1);
for (int j=0; j<num; j++) {
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestSetOnce.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestSetOnce.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestSetOnce.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestSetOnce.java Wed Mar 12 14:39:17 2014
@@ -51,20 +51,20 @@ public class TestSetOnce extends LuceneT
@Test
public void testEmptyCtor() throws Exception {
- SetOnce<Integer> set = new SetOnce<Integer>();
+ SetOnce<Integer> set = new SetOnce<>();
assertNull(set.get());
}
@Test(expected=AlreadySetException.class)
public void testSettingCtor() throws Exception {
- SetOnce<Integer> set = new SetOnce<Integer>(new Integer(5));
+ SetOnce<Integer> set = new SetOnce<>(new Integer(5));
assertEquals(5, set.get().intValue());
set.set(new Integer(7));
}
@Test(expected=AlreadySetException.class)
public void testSetOnce() throws Exception {
- SetOnce<Integer> set = new SetOnce<Integer>();
+ SetOnce<Integer> set = new SetOnce<>();
set.set(new Integer(5));
assertEquals(5, set.get().intValue());
set.set(new Integer(7));
@@ -72,7 +72,7 @@ public class TestSetOnce extends LuceneT
@Test
public void testSetMultiThreaded() throws Exception {
- final SetOnce<Integer> set = new SetOnce<Integer>();
+ final SetOnce<Integer> set = new SetOnce<>();
SetOnceThread[] threads = new SetOnceThread[10];
for (int i = 0; i < threads.length; i++) {
threads[i] = new SetOnceThread(random());
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestTimSorter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestTimSorter.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestTimSorter.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestTimSorter.java Wed Mar 12 14:39:17 2014
@@ -25,7 +25,7 @@ public class TestTimSorter extends BaseS
@Override
public Sorter newSorter(Entry[] arr) {
- return new ArrayTimSorter<Entry>(arr, ArrayUtil.<Entry>naturalComparator(), TestUtil.nextInt(random(), 0, arr.length));
+ return new ArrayTimSorter<>(arr, ArrayUtil.<Entry>naturalComparator(), TestUtil.nextInt(random(), 0, arr.length));
}
}
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java Wed Mar 12 14:39:17 2014
@@ -20,9 +20,9 @@ package org.apache.lucene.util;
public class TestVirtualMethod extends LuceneTestCase {
private static final VirtualMethod<TestVirtualMethod> publicTestMethod =
- new VirtualMethod<TestVirtualMethod>(TestVirtualMethod.class, "publicTest", String.class);
+ new VirtualMethod<>(TestVirtualMethod.class, "publicTest", String.class);
private static final VirtualMethod<TestVirtualMethod> protectedTestMethod =
- new VirtualMethod<TestVirtualMethod>(TestVirtualMethod.class, "protectedTest", int.class);
+ new VirtualMethod<>(TestVirtualMethod.class, "protectedTest", int.class);
public void publicTest(String test) {}
protected void protectedTest(int test) {}
@@ -80,14 +80,14 @@ public class TestVirtualMethod extends L
}
try {
- new VirtualMethod<TestVirtualMethod>(TestVirtualMethod.class, "bogus");
+ new VirtualMethod<>(TestVirtualMethod.class, "bogus");
fail("Method bogus() does not exist, so IAE should be thrown");
} catch (IllegalArgumentException arg) {
// pass
}
try {
- new VirtualMethod<TestClass2>(TestClass2.class, "publicTest", String.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
@@ -95,7 +95,7 @@ public class TestVirtualMethod extends L
try {
// try to create a second instance of the same baseClass / method combination
- new VirtualMethod<TestVirtualMethod>(TestVirtualMethod.class, "publicTest", String.class);
+ new VirtualMethod<>(TestVirtualMethod.class, "publicTest", String.class);
fail("Violating singleton status succeeded");
} catch (UnsupportedOperationException arg) {
// pass
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestWAH8DocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestWAH8DocIdSet.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestWAH8DocIdSet.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestWAH8DocIdSet.java Wed Mar 12 14:39:17 2014
@@ -44,11 +44,11 @@ public class TestWAH8DocIdSet extends Ba
public void testUnion() throws IOException {
final int numBits = TestUtil.nextInt(random(), 100, 1 << 20);
final int numDocIdSets = TestUtil.nextInt(random(), 0, 4);
- final List<BitSet> fixedSets = new ArrayList<BitSet>(numDocIdSets);
+ final List<BitSet> fixedSets = new ArrayList<>(numDocIdSets);
for (int i = 0; i < numDocIdSets; ++i) {
fixedSets.add(randomSet(numBits, random().nextFloat() / 16));
}
- final List<WAH8DocIdSet> compressedSets = new ArrayList<WAH8DocIdSet>(numDocIdSets);
+ final List<WAH8DocIdSet> compressedSets = new ArrayList<>(numDocIdSets);
for (BitSet set : fixedSets) {
compressedSets.add(copyOf(set, numBits));
}
@@ -66,11 +66,11 @@ public class TestWAH8DocIdSet extends Ba
public void testIntersection() throws IOException {
final int numBits = TestUtil.nextInt(random(), 100, 1 << 20);
final int numDocIdSets = TestUtil.nextInt(random(), 1, 4);
- final List<BitSet> fixedSets = new ArrayList<BitSet>(numDocIdSets);
+ final List<BitSet> fixedSets = new ArrayList<>(numDocIdSets);
for (int i = 0; i < numDocIdSets; ++i) {
fixedSets.add(randomSet(numBits, random().nextFloat()));
}
- final List<WAH8DocIdSet> compressedSets = new ArrayList<WAH8DocIdSet>(numDocIdSets);
+ final List<WAH8DocIdSet> compressedSets = new ArrayList<>(numDocIdSets);
for (BitSet set : fixedSets) {
compressedSets.add(copyOf(set, numBits));
}
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java Wed Mar 12 14:39:17 2014
@@ -167,7 +167,7 @@ public class TestWeakIdentityMap extends
WeakIdentityMap.newConcurrentHashMap(random().nextBoolean());
// we keep strong references to the keys,
// so WeakIdentityMap will not forget about them:
- final AtomicReferenceArray<Object> keys = new AtomicReferenceArray<Object>(keyCount);
+ final AtomicReferenceArray<Object> keys = new AtomicReferenceArray<>(keyCount);
for (int j = 0; j < keyCount; j++) {
keys.set(j, new Object());
}
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestBasicOperations.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestBasicOperations.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestBasicOperations.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestBasicOperations.java Wed Mar 12 14:39:17 2014
@@ -26,7 +26,7 @@ import com.carrotsearch.randomizedtestin
public class TestBasicOperations extends LuceneTestCase {
/** Test string union. */
public void testStringUnion() {
- List<BytesRef> strings = new ArrayList<BytesRef>();
+ List<BytesRef> strings = new ArrayList<>();
for (int i = RandomInts.randomIntBetween(random(), 0, 1000); --i >= 0;) {
strings.add(new BytesRef(TestUtil.randomUnicodeString(random())));
}
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestCompiledAutomaton.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestCompiledAutomaton.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestCompiledAutomaton.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestCompiledAutomaton.java Wed Mar 12 14:39:17 2014
@@ -31,7 +31,7 @@ import org.apache.lucene.util.TestUtil;
public class TestCompiledAutomaton extends LuceneTestCase {
private CompiledAutomaton build(String... strings) {
- final List<BytesRef> terms = new ArrayList<BytesRef>();
+ final List<BytesRef> terms = new ArrayList<>();
for(String s : strings) {
terms.add(new BytesRef(s));
}
@@ -95,7 +95,7 @@ public class TestCompiledAutomaton exten
public void testRandom() throws Exception {
final int numTerms = atLeast(400);
- final Set<String> terms = new HashSet<String>();
+ final Set<String> terms = new HashSet<>();
while(terms.size() != numTerms) {
terms.add(randomString());
}
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminizeLexicon.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminizeLexicon.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminizeLexicon.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminizeLexicon.java Wed Mar 12 14:39:17 2014
@@ -29,8 +29,8 @@ import org.apache.lucene.util.TestUtil;
* somewhat randomly, by determinizing a huge random lexicon.
*/
public class TestDeterminizeLexicon extends LuceneTestCase {
- private List<Automaton> automata = new ArrayList<Automaton>();
- private List<String> terms = new ArrayList<String>();
+ private List<Automaton> automata = new ArrayList<>();
+ private List<String> terms = new ArrayList<>();
public void testLexicon() throws Exception {
int num = atLeast(1);
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestLevenshteinAutomata.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestLevenshteinAutomata.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestLevenshteinAutomata.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/automaton/TestLevenshteinAutomata.java Wed Mar 12 14:39:17 2014
@@ -141,7 +141,7 @@ public class TestLevenshteinAutomata ext
* one character)
*/
private Automaton insertionsOf(String s) {
- List<Automaton> list = new ArrayList<Automaton>();
+ List<Automaton> list = new ArrayList<>();
for (int i = 0; i <= s.length(); i++) {
Automaton a = BasicAutomata.makeString(s.substring(0, i));
@@ -161,7 +161,7 @@ public class TestLevenshteinAutomata ext
* one character).
*/
private Automaton deletionsOf(String s) {
- List<Automaton> list = new ArrayList<Automaton>();
+ List<Automaton> list = new ArrayList<>();
for (int i = 0; i < s.length(); i++) {
Automaton a = BasicAutomata.makeString(s.substring(0, i));
@@ -181,7 +181,7 @@ public class TestLevenshteinAutomata ext
* (replacing one character)
*/
private Automaton substitutionsOf(String s) {
- List<Automaton> list = new ArrayList<Automaton>();
+ List<Automaton> list = new ArrayList<>();
for (int i = 0; i < s.length(); i++) {
Automaton a = BasicAutomata.makeString(s.substring(0, i));
@@ -203,7 +203,7 @@ public class TestLevenshteinAutomata ext
private Automaton transpositionsOf(String s) {
if (s.length() < 2)
return BasicAutomata.makeEmpty();
- List<Automaton> list = new ArrayList<Automaton>();
+ List<Automaton> list = new ArrayList<>();
for (int i = 0; i < s.length()-1; i++) {
StringBuilder sb = new StringBuilder();
sb.append(s.substring(0, i));
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java Wed Mar 12 14:39:17 2014
@@ -55,7 +55,7 @@ public class Test2BFST extends LuceneTes
System.out.println("\nTEST: 3B nodes; doPack=false output=NO_OUTPUTS");
Outputs<Object> outputs = NoOutputs.getSingleton();
Object NO_OUTPUT = outputs.getNoOutput();
- final Builder<Object> b = new Builder<Object>(FST.INPUT_TYPE.BYTE1, 0, 0, true, true, Integer.MAX_VALUE, outputs,
+ final Builder<Object> b = new Builder<>(FST.INPUT_TYPE.BYTE1, 0, 0, true, true, Integer.MAX_VALUE, outputs,
null, doPack, PackedInts.COMPACT, true, 15);
int count = 0;
@@ -98,7 +98,7 @@ public class Test2BFST extends LuceneTes
}
System.out.println("\nTEST: enum all input/outputs");
- IntsRefFSTEnum<Object> fstEnum = new IntsRefFSTEnum<Object>(fst);
+ IntsRefFSTEnum<Object> fstEnum = new IntsRefFSTEnum<>(fst);
Arrays.fill(ints2, 0);
r = new Random(seed);
@@ -124,7 +124,7 @@ public class Test2BFST extends LuceneTes
fst.save(out);
out.close();
IndexInput in = dir.openInput("fst", IOContext.DEFAULT);
- fst = new FST<Object>(in, outputs);
+ fst = new FST<>(in, outputs);
in.close();
} else {
dir.deleteFile("fst");
@@ -137,7 +137,7 @@ public class Test2BFST extends LuceneTes
{
System.out.println("\nTEST: 3 GB size; doPack=" + doPack + " outputs=bytes");
Outputs<BytesRef> outputs = ByteSequenceOutputs.getSingleton();
- final Builder<BytesRef> b = new Builder<BytesRef>(FST.INPUT_TYPE.BYTE1, 0, 0, true, true, Integer.MAX_VALUE, outputs,
+ final Builder<BytesRef> b = new Builder<>(FST.INPUT_TYPE.BYTE1, 0, 0, true, true, Integer.MAX_VALUE, outputs,
null, doPack, PackedInts.COMPACT, true, 15);
byte[] outputBytes = new byte[20];
@@ -177,7 +177,7 @@ public class Test2BFST extends LuceneTes
}
System.out.println("\nTEST: enum all input/outputs");
- IntsRefFSTEnum<BytesRef> fstEnum = new IntsRefFSTEnum<BytesRef>(fst);
+ IntsRefFSTEnum<BytesRef> fstEnum = new IntsRefFSTEnum<>(fst);
Arrays.fill(ints, 0);
r = new Random(seed);
@@ -201,7 +201,7 @@ public class Test2BFST extends LuceneTes
fst.save(out);
out.close();
IndexInput in = dir.openInput("fst", IOContext.DEFAULT);
- fst = new FST<BytesRef>(in, outputs);
+ fst = new FST<>(in, outputs);
in.close();
} else {
dir.deleteFile("fst");
@@ -214,7 +214,7 @@ public class Test2BFST extends LuceneTes
{
System.out.println("\nTEST: 3 GB size; doPack=" + doPack + " outputs=long");
Outputs<Long> outputs = PositiveIntOutputs.getSingleton();
- final Builder<Long> b = new Builder<Long>(FST.INPUT_TYPE.BYTE1, 0, 0, true, true, Integer.MAX_VALUE, outputs,
+ final Builder<Long> b = new Builder<>(FST.INPUT_TYPE.BYTE1, 0, 0, true, true, Integer.MAX_VALUE, outputs,
null, doPack, PackedInts.COMPACT, true, 15);
long output = 1;
@@ -260,7 +260,7 @@ public class Test2BFST extends LuceneTes
}
System.out.println("\nTEST: enum all input/outputs");
- IntsRefFSTEnum<Long> fstEnum = new IntsRefFSTEnum<Long>(fst);
+ IntsRefFSTEnum<Long> fstEnum = new IntsRefFSTEnum<>(fst);
Arrays.fill(ints, 0);
r = new Random(seed);
@@ -285,7 +285,7 @@ public class Test2BFST extends LuceneTes
fst.save(out);
out.close();
IndexInput in = dir.openInput("fst", IOContext.DEFAULT);
- fst = new FST<Long>(in, outputs);
+ fst = new FST<>(in, outputs);
in.close();
} else {
dir.deleteFile("fst");
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java Wed Mar 12 14:39:17 2014
@@ -114,11 +114,11 @@ public class TestFSTs extends LuceneTest
{
final Outputs<Object> outputs = NoOutputs.getSingleton();
final Object NO_OUTPUT = outputs.getNoOutput();
- final List<FSTTester.InputOutput<Object>> pairs = new ArrayList<FSTTester.InputOutput<Object>>(terms2.length);
+ final List<FSTTester.InputOutput<Object>> pairs = new ArrayList<>(terms2.length);
for(IntsRef term : terms2) {
- pairs.add(new FSTTester.InputOutput<Object>(term, NO_OUTPUT));
+ pairs.add(new FSTTester.InputOutput<>(term, NO_OUTPUT));
}
- FST<Object> fst = new FSTTester<Object>(random(), dir, inputMode, pairs, outputs, false).doTest(0, 0, false);
+ FST<Object> fst = new FSTTester<>(random(), dir, inputMode, pairs, outputs, false).doTest(0, 0, false);
assertNotNull(fst);
assertEquals(22, fst.getNodeCount());
assertEquals(27, fst.getArcCount());
@@ -127,11 +127,11 @@ public class TestFSTs extends LuceneTest
// FST ord pos int
{
final PositiveIntOutputs outputs = PositiveIntOutputs.getSingleton();
- final List<FSTTester.InputOutput<Long>> pairs = new ArrayList<FSTTester.InputOutput<Long>>(terms2.length);
+ final List<FSTTester.InputOutput<Long>> pairs = new ArrayList<>(terms2.length);
for(int idx=0;idx<terms2.length;idx++) {
- pairs.add(new FSTTester.InputOutput<Long>(terms2[idx], (long) idx));
+ pairs.add(new FSTTester.InputOutput<>(terms2[idx], (long) idx));
}
- final FST<Long> fst = new FSTTester<Long>(random(), dir, inputMode, pairs, outputs, true).doTest(0, 0, false);
+ final FST<Long> fst = new FSTTester<>(random(), dir, inputMode, pairs, outputs, true).doTest(0, 0, false);
assertNotNull(fst);
assertEquals(22, fst.getNodeCount());
assertEquals(27, fst.getArcCount());
@@ -141,12 +141,12 @@ public class TestFSTs extends LuceneTest
{
final ByteSequenceOutputs outputs = ByteSequenceOutputs.getSingleton();
final BytesRef NO_OUTPUT = outputs.getNoOutput();
- final List<FSTTester.InputOutput<BytesRef>> pairs = new ArrayList<FSTTester.InputOutput<BytesRef>>(terms2.length);
+ final List<FSTTester.InputOutput<BytesRef>> pairs = new ArrayList<>(terms2.length);
for(int idx=0;idx<terms2.length;idx++) {
final BytesRef output = random().nextInt(30) == 17 ? NO_OUTPUT : new BytesRef(Integer.toString(idx));
- pairs.add(new FSTTester.InputOutput<BytesRef>(terms2[idx], output));
+ pairs.add(new FSTTester.InputOutput<>(terms2[idx], output));
}
- final FST<BytesRef> fst = new FSTTester<BytesRef>(random(), dir, inputMode, pairs, outputs, false).doTest(0, 0, false);
+ final FST<BytesRef> fst = new FSTTester<>(random(), dir, inputMode, pairs, outputs, false).doTest(0, 0, false);
assertNotNull(fst);
assertEquals(24, fst.getNodeCount());
assertEquals(30, fst.getArcCount());
@@ -162,78 +162,78 @@ public class TestFSTs extends LuceneTest
{
final Outputs<Object> outputs = NoOutputs.getSingleton();
final Object NO_OUTPUT = outputs.getNoOutput();
- final List<FSTTester.InputOutput<Object>> pairs = new ArrayList<FSTTester.InputOutput<Object>>(terms.length);
+ final List<FSTTester.InputOutput<Object>> pairs = new ArrayList<>(terms.length);
for(IntsRef term : terms) {
- pairs.add(new FSTTester.InputOutput<Object>(term, NO_OUTPUT));
+ pairs.add(new FSTTester.InputOutput<>(term, NO_OUTPUT));
}
- new FSTTester<Object>(random(), dir, inputMode, pairs, outputs, false).doTest(true);
+ new FSTTester<>(random(), dir, inputMode, pairs, outputs, false).doTest(true);
}
// PositiveIntOutput (ord)
{
final PositiveIntOutputs outputs = PositiveIntOutputs.getSingleton();
- final List<FSTTester.InputOutput<Long>> pairs = new ArrayList<FSTTester.InputOutput<Long>>(terms.length);
+ final List<FSTTester.InputOutput<Long>> pairs = new ArrayList<>(terms.length);
for(int idx=0;idx<terms.length;idx++) {
- pairs.add(new FSTTester.InputOutput<Long>(terms[idx], (long) idx));
+ pairs.add(new FSTTester.InputOutput<>(terms[idx], (long) idx));
}
- new FSTTester<Long>(random(), dir, inputMode, pairs, outputs, true).doTest(true);
+ new FSTTester<>(random(), dir, inputMode, pairs, outputs, true).doTest(true);
}
// PositiveIntOutput (random monotonically increasing positive number)
{
final PositiveIntOutputs outputs = PositiveIntOutputs.getSingleton();
- final List<FSTTester.InputOutput<Long>> pairs = new ArrayList<FSTTester.InputOutput<Long>>(terms.length);
+ final List<FSTTester.InputOutput<Long>> pairs = new ArrayList<>(terms.length);
long lastOutput = 0;
for(int idx=0;idx<terms.length;idx++) {
final long value = lastOutput + TestUtil.nextInt(random(), 1, 1000);
lastOutput = value;
- pairs.add(new FSTTester.InputOutput<Long>(terms[idx], value));
+ pairs.add(new FSTTester.InputOutput<>(terms[idx], value));
}
- new FSTTester<Long>(random(), dir, inputMode, pairs, outputs, true).doTest(true);
+ new FSTTester<>(random(), dir, inputMode, pairs, outputs, true).doTest(true);
}
// PositiveIntOutput (random positive number)
{
final PositiveIntOutputs outputs = PositiveIntOutputs.getSingleton();
- final List<FSTTester.InputOutput<Long>> pairs = new ArrayList<FSTTester.InputOutput<Long>>(terms.length);
+ final List<FSTTester.InputOutput<Long>> pairs = new ArrayList<>(terms.length);
for(int idx=0;idx<terms.length;idx++) {
- pairs.add(new FSTTester.InputOutput<Long>(terms[idx], TestUtil.nextLong(random(), 0, Long.MAX_VALUE)));
+ pairs.add(new FSTTester.InputOutput<>(terms[idx], TestUtil.nextLong(random(), 0, Long.MAX_VALUE)));
}
- new FSTTester<Long>(random(), dir, inputMode, pairs, outputs, false).doTest(true);
+ new FSTTester<>(random(), dir, inputMode, pairs, outputs, false).doTest(true);
}
// Pair<ord, (random monotonically increasing positive number>
{
final PositiveIntOutputs o1 = PositiveIntOutputs.getSingleton();
final PositiveIntOutputs o2 = PositiveIntOutputs.getSingleton();
- final PairOutputs<Long,Long> outputs = new PairOutputs<Long,Long>(o1, o2);
- final List<FSTTester.InputOutput<PairOutputs.Pair<Long,Long>>> pairs = new ArrayList<FSTTester.InputOutput<PairOutputs.Pair<Long,Long>>>(terms.length);
+ final PairOutputs<Long,Long> outputs = new PairOutputs<>(o1, o2);
+ final List<FSTTester.InputOutput<PairOutputs.Pair<Long,Long>>> pairs = new ArrayList<>(terms.length);
long lastOutput = 0;
for(int idx=0;idx<terms.length;idx++) {
final long value = lastOutput + TestUtil.nextInt(random(), 1, 1000);
lastOutput = value;
- pairs.add(new FSTTester.InputOutput<PairOutputs.Pair<Long,Long>>(terms[idx],
+ pairs.add(new FSTTester.InputOutput<>(terms[idx],
outputs.newPair((long) idx, value)));
}
- new FSTTester<PairOutputs.Pair<Long,Long>>(random(), dir, inputMode, pairs, outputs, false).doTest(true);
+ new FSTTester<>(random(), dir, inputMode, pairs, outputs, false).doTest(true);
}
// Sequence-of-bytes
{
final ByteSequenceOutputs outputs = ByteSequenceOutputs.getSingleton();
final BytesRef NO_OUTPUT = outputs.getNoOutput();
- final List<FSTTester.InputOutput<BytesRef>> pairs = new ArrayList<FSTTester.InputOutput<BytesRef>>(terms.length);
+ final List<FSTTester.InputOutput<BytesRef>> pairs = new ArrayList<>(terms.length);
for(int idx=0;idx<terms.length;idx++) {
final BytesRef output = random().nextInt(30) == 17 ? NO_OUTPUT : new BytesRef(Integer.toString(idx));
- pairs.add(new FSTTester.InputOutput<BytesRef>(terms[idx], output));
+ pairs.add(new FSTTester.InputOutput<>(terms[idx], output));
}
- new FSTTester<BytesRef>(random(), dir, inputMode, pairs, outputs, false).doTest(true);
+ new FSTTester<>(random(), dir, inputMode, pairs, outputs, false).doTest(true);
}
// Sequence-of-ints
{
final IntSequenceOutputs outputs = IntSequenceOutputs.getSingleton();
- final List<FSTTester.InputOutput<IntsRef>> pairs = new ArrayList<FSTTester.InputOutput<IntsRef>>(terms.length);
+ final List<FSTTester.InputOutput<IntsRef>> pairs = new ArrayList<>(terms.length);
for(int idx=0;idx<terms.length;idx++) {
final String s = Integer.toString(idx);
final IntsRef output = new IntsRef(s.length());
@@ -241,9 +241,9 @@ public class TestFSTs extends LuceneTest
for(int idx2=0;idx2<output.length;idx2++) {
output.ints[idx2] = s.charAt(idx2);
}
- pairs.add(new FSTTester.InputOutput<IntsRef>(terms[idx], output));
+ pairs.add(new FSTTester.InputOutput<>(terms[idx], output));
}
- new FSTTester<IntsRef>(random(), dir, inputMode, pairs, outputs, false).doTest(true);
+ new FSTTester<>(random(), dir, inputMode, pairs, outputs, false).doTest(true);
}
}
@@ -270,7 +270,7 @@ public class TestFSTs extends LuceneTest
}
for(int inputMode=0;inputMode<2;inputMode++) {
final int numWords = random.nextInt(maxNumWords+1);
- Set<IntsRef> termsSet = new HashSet<IntsRef>();
+ Set<IntsRef> termsSet = new HashSet<>();
IntsRef[] terms = new IntsRef[numWords];
while(termsSet.size() < numWords) {
final String term = getRandomString(random);
@@ -312,7 +312,7 @@ public class TestFSTs extends LuceneTest
final boolean doRewrite = random().nextBoolean();
- Builder<Long> builder = new Builder<Long>(FST.INPUT_TYPE.BYTE1, 0, 0, true, true, Integer.MAX_VALUE, outputs, null, doRewrite, PackedInts.DEFAULT, true, 15);
+ Builder<Long> builder = new Builder<>(FST.INPUT_TYPE.BYTE1, 0, 0, true, true, Integer.MAX_VALUE, outputs, null, doRewrite, PackedInts.DEFAULT, true, 15);
boolean storeOrd = random().nextBoolean();
if (VERBOSE) {
@@ -373,7 +373,7 @@ public class TestFSTs extends LuceneTest
final Random random = new Random(random().nextLong());
// Now confirm BytesRefFSTEnum and TermsEnum act the
// same:
- final BytesRefFSTEnum<Long> fstEnum = new BytesRefFSTEnum<Long>(fst);
+ final BytesRefFSTEnum<Long> fstEnum = new BytesRefFSTEnum<>(fst);
int num = atLeast(1000);
for(int iter=0;iter<num;iter++) {
final BytesRef randomTerm = new BytesRef(getRandomString(random));
@@ -455,7 +455,7 @@ public class TestFSTs extends LuceneTest
this.outputs = outputs;
this.doPack = doPack;
- builder = new Builder<T>(inputMode == 0 ? FST.INPUT_TYPE.BYTE1 : FST.INPUT_TYPE.BYTE4, 0, prune, prune == 0, true, Integer.MAX_VALUE, outputs, null, doPack, PackedInts.DEFAULT, !noArcArrays, 15);
+ builder = new Builder<>(inputMode == 0 ? FST.INPUT_TYPE.BYTE1 : FST.INPUT_TYPE.BYTE4, 0, prune, prune == 0, true, Integer.MAX_VALUE, outputs, null, doPack, PackedInts.DEFAULT, !noArcArrays, 15);
}
protected abstract T getOutput(IntsRef input, int ord) throws IOException;
@@ -657,7 +657,7 @@ public class TestFSTs extends LuceneTest
// Store both ord & docFreq:
final PositiveIntOutputs o1 = PositiveIntOutputs.getSingleton();
final PositiveIntOutputs o2 = PositiveIntOutputs.getSingleton();
- final PairOutputs<Long,Long> outputs = new PairOutputs<Long,Long>(o1, o2);
+ final PairOutputs<Long,Long> outputs = new PairOutputs<>(o1, o2);
new VisitTerms<PairOutputs.Pair<Long,Long>>(dirOut, wordsFileIn, inputMode, prune, outputs, doPack, noArcArrays) {
Random rand;
@Override
@@ -706,9 +706,9 @@ public class TestFSTs extends LuceneTest
public void testSingleString() throws Exception {
final Outputs<Object> outputs = NoOutputs.getSingleton();
- final Builder<Object> b = new Builder<Object>(FST.INPUT_TYPE.BYTE1, outputs);
+ final Builder<Object> b = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);
b.add(Util.toIntsRef(new BytesRef("foobar"), new IntsRef()), outputs.getNoOutput());
- final BytesRefFSTEnum<Object> fstEnum = new BytesRefFSTEnum<Object>(b.finish());
+ final BytesRefFSTEnum<Object> fstEnum = new BytesRefFSTEnum<>(b.finish());
assertNull(fstEnum.seekFloor(new BytesRef("foo")));
assertNull(fstEnum.seekCeil(new BytesRef("foobaz")));
}
@@ -717,7 +717,7 @@ public class TestFSTs extends LuceneTest
public void testDuplicateFSAString() throws Exception {
String str = "foobar";
final Outputs<Object> outputs = NoOutputs.getSingleton();
- final Builder<Object> b = new Builder<Object>(FST.INPUT_TYPE.BYTE1, outputs);
+ final Builder<Object> b = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);
IntsRef ints = new IntsRef();
for(int i=0; i<10; i++) {
b.add(Util.toIntsRef(new BytesRef(str), ints), outputs.getNoOutput());
@@ -726,7 +726,7 @@ public class TestFSTs extends LuceneTest
// count the input paths
int count = 0;
- final BytesRefFSTEnum<Object> fstEnum = new BytesRefFSTEnum<Object>(fst);
+ final BytesRefFSTEnum<Object> fstEnum = new BytesRefFSTEnum<>(fst);
while(fstEnum.next()!=null) {
count++;
}
@@ -786,7 +786,7 @@ public class TestFSTs extends LuceneTest
final PositiveIntOutputs outputs = PositiveIntOutputs.getSingleton();
// Build an FST mapping BytesRef -> Long
- final Builder<Long> builder = new Builder<Long>(FST.INPUT_TYPE.BYTE1, outputs);
+ final Builder<Long> builder = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);
final BytesRef a = new BytesRef("a");
final BytesRef b = new BytesRef("b");
@@ -802,7 +802,7 @@ public class TestFSTs extends LuceneTest
assertEquals(42, (long) Util.get(fst, b));
assertEquals(17, (long) Util.get(fst, a));
- BytesRefFSTEnum<Long> fstEnum = new BytesRefFSTEnum<Long>(fst);
+ BytesRefFSTEnum<Long> fstEnum = new BytesRefFSTEnum<>(fst);
BytesRefFSTEnum.InputOutput<Long> seekResult;
seekResult = fstEnum.seekFloor(a);
assertNotNull(seekResult);
@@ -846,7 +846,7 @@ public class TestFSTs extends LuceneTest
if (VERBOSE) {
System.out.println("TEST: NUM_IDS=" + NUM_IDS);
}
- final Set<String> allIDs = new HashSet<String>();
+ final Set<String> allIDs = new HashSet<>();
for(int id=0;id<NUM_IDS;id++) {
String idString;
if (cycle == 0) {
@@ -873,12 +873,12 @@ public class TestFSTs extends LuceneTest
final IndexSearcher s = newSearcher(r);
w.close();
- final List<String> allIDsList = new ArrayList<String>(allIDs);
- final List<String> sortedAllIDsList = new ArrayList<String>(allIDsList);
+ final List<String> allIDsList = new ArrayList<>(allIDs);
+ final List<String> sortedAllIDsList = new ArrayList<>(allIDsList);
Collections.sort(sortedAllIDsList);
// Sprinkle in some non-existent PKs:
- Set<String> outOfBounds = new HashSet<String>();
+ Set<String> outOfBounds = new HashSet<>();
for(int idx=0;idx<NUM_IDS/10;idx++) {
String idString;
if (cycle == 0) {
@@ -976,7 +976,7 @@ public class TestFSTs extends LuceneTest
System.out.println("TEST: NUM_TERMS=" + NUM_TERMS);
}
- final Set<String> allTerms = new HashSet<String>();
+ final Set<String> allTerms = new HashSet<>();
while(allTerms.size() < NUM_TERMS) {
allTerms.add(simpleRandomString(random()));
}
@@ -997,7 +997,7 @@ public class TestFSTs extends LuceneTest
IndexSearcher s = newSearcher(r);
w.close();
- final List<String> allTermsList = new ArrayList<String>(allTerms);
+ final List<String> allTermsList = new ArrayList<>(allTerms);
Collections.shuffle(allTermsList, random());
// verify exact lookup
@@ -1024,7 +1024,7 @@ public class TestFSTs extends LuceneTest
FST<Object> compile(String[] lines) throws IOException {
final NoOutputs outputs = NoOutputs.getSingleton();
final Object nothing = outputs.getNoOutput();
- final Builder<Object> b = new Builder<Object>(FST.INPUT_TYPE.BYTE1, outputs);
+ final Builder<Object> b = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);
int line = 0;
final BytesRef term = new BytesRef();
@@ -1064,7 +1064,7 @@ public class TestFSTs extends LuceneTest
arc = fst.readNextArc(arc, fstReader), childCount++)
{
boolean expanded = fst.isExpandedTarget(arc, fstReader);
- int children = verifyStateAndBelow(fst, new FST.Arc<Object>().copyFrom(arc), depth + 1);
+ int children = verifyStateAndBelow(fst, new FST.Arc<>().copyFrom(arc), depth + 1);
assertEquals(
expanded,
@@ -1086,20 +1086,20 @@ public class TestFSTs extends LuceneTest
SyntheticData s = new SyntheticData();
- ArrayList<String> out = new ArrayList<String>();
+ ArrayList<String> out = new ArrayList<>();
StringBuilder b = new StringBuilder();
s.generate(out, b, 'a', 'i', 10);
String[] input = out.toArray(new String[out.size()]);
Arrays.sort(input);
FST<Object> fst = s.compile(input);
- FST.Arc<Object> arc = fst.getFirstArc(new FST.Arc<Object>());
+ FST.Arc<Object> arc = fst.getFirstArc(new FST.Arc<>());
s.verifyStateAndBelow(fst, arc, 1);
}
public void testFinalOutputOnEndState() throws Exception {
final PositiveIntOutputs outputs = PositiveIntOutputs.getSingleton();
- final Builder<Long> builder = new Builder<Long>(FST.INPUT_TYPE.BYTE4, 2, 0, true, true, Integer.MAX_VALUE, outputs, null, random().nextBoolean(), PackedInts.DEFAULT, true, 15);
+ final Builder<Long> builder = new Builder<>(FST.INPUT_TYPE.BYTE4, 2, 0, true, true, Integer.MAX_VALUE, outputs, null, random().nextBoolean(), PackedInts.DEFAULT, true, 15);
builder.add(Util.toUTF32("stat", new IntsRef()), 17L);
builder.add(Util.toUTF32("station", new IntsRef()), 10L);
final FST<Long> fst = builder.finish();
@@ -1114,7 +1114,7 @@ public class TestFSTs extends LuceneTest
public void testInternalFinalState() throws Exception {
final PositiveIntOutputs outputs = PositiveIntOutputs.getSingleton();
final boolean willRewrite = random().nextBoolean();
- final Builder<Long> builder = new Builder<Long>(FST.INPUT_TYPE.BYTE1, 0, 0, true, true, Integer.MAX_VALUE, outputs, null, willRewrite, PackedInts.DEFAULT, true, 15);
+ final Builder<Long> builder = new Builder<>(FST.INPUT_TYPE.BYTE1, 0, 0, true, true, Integer.MAX_VALUE, outputs, null, willRewrite, PackedInts.DEFAULT, true, 15);
builder.add(Util.toIntsRef(new BytesRef("stat"), new IntsRef()), outputs.getNoOutput());
builder.add(Util.toIntsRef(new BytesRef("station"), new IntsRef()), outputs.getNoOutput());
final FST<Long> fst = builder.finish();
@@ -1135,15 +1135,15 @@ public class TestFSTs extends LuceneTest
public void testNonFinalStopNode() throws Exception {
final PositiveIntOutputs outputs = PositiveIntOutputs.getSingleton();
final Long nothing = outputs.getNoOutput();
- final Builder<Long> b = new Builder<Long>(FST.INPUT_TYPE.BYTE1, outputs);
+ final Builder<Long> b = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);
- final FST<Long> fst = new FST<Long>(FST.INPUT_TYPE.BYTE1, outputs, false, PackedInts.COMPACT, true, 15);
+ final FST<Long> fst = new FST<>(FST.INPUT_TYPE.BYTE1, outputs, false, PackedInts.COMPACT, true, 15);
- final Builder.UnCompiledNode<Long> rootNode = new Builder.UnCompiledNode<Long>(b, 0);
+ final Builder.UnCompiledNode<Long> rootNode = new Builder.UnCompiledNode<>(b, 0);
// Add final stop node
{
- final Builder.UnCompiledNode<Long> node = new Builder.UnCompiledNode<Long>(b, 0);
+ final Builder.UnCompiledNode<Long> node = new Builder.UnCompiledNode<>(b, 0);
node.isFinal = true;
rootNode.addArc('a', node);
final Builder.CompiledNode frozen = new Builder.CompiledNode();
@@ -1156,7 +1156,7 @@ public class TestFSTs extends LuceneTest
// Add non-final stop node
{
- final Builder.UnCompiledNode<Long> node = new Builder.UnCompiledNode<Long>(b, 0);
+ final Builder.UnCompiledNode<Long> node = new Builder.UnCompiledNode<>(b, 0);
rootNode.addArc('b', node);
final Builder.CompiledNode frozen = new Builder.CompiledNode();
frozen.node = fst.addNode(node);
@@ -1181,7 +1181,7 @@ public class TestFSTs extends LuceneTest
out.close();
IndexInput in = dir.openInput("fst", IOContext.DEFAULT);
- final FST<Long> fst2 = new FST<Long>(in, outputs);
+ final FST<Long> fst2 = new FST<>(in, outputs);
checkStopNodes(fst2, outputs);
in.close();
dir.close();
@@ -1214,7 +1214,7 @@ public class TestFSTs extends LuceneTest
public void testShortestPaths() throws Exception {
final PositiveIntOutputs outputs = PositiveIntOutputs.getSingleton();
- final Builder<Long> builder = new Builder<Long>(FST.INPUT_TYPE.BYTE1, outputs);
+ final Builder<Long> builder = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);
final IntsRef scratch = new IntsRef();
builder.add(Util.toIntsRef(new BytesRef("aab"), scratch), 22L);
@@ -1254,12 +1254,12 @@ public class TestFSTs extends LuceneTest
/** like testShortestPaths, but uses pairoutputs so we have both a weight and an output */
public void testShortestPathsWFST() throws Exception {
- PairOutputs<Long,Long> outputs = new PairOutputs<Long,Long>(
+ PairOutputs<Long,Long> outputs = new PairOutputs<>(
PositiveIntOutputs.getSingleton(), // weight
PositiveIntOutputs.getSingleton() // output
);
- final Builder<Pair<Long,Long>> builder = new Builder<Pair<Long,Long>>(FST.INPUT_TYPE.BYTE1, outputs);
+ final Builder<Pair<Long,Long>> builder = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);
final IntsRef scratch = new IntsRef();
builder.add(Util.toIntsRef(new BytesRef("aab"), scratch), outputs.newPair(22L, 57L));
@@ -1295,11 +1295,11 @@ public class TestFSTs extends LuceneTest
final Random random = random();
int numWords = atLeast(1000);
- final TreeMap<String,Long> slowCompletor = new TreeMap<String,Long>();
- final TreeSet<String> allPrefixes = new TreeSet<String>();
+ final TreeMap<String,Long> slowCompletor = new TreeMap<>();
+ final TreeSet<String> allPrefixes = new TreeSet<>();
final PositiveIntOutputs outputs = PositiveIntOutputs.getSingleton();
- final Builder<Long> builder = new Builder<Long>(FST.INPUT_TYPE.BYTE1, outputs);
+ final Builder<Long> builder = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);
final IntsRef scratch = new IntsRef();
for (int i = 0; i < numWords; i++) {
@@ -1350,19 +1350,19 @@ public class TestFSTs extends LuceneTest
Util.MinResult<Long>[] r = Util.shortestPaths(fst, arc, fst.outputs.getNoOutput(), minLongComparator, topN, true);
// 2. go thru whole treemap (slowCompletor) and check its actually the best suggestion
- final List<Util.MinResult<Long>> matches = new ArrayList<Util.MinResult<Long>>();
+ final List<Util.MinResult<Long>> matches = new ArrayList<>();
// TODO: could be faster... but its slowCompletor for a reason
for (Map.Entry<String,Long> e : slowCompletor.entrySet()) {
if (e.getKey().startsWith(prefix)) {
//System.out.println(" consider " + e.getKey());
- matches.add(new Util.MinResult<Long>(Util.toIntsRef(new BytesRef(e.getKey().substring(prefix.length())), new IntsRef()),
+ matches.add(new Util.MinResult<>(Util.toIntsRef(new BytesRef(e.getKey().substring(prefix.length())), new IntsRef()),
e.getValue() - prefixOutput));
}
}
assertTrue(matches.size() > 0);
- Collections.sort(matches, new TieBreakByInputComparator<Long>(minLongComparator));
+ Collections.sort(matches, new TieBreakByInputComparator<>(minLongComparator));
if (matches.size() > topN) {
matches.subList(topN, matches.size()).clear();
}
@@ -1409,14 +1409,14 @@ public class TestFSTs extends LuceneTest
public void testShortestPathsWFSTRandom() throws Exception {
int numWords = atLeast(1000);
- final TreeMap<String,TwoLongs> slowCompletor = new TreeMap<String,TwoLongs>();
- final TreeSet<String> allPrefixes = new TreeSet<String>();
+ final TreeMap<String,TwoLongs> slowCompletor = new TreeMap<>();
+ final TreeSet<String> allPrefixes = new TreeSet<>();
- PairOutputs<Long,Long> outputs = new PairOutputs<Long,Long>(
+ PairOutputs<Long,Long> outputs = new PairOutputs<>(
PositiveIntOutputs.getSingleton(), // weight
PositiveIntOutputs.getSingleton() // output
);
- final Builder<Pair<Long,Long>> builder = new Builder<Pair<Long,Long>>(FST.INPUT_TYPE.BYTE1, outputs);
+ final Builder<Pair<Long,Long>> builder = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);
final IntsRef scratch = new IntsRef();
Random random = random();
@@ -1471,19 +1471,19 @@ public class TestFSTs extends LuceneTest
Util.MinResult<Pair<Long,Long>>[] r = Util.shortestPaths(fst, arc, fst.outputs.getNoOutput(), minPairWeightComparator, topN, true);
// 2. go thru whole treemap (slowCompletor) and check its actually the best suggestion
- final List<Util.MinResult<Pair<Long,Long>>> matches = new ArrayList<Util.MinResult<Pair<Long,Long>>>();
+ final List<Util.MinResult<Pair<Long,Long>>> matches = new ArrayList<>();
// TODO: could be faster... but its slowCompletor for a reason
for (Map.Entry<String,TwoLongs> e : slowCompletor.entrySet()) {
if (e.getKey().startsWith(prefix)) {
//System.out.println(" consider " + e.getKey());
- matches.add(new Util.MinResult<Pair<Long,Long>>(Util.toIntsRef(new BytesRef(e.getKey().substring(prefix.length())), new IntsRef()),
+ matches.add(new Util.MinResult<>(Util.toIntsRef(new BytesRef(e.getKey().substring(prefix.length())), new IntsRef()),
outputs.newPair(e.getValue().a - prefixOutput.output1, e.getValue().b - prefixOutput.output2)));
}
}
assertTrue(matches.size() > 0);
- Collections.sort(matches, new TieBreakByInputComparator<Pair<Long,Long>>(minPairWeightComparator));
+ Collections.sort(matches, new TieBreakByInputComparator<>(minPairWeightComparator));
if (matches.size() > topN) {
matches.subList(topN, matches.size()).clear();
}
@@ -1500,7 +1500,7 @@ public class TestFSTs extends LuceneTest
public void testLargeOutputsOnArrayArcs() throws Exception {
final ByteSequenceOutputs outputs = ByteSequenceOutputs.getSingleton();
- final Builder<BytesRef> builder = new Builder<BytesRef>(FST.INPUT_TYPE.BYTE1, outputs);
+ final Builder<BytesRef> builder = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);
final byte[] bytes = new byte[300];
final IntsRef input = new IntsRef();