Skip to content

Commit

Permalink
MODSOURMAN-1063: Bug fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
VRohach committed Jan 17, 2024
1 parent c5b3309 commit 3145350
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,12 @@ private static RecordProcessingLogDtoCollection processMultipleHoldingsAndItemsI
List<ProcessedHoldingsInfo> relatedHoldingsInfos = relatedHoldingsInfoBySourceRecordId.get(sourceRecordId);
List<ProcessedItemInfo> relatedItemInfos = relatedItemInfoBySourceId.get(sourceRecordId);

RecordProcessingLogDto firstRecordWithCurrentSourceId = entries.stream().filter(record ->
record.getSourceRecordId().equals(sourceRecordId)).findFirst().get();
Optional<RecordProcessingLogDto> optionalRecord = entries.stream()
.filter(record -> record.getSourceRecordId().equals(sourceRecordId)).findFirst();
RecordProcessingLogDto firstRecordWithCurrentSourceId = new RecordProcessingLogDto();
if (optionalRecord.isPresent()) {
firstRecordWithCurrentSourceId = optionalRecord.get();
}
RecordProcessingLogDto newRecord = firstRecordWithCurrentSourceId
.withRelatedHoldingsInfo(relatedHoldingsInfos.stream().distinct().toList())
.withRelatedItemInfo(relatedItemInfos.stream().distinct().toList());
Expand Down

0 comments on commit 3145350

Please sign in to comment.