diff --git a/src/main/java/org/mskcc/cbio/portal/util/CnaUtil.java b/src/main/java/org/mskcc/cbio/portal/util/CnaUtil.java index 8cd00b9a..1a77a6d5 100644 --- a/src/main/java/org/mskcc/cbio/portal/util/CnaUtil.java +++ b/src/main/java/org/mskcc/cbio/portal/util/CnaUtil.java @@ -53,16 +53,14 @@ public static void storeCnaEvents( if (!CNA.AMP.equals(cnaEvent.getAlteration()) && !CNA.HOMDEL.equals(cnaEvent.getAlteration())) { continue; } - Optional existingCnaEvent = existingCnaEvents - .stream() - .filter(e -> e.equals(cnaEvent.getEvent())) - .findFirst(); - if (existingCnaEvent.isPresent()) { - cnaEvent.setEventId(existingCnaEvent.get().getEventId()); + + CnaEvent.Event event = cnaEvent.getEvent() + if (existingCnaEvents.contains(event)) { + cnaEvent.setEventId(event.getEventId()); DaoCnaEvent.addCaseCnaEvent(cnaEvent, false); } else { DaoCnaEvent.addCaseCnaEvent(cnaEvent, true); - existingCnaEvents.add(cnaEvent.getEvent()); + existingCnaEvents.add(event); } } }