Committed by
Gerrit Code Review
Remove a conditional branch that is not meaningful
The isolation level of TransactionalMap is repeatable read. Read values for the same key don't change during a transaction. The removed branch is never executed because the variable "before" is null. Change-Id: I5cd1f7a488e3585d5a1e92dd5b50d52261edf415
Showing
1 changed file
with
1 additions
and
6 deletions
... | @@ -361,12 +361,7 @@ public class ConsistentLinkResourceStore extends | ... | @@ -361,12 +361,7 @@ public class ConsistentLinkResourceStore extends |
361 | if (before == null) { | 361 | if (before == null) { |
362 | List<LinkResourceAllocations> after = new ArrayList<>(); | 362 | List<LinkResourceAllocations> after = new ArrayList<>(); |
363 | after.add(allocations); | 363 | after.add(allocations); |
364 | - before = linkAllocs.putIfAbsent(linkKey, after); | 364 | + linkAllocs.putIfAbsent(linkKey, after); |
365 | - if (before != null) { | ||
366 | - // concurrent allocation detected, retry transaction : is this needed? | ||
367 | - log.warn("Concurrent Allocation, retrying"); | ||
368 | - throw new TransactionException(); | ||
369 | - } | ||
370 | } else { | 365 | } else { |
371 | List<LinkResourceAllocations> after = new ArrayList<>(before.size() + 1); | 366 | List<LinkResourceAllocations> after = new ArrayList<>(before.size() + 1); |
372 | after.addAll(before); | 367 | after.addAll(before); | ... | ... |
-
Please register or login to post a comment