Skip to content

Commit

Permalink
fix(core): A better case insensitive comparison when bulk loading obj…
Browse files Browse the repository at this point in the history
…ects (#551)

Previously was using `Timestamped::getId` which may not always return
_expected_ lower case `id`.
  • Loading branch information
ajordens committed Jun 26, 2019
1 parent 61e03ca commit c9c0ace
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private Set<T> fetchAllItems(Set<T> existingItems) {

Map<String, T> objectsById =
objects.stream()
.collect(Collectors.toMap(Timestamped::getId, Function.identity(), (o1, o2) -> o1));
.collect(Collectors.toMap(this::buildObjectKey, Function.identity(), (o1, o2) -> o1));

for (String objectKey : objectKeys) {
if (objectsById.containsKey(objectKey)) {
Expand All @@ -371,6 +371,8 @@ private Set<T> fetchAllItems(Set<T> existingItems) {
// equivalent to the NotFoundException handling in the exceptional case below
resultMap.remove(keyToId.get(objectKey));
numRemoved.getAndIncrement();

log.warn("Unable to find result for {}:{} (filtering!)", objectType, objectKey);
}
}
} catch (UnsupportedOperationException e) {
Expand Down

0 comments on commit c9c0ace

Please sign in to comment.