package org.commonjava.indy.subsys.honeycomb;

import com.datastax.driver.core.Session;
import org.commonjava.indy.subsys.cassandra.CassandraClient;
import org.commonjava.o11yphant.honeycomb.impl.CassandraConnectionRootSpanFields;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import java.util.Collections;
import java.util.Map;

@ApplicationScoped
public class IndyCassandraConnectionRootSpanFields
                extends CassandraConnectionRootSpanFields
{
    private CassandraClient cassandraClient;

    @Inject
    public IndyCassandraConnectionRootSpanFields( CassandraClient cassandraClient )
    {
        this.cassandraClient = cassandraClient;
    }

    @Override
    protected Map<String, Session> getSessions()
    {
        return Collections.unmodifiableMap( cassandraClient.getSessions() );
    }
}

@@ -487,16 +487,17 @@
 ields%0A%7B%0A
+%0A
     priv
@@ -504,39 +504,43 @@
 ate 
-CassandraClient cassandraClient
+final Map%3CString, Session%3E sessions
 ;%0A%0A 
@@ -657,41 +657,79 @@
 his.
-cassandraClient = cassandraClient
+sessions = Collections.unmodifiableMap( cassandraClient.getSessions() )
 ;%0A  
@@ -821,68 +821,16 @@
 urn 
-Collections.unmodifiableMap( cassandraClient.getS
+s
 essions
-() )
 ;%0A  

Fix NPE from IndyCassandraConnectionRootSpanFields constructor