Skip to content

Apache Lucene open-source search software

Fix rawtypes and fallthrough warnings in FST suggester; "all" does not work with JavaC

Uwe Schindler5a91c157b62a
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletion.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletion.java
index eeb0edaa33f..38f3276b043 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletion.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletion.java
@@ -109,7 +109,7 @@ public class FSTCompletion {
* Find and push an exact match to the first position of the result
* list if found.
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","rawtypes"})
public FSTCompletion(FST<Object> automaton, boolean higherWeightsFirst, boolean exactFirst) {
this.automaton = automaton;
if (automaton != null) {
@@ -133,7 +133,7 @@ public class FSTCompletion {
* Cache the root node's output arcs starting with completions with the
* highest weights.
*/
- @SuppressWarnings({"all"})
+ @SuppressWarnings({"unchecked","rawtypes"})
private static Arc<Object>[] cacheRootArcs(FST<Object> automaton) {
try {
List<Arc<Object>> rootArcs = new ArrayList<Arc<Object>>();
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/FuzzySuggesterTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/FuzzySuggesterTest.java
index b473e4dfc45..3df811002c2 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/FuzzySuggesterTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/FuzzySuggesterTest.java
@@ -822,6 +822,7 @@ public class FuzzySuggesterTest extends LuceneTestCase {
assertEquals("[barbazfoo/10]", suggester.lookup("bar baz foo", false, 5).toString());
}
+ @SuppressWarnings("fallthrough")
private static String addRandomEdit(String string, int prefixLength) {
char[] input = string.toCharArray();
StringBuilder builder = new StringBuilder();