mirror of
https://github.com/rdk/p2rank.git
synced 2026-06-04 12:44:24 +08:00
Silence javac deprecation/unchecked notes
- GenericVector.toList(): replace deprecated DefaultGroovyMethods.toList
(Groovy 5) with a plain Java loop; drop unused addTo() (no callers)
- Atoms(List<? extends Atom>): @SuppressWarnings("unchecked") for the
intentional wrap-without-copy
- KdNode.splitLeafNode: @SuppressWarnings("unchecked") for casts from
the Object[] backing store
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package cz.siret.prank.features.generic;
|
||||
|
||||
import org.codehaus.groovy.runtime.DefaultGroovyMethods;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -61,13 +60,11 @@ public class GenericVector {
|
||||
}
|
||||
|
||||
public List<Double> toList() {
|
||||
return DefaultGroovyMethods.toList(data);
|
||||
}
|
||||
|
||||
public void addTo(List<Double> list) {
|
||||
for (int i = 0; i != data.length; i++) {
|
||||
list.add(data[i]);
|
||||
List<Double> list = new ArrayList<>(data.length);
|
||||
for (double v : data) {
|
||||
list.add(v);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,6 +44,7 @@ public final class Atoms implements Iterable<Atom> {
|
||||
list = new ArrayList<>(initialCapacity);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Atoms(List<? extends Atom> list) {
|
||||
if (list == null) throw new AssertionError();
|
||||
this.list = (List<Atom>) list;
|
||||
|
||||
@@ -161,6 +161,7 @@ class KdNode<T> {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void splitLeafNode() {
|
||||
right = new KdNode<T>(dimensions, bucketCapacity);
|
||||
left = new KdNode<T>(dimensions, bucketCapacity);
|
||||
|
||||
Reference in New Issue
Block a user