[Test] Prefer ArrayList over Vector (#30965)
Replaces some occurances of Vector class with ArrayList in tests of the rank-eval module.
This commit is contained in:
parent
1da26a42cb
commit
0a5d46ef3c
|
@ -38,7 +38,6 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode;
|
||||
import static org.elasticsearch.test.XContentTestUtils.insertRandomFields;
|
||||
|
@ -146,7 +145,7 @@ public class MeanReciprocalRankTests extends ESTestCase {
|
|||
|
||||
public void testCombine() {
|
||||
MeanReciprocalRank reciprocalRank = new MeanReciprocalRank();
|
||||
Vector<EvalQueryQuality> partialResults = new Vector<>(3);
|
||||
List<EvalQueryQuality> partialResults = new ArrayList<>(3);
|
||||
partialResults.add(new EvalQueryQuality("id1", 0.5));
|
||||
partialResults.add(new EvalQueryQuality("id2", 1.0));
|
||||
partialResults.add(new EvalQueryQuality("id3", 0.75));
|
||||
|
|
|
@ -38,7 +38,6 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode;
|
||||
import static org.elasticsearch.test.XContentTestUtils.insertRandomFields;
|
||||
|
@ -163,7 +162,7 @@ public class PrecisionAtKTests extends ESTestCase {
|
|||
|
||||
public void testCombine() {
|
||||
PrecisionAtK metric = new PrecisionAtK();
|
||||
Vector<EvalQueryQuality> partialResults = new Vector<>(3);
|
||||
List<EvalQueryQuality> partialResults = new ArrayList<>(3);
|
||||
partialResults.add(new EvalQueryQuality("a", 0.1));
|
||||
partialResults.add(new EvalQueryQuality("b", 0.2));
|
||||
partialResults.add(new EvalQueryQuality("c", 0.6));
|
||||
|
|
Loading…
Reference in New Issue