Program: 79562
Project: 79562
Buggy source:
/** 
 * Create entities. 
 */
public void init(){
  cassandra=addChild(EntitySpec.create(CassandraCluster.class).configure("String_Node_Str",getConfig(CASSANDRA_CLUSTER_SIZE)).configure("String_Node_Str","String_Node_Str").configure("String_Node_Str","String_Node_Str").configure("String_Node_Str","String_Node_Str").configure("String_Node_Str",UsesJmx.JmxAgentModes.JMX_RMI_CUSTOM_AGENT).configure("String_Node_Str",getConfig(CASSANDRA_THRIFT_PORT)));
  tomcat=addChild(EntitySpec.create(TomcatServer.class).configure("String_Node_Str",UsesJmx.JmxAgentModes.JMX_RMI_CUSTOM_AGENT).configure("String_Node_Str","String_Node_Str").configure("String_Node_Str","String_Node_Str").configure("String_Node_Str",MutableMap.of("String_Node_Str",Entities.getRequiredUrlConfig(this,CUMULUS_RDF_CONFIG_URL))));
  configure=Effectors.effector(configure).impl(new EffectorBody<Void>(){
    private HostAndPort cassandraCluster;
    @Override public Void call(    ConfigBag parameters){
      String cassandraHostname=cassandra.getAttribute(CassandraCluster.HOSTNAME);
      Integer cassandraThriftPort=cassandra.getAttribute(CassandraCluster.THRIFT_PORT);
      HostAndPort current=HostAndPort.fromParts(cassandraHostname,cassandraThriftPort);
      if (!current.equals(cassandraCluster)) {
        cassandraCluster=current;
        Map<String,Object> config=MutableMap.<String,Object>of("String_Node_Str",cassandraHostname,"String_Node_Str",cassandraThriftPort);
        String cumulusYaml=TemplateProcessor.processTemplateContents(new ResourceUtils(this).getResourceAsString("String_Node_Str"),config);
        DynamicTasks.queue(SshEffectorTasks.put("String_Node_Str").contents(cumulusYaml));
      }
      return null;
    }
  }
).build();
  ((EntityInternal)tomcat).getMutableEntityType().addEffector(configure);
  subscribe(cassandra,CassandraCluster.HOSTNAME,new SensorEventListener<String>(){
    @Override public void onEvent(    SensorEvent<String> event){
      tomcat.invoke(configure,MutableMap.<String,Object>of());
      if (tomcat.getAttribute(Startable.SERVICE_UP)) {
        tomcat.restart();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Create entities. 
 */
public void init(){
  cassandra=addChild(EntitySpec.create(CassandraCluster.class).configure("String_Node_Str",getConfig(CASSANDRA_CLUSTER_SIZE)).configure("String_Node_Str","String_Node_Str").configure("String_Node_Str",EntitySpec.create(CassandraNode.class).configure("String_Node_Str",UsesJmx.JmxAgentModes.JMX_RMI_CUSTOM_AGENT).configure("String_Node_Str","String_Node_Str").configure("String_Node_Str","String_Node_Str").configure("String_Node_Str",getConfig(CASSANDRA_THRIFT_PORT))));
  tomcat=addChild(EntitySpec.create(TomcatServer.class).configure("String_Node_Str","String_Node_Str").configure("String_Node_Str",UsesJmx.JmxAgentModes.JMX_RMI_CUSTOM_AGENT).configure("String_Node_Str","String_Node_Str").configure("String_Node_Str","String_Node_Str").configure("String_Node_Str","String_Node_Str").configure("String_Node_Str",MutableMap.of("String_Node_Str","String_Node_Str")));
  ((EntityInternal)tomcat).getMutableEntityType().addEffector(cumulusConfig,new EffectorBody<Void>(){
    private HostAndPort clusterEndpoint;
    @Override public Void call(    ConfigBag parameters){
      String hostname=cassandra.getAttribute(CassandraCluster.HOSTNAME);
      Integer thriftPort=cassandra.getAttribute(CassandraCluster.THRIFT_PORT);
      HostAndPort currentEndpoint=HostAndPort.fromParts(hostname,thriftPort);
      if (!currentEndpoint.equals(clusterEndpoint)) {
        log.info("String_Node_Str",currentEndpoint.toString());
        clusterEndpoint=currentEndpoint;
        String url=Entities.getRequiredUrlConfig(CumulusRDFApplication.this,CUMULUS_RDF_CONFIG_URL);
        Map<String,Object> config=MutableMap.<String,Object>of("String_Node_Str",clusterEndpoint.getHostText(),"String_Node_Str",clusterEndpoint.getPort());
        String contents=TemplateProcessor.processTemplateContents(new ResourceUtils(this).getResourceAsString(url),config);
        DynamicTasks.queue(SshEffectorTasks.put("String_Node_Str").contents(contents));
      }
      return null;
    }
  }
);
  subscribe(cassandra,CassandraCluster.HOSTNAME,new SensorEventListener<String>(){
    @Override public void onEvent(    SensorEvent<String> event){
      tomcat.invoke(cumulusConfig,MutableMap.<String,Object>of());
      if (tomcat.getAttribute(Startable.SERVICE_UP)) {
        tomcat.restart();
      }
    }
  }
);
}