[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:
Christoph Büscher 2018-05-30 21:11:49 +02:00 committed by GitHub
parent 1da26a42cb
commit 0a5d46ef3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -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));

View File

@ -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));