Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/888#discussion_r39286562
--- Diff:
core/src/main/java/org/apache/brooklyn/enricher/stock/Propagator.java ---
@@ -195,7 +196,15 @@ public void emitAllAttributes(boolean
includeNullValues) {
}
}
- private Sensor<?> getDestinationSensor(Sensor<?> sourceSensor) {
- return sensorMapping.containsKey(sourceSensor) ?
sensorMapping.get(sourceSensor): sourceSensor;
+ private Sensor<?> getDestinationSensor(final Sensor<?> sourceSensor) {
+ Optional<? extends Sensor<?>> mappingSensor =
Iterables.tryFind(sensorMapping.keySet(), new Predicate<Sensor<?>>() {
--- End diff --
Worth a comment saying why we're doing this, rather than the old simpler
`sensorMapping.get(sourceSensor)`. e.g.:
// sensor equality includes the type; we want just name-equality so
will use predicate.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---