Skip to content

Apache Lucene open-source search software

fix/suppress compile warnings that are not induced by Lucene's API

David Wayne Smiley1c4c0114ddaf
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeFactory.java b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeFactory.java
index bbd753cb69e..51ba2aa83d8 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeFactory.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeFactory.java
@@ -54,7 +54,7 @@ public abstract class SpatialPrefixTreeFactory {
instance = new QuadPrefixTree.Factory();
else {
try {
- Class c = classLoader.loadClass(cname);
+ Class<?> c = classLoader.loadClass(cname);
instance = (SpatialPrefixTreeFactory) c.newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCache.java b/lucene/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCache.java
index 07e1ab19214..e26f29046a9 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCache.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCache.java
@@ -32,10 +32,10 @@ import java.util.List;
* @lucene.internal
*/
public class ShapeFieldCache<T extends Shape> {
- private List<T>[] cache;
- public int defaultLength;
+ private final List<T>[] cache;
+ public final int defaultLength;
- @SuppressWarnings({"unchecked"})
+ @SuppressWarnings({"unchecked", "rawtypes"})
public ShapeFieldCache( int length, int defaultLength ) {
cache = new List[length];
this.defaultLength= defaultLength;