diff --git a/src/main/java/org/mskcc/cbio/portal/scripts/GeneticAlterationIncrementalImporter.java b/src/main/java/org/mskcc/cbio/portal/scripts/GeneticAlterationIncrementalImporter.java index b78c1f78..91a9b8e8 100644 --- a/src/main/java/org/mskcc/cbio/portal/scripts/GeneticAlterationIncrementalImporter.java +++ b/src/main/java/org/mskcc/cbio/portal/scripts/GeneticAlterationIncrementalImporter.java @@ -12,6 +12,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; public class GeneticAlterationIncrementalImporter extends GeneticAlterationImporter { @@ -58,7 +59,8 @@ public void initialise() { }); // add all new sample ids at the end this.orderedSampleList = new ArrayList<>(savedOrderedSampleList); - List newSampleIds = this.fileOrderedSampleList.stream().filter(sampleId -> !savedOrderedSampleList.contains(sampleId)).toList(); + Set savedSampleSet = new HashSet<>(savedOrderedSampleList); + List newSampleIds = this.fileOrderedSampleList.stream().filter(sampleId -> !savedSampleSet.contains(sampleId)).toList(); this.orderedSampleList.addAll(newSampleIds); DaoGeneticProfileSamples.deleteAllSamplesInGeneticProfile(this.geneticProfileId); this.storeOrderedSampleList();