code cleanup per codacy

This commit is contained in:
Jeremy Long
2017-12-28 06:25:36 -05:00
parent a85a0456bc
commit 48ff396e7e

View File

@@ -38,7 +38,7 @@ import org.junit.Test;
*/ */
public class TokenPairConcatenatingFilterTest extends BaseTokenStreamTestCase { public class TokenPairConcatenatingFilterTest extends BaseTokenStreamTestCase {
private final Analyzer analyzer; private final Analyzer analyzer;
public TokenPairConcatenatingFilterTest() { public TokenPairConcatenatingFilterTest() {
analyzer = new Analyzer() { analyzer = new Analyzer() {
@@ -49,6 +49,7 @@ public class TokenPairConcatenatingFilterTest extends BaseTokenStreamTestCase {
} }
}; };
} }
/** /**
* Test of incrementToken method, of class TokenPairConcatenatingFilter. * Test of incrementToken method, of class TokenPairConcatenatingFilter.
*/ */
@@ -63,8 +64,7 @@ public class TokenPairConcatenatingFilterTest extends BaseTokenStreamTestCase {
assertAnalyzesTo(analyzer, "red blue green", expected); assertAnalyzesTo(analyzer, "red blue green", expected);
} }
/**
/**
* copied from * copied from
* http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilter.java * http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilter.java
* blast some random strings through the analyzer * blast some random strings through the analyzer
@@ -83,7 +83,7 @@ public class TokenPairConcatenatingFilterTest extends BaseTokenStreamTestCase {
* *
* @throws IOException * @throws IOException
*/ */
public void testEmptyTerm() throws IOException { public void testEmptyTerm() {
Analyzer a = new Analyzer() { Analyzer a = new Analyzer() {
@Override @Override
protected Analyzer.TokenStreamComponents createComponents(String fieldName) { protected Analyzer.TokenStreamComponents createComponents(String fieldName) {
@@ -91,7 +91,11 @@ public class TokenPairConcatenatingFilterTest extends BaseTokenStreamTestCase {
return new Analyzer.TokenStreamComponents(tokenizer, new TokenPairConcatenatingFilter(tokenizer)); return new Analyzer.TokenStreamComponents(tokenizer, new TokenPairConcatenatingFilter(tokenizer));
} }
}; };
checkOneTerm(a, "", ""); try {
checkOneTerm(a, "", "");
} catch (IOException ex) {
fail("Failed test random strings: " + ex.getMessage());
}
} }
} }