Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/910#discussion_r43245790
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java 
---
    @@ -57,14 +57,16 @@ public AbstractTransformer() {
         public void setEntity(EntityLocal entity) {
             super.setEntity(entity);
     
    -        Function<SensorEvent<T>, U> transformation = getTransformation();
             this.producer = getConfig(PRODUCER) == null ? entity: 
getConfig(PRODUCER);
             this.sourceSensor = (Sensor<T>) getRequiredConfig(SOURCE_SENSOR);
             Sensor<?> targetSensorSpecified = getConfig(TARGET_SENSOR);
             this.targetSensor = targetSensorSpecified!=null ? (Sensor<U>) 
targetSensorSpecified : (Sensor<U>) this.sourceSensor;
             if (producer.equals(entity) && targetSensorSpecified==null) {
    +            // We cannot call getTransformation() here to log the 
tranformation, as it will attempt
    +            // to resolve the transformation, which will cause the entity 
initialization thread to
    +            // block
                 LOG.error("Refusing to add an enricher which reads and 
publishes on the same sensor: "+
    --- End diff --
    
    of course -- sorry for daft comment.  would it be useful to log 
`JavaClassNames.simpleClassName(this)` ?


---
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.
---

Reply via email to