From 65c790a9387021ef24bd416918656aaab5cd06a7 Mon Sep 17 00:00:00 2001 From: nkumar2 Date: Mon, 23 Oct 2023 02:04:56 +0100 Subject: [PATCH] review comments incorporated --- .../eva/commons/core/models/AbstractVariantSourceEntry.java | 5 +---- .../uk/ac/ebi/eva/commons/mongodb/filter/FilterBuilder.java | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/variation-commons-core/src/main/java/uk/ac/ebi/eva/commons/core/models/AbstractVariantSourceEntry.java b/variation-commons-core/src/main/java/uk/ac/ebi/eva/commons/core/models/AbstractVariantSourceEntry.java index f549d23d..276360ce 100644 --- a/variation-commons-core/src/main/java/uk/ac/ebi/eva/commons/core/models/AbstractVariantSourceEntry.java +++ b/variation-commons-core/src/main/java/uk/ac/ebi/eva/commons/core/models/AbstractVariantSourceEntry.java @@ -66,10 +66,7 @@ public AbstractVariantSourceEntry(String fileId, String studyId, String[] second this.fileId = fileId; this.studyId = studyId; if (secondaryAlternates != null) { - this.secondaryAlternates = Arrays.stream(secondaryAlternates) - .map(a->a.toUpperCase()) - .collect(Collectors.toList()) - .toArray(new String[0]); + setSecondaryAlternates(secondaryAlternates); } else { this.secondaryAlternates = new String[]{}; } diff --git a/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/filter/FilterBuilder.java b/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/filter/FilterBuilder.java index e3bb78c8..ed0e2c89 100644 --- a/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/filter/FilterBuilder.java +++ b/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/filter/FilterBuilder.java @@ -115,8 +115,8 @@ public FilterBuilder withVariantTypes(VariantType variantType) { public FilterBuilder withAlternates(List alternates) { if (alternates != null && !alternates.isEmpty()) { - alternates = alternates.stream().map(a->a.toUpperCase()).collect(Collectors.toList()); - filters.add(new VariantRepositoryAlternateFilter(alternates)); + List alternatesUppercase = alternates.stream().map(a->a.toUpperCase()).collect(Collectors.toList()); + filters.add(new VariantRepositoryAlternateFilter(alternatesUppercase)); } return this; }