Refactor: Rename
Change-Id: I5429759af26ff99623338c605f1b03bddeb7b814
Showing
1 changed file
with
6 additions
and
6 deletions
| ... | @@ -174,22 +174,22 @@ class TransactionalContinuousResourceStore { | ... | @@ -174,22 +174,22 @@ class TransactionalContinuousResourceStore { |
| 174 | boolean release(ContinuousResource resource, ResourceConsumer consumer) { | 174 | boolean release(ContinuousResource resource, ResourceConsumer consumer) { |
| 175 | ContinuousResourceAllocation oldAllocation = consumers.get(resource.id()); | 175 | ContinuousResourceAllocation oldAllocation = consumers.get(resource.id()); |
| 176 | 176 | ||
| 177 | - List<ResourceAllocation> nonMatchResources = oldAllocation.allocations().stream() | 177 | + List<ResourceAllocation> nonMatched = oldAllocation.allocations().stream() |
| 178 | .filter(x -> !(x.consumer().equals(consumer) && | 178 | .filter(x -> !(x.consumer().equals(consumer) && |
| 179 | ((ContinuousResource) x.resource()).value() == resource.value())) | 179 | ((ContinuousResource) x.resource()).value() == resource.value())) |
| 180 | .collect(Collectors.toList()); | 180 | .collect(Collectors.toList()); |
| 181 | 181 | ||
| 182 | - List<ResourceAllocation> matchResources = oldAllocation.allocations().stream() | 182 | + List<ResourceAllocation> matched = oldAllocation.allocations().stream() |
| 183 | .filter(x -> (x.consumer().equals(consumer) && | 183 | .filter(x -> (x.consumer().equals(consumer) && |
| 184 | ((ContinuousResource) x.resource()).value() == resource.value())) | 184 | ((ContinuousResource) x.resource()).value() == resource.value())) |
| 185 | .collect(Collectors.toList()); | 185 | .collect(Collectors.toList()); |
| 186 | 186 | ||
| 187 | - if (matchResources.size() > 1) { | 187 | + if (matched.size() > 1) { |
| 188 | - matchResources.remove(0); | 188 | + matched.remove(0); |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | - ImmutableList<ResourceAllocation> finalAllocations = Stream.concat(nonMatchResources.stream(), | 191 | + ImmutableList<ResourceAllocation> finalAllocations = Stream.concat(nonMatched.stream(), |
| 192 | - matchResources.stream()).collect(GuavaCollectors.toImmutableList()); | 192 | + matched.stream()).collect(GuavaCollectors.toImmutableList()); |
| 193 | 193 | ||
| 194 | if (!consumers.replace(resource.id(), oldAllocation, | 194 | if (!consumers.replace(resource.id(), oldAllocation, |
| 195 | new ContinuousResourceAllocation(oldAllocation.original(), finalAllocations))) { | 195 | new ContinuousResourceAllocation(oldAllocation.original(), finalAllocations))) { | ... | ... |
-
Please register or login to post a comment