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; }