Buggy code:
public class CassandraSink extends AbstractSink implements Configurable { private static final Logger log = LoggerFactory . getLogger ( CassandraSink . class ) ; private static final String DEFAULT_TABLE = "table_logs" ; private static final String DEFAULT_KEYSPACE = "keyspace_logs" ; private static final int DEFAULT_PORT = 9042 ; private static final String DEFAULT_CLUSTER = "TestCluster" ; private static final String DEFAULT_HOST = "localhost" ; private static final int DEFAULT_BATCH_SIZE = 100 ; private static final String DEFAULT_CONSISTENCY_LEVEL = "QUORUM" ; private static final String DEFAULT_DATE_FORMAT = null ; private static final String DEFAULT_ITEM_SEPARATOR = "," ; private static final String DEFAULT_MAP_VALUE_SEPARATOR = ";" ; private static final String DEFAULT_MAP_KEY_TYPE = "TEXT" ; private static final String DEFAULT_MAP_VALUE_TYPE = "INT" ; private static final String DEFAULT_LIST_VALUE_TYPE = "TEXT" ; private static final String CONF_TABLE = "table" ; private static final String CONF_PRIMARY_KEY = "primaryKey" ; private static final String CONF_KEYSPACE = "keyspace" ; private static final String CONF_PORT = "port" ; private static final String CONF_CLUSTER = "cluster" ; private static final String CONF_HOST = "host" ; private static final String CONF_USERNAME = "username" ; private static final String CONF_PASSWORD = "password" ; private static final String CONF_BATCH_SIZE = "batchSize" ; private static final String CONF_COLUMN_DEFINITION_FILE = "definitionFile" ; private static final String CONF_CONSISTENCY_LEVEL = "consistency" ; private static final String CONF_KEYSPACE_STATEMENT = "keyspaceStatement" ; private static final String CONF_TABLE_STATEMENT = "tableStatement" ; private static final String CONF_DATE_FORMAT = "dateFormat" ; private static final String CONF_ITEM_SEPARATOR = "itemSeparator" ; private static final String CONF_MAP_VALUE_SEPARATOR = "mapValueSeparator" ; private static final String CONF_MAP_KEY_TYPE = "mapKeyType" ; private static final String CONF_MAP_VALUE_TYPE = "mapValueType" ; private static final String CONF_LIST_VALUE_TYPE = "listValueType" ; private SinkCounter sinkCounter ; private CassandraRepository repository ; private int batchsize ; private EventParser parser ; private String dateFormat ; private String itemSeparator ; private String mapValueSeparator ; private String mapKeyType ; private String mapValueType ; private String listValueType ; public CassandraSink ( ) { } CassandraSink ( Channel channel , SinkCounter sinkCounter , CassandraRepository repository , int batchSize , EventParser parser ) { } @ Override public void configure ( Context context ) { String table = context . getString ( CassandraSink . CONF_TABLE , CassandraSink . DEFAULT_TABLE ) ; String host = context . getString ( CassandraSink . CONF_HOST , CassandraSink . DEFAULT_HOST ) ; String keyspace = context . getString ( CassandraSink . CONF_KEYSPACE , CassandraSink . DEFAULT_KEYSPACE ) ; int port = context . getInteger ( CassandraSink . CONF_PORT , CassandraSink . DEFAULT_PORT ) ; String username = context . getString ( CassandraSink . CONF_USERNAME ) ; String password = context . getString ( CassandraSink . CONF_PASSWORD ) ; String clusterName = context . getString ( CassandraSink . CONF_CLUSTER , CassandraSink . DEFAULT_CLUSTER ) ; String consistency = context . getString ( CassandraSink . CONF_CONSISTENCY_LEVEL , CassandraSink . DEFAULT_CONSISTENCY_LEVEL ) ; String columnDefinitionFile = context . getString ( CassandraSink . CONF_COLUMN_DEFINITION_FILE ) ; if ( ! ( Strings . isNullOrEmpty ( columnDefinitionFile ) ) ) { this . parser = new EventParser ( CassandraSink . readJsonFromFile ( new File ( columnDefinitionFile ) ) ) ; } ColumnDefinition definition = ( ( this . parser ) == null ) ? null : this . parser . getDefinition ( ) ; <START_BUG> if ( ( Strings . isNullOrEmpty ( username ) ) && ( Strings . isNullOrEmpty ( password ) ) ) { <END_BUG> this . repository = new CassandraRepository ( host , table , keyspace , port , clusterName , consistency , definition ) ; } else { this . repository = new CassandraRepository ( username , password , host , table , keyspace , port , clusterName , consistency , definition ) ; } setOptionalRepoConfiguration ( context ) ; this . batchsize = context . getInteger ( CassandraSink . CONF_BATCH_SIZE , CassandraSink . DEFAULT_BATCH_SIZE ) ; this . sinkCounter = new SinkCounter ( this . getName ( ) ) ; this . dateFormat = context . getString ( CassandraSink . CONF_DATE_FORMAT , CassandraSink . DEFAULT_DATE_FORMAT ) ; this . itemSeparator = context . getString ( CassandraSink . CONF_ITEM_SEPARATOR , CassandraSink . DEFAULT_ITEM_SEPARATOR ) ; this . mapValueSeparator = context . getString ( CassandraSink . CONF_MAP_VALUE_SEPARATOR , CassandraSink . DEFAULT_MAP_VALUE_SEPARATOR ) ; this . mapKeyType = context . getString ( CassandraSink . CONF_MAP_KEY_TYPE , CassandraSink . DEFAULT_MAP_KEY_TYPE ) ; this . mapValueType = context . getString ( CassandraSink . CONF_MAP_VALUE_TYPE , CassandraSink . DEFAULT_MAP_VALUE_TYPE ) ; this . listValueType = context . getString ( CassandraSink . CONF_LIST_VALUE_TYPE , CassandraSink . DEFAULT_LIST_VALUE_TYPE ) ; } private void setOptionalRepoConfiguration ( Context context ) { } @ Override public Status process ( ) throws EventDeliveryException { } @ Override public synchronized void start ( ) { } private ColumnDefinition getColumnDefinition ( TableMetadata tableMetadata ) { } @ Override public synchronized void stop ( ) { } CassandraRepository getRepository ( ) { } private List < Event > takeEventsFromChannel ( Channel channel , int eventsToTake ) { } private static final String readJsonFromFile ( File file ) { } }

Fix:
if ( ( Strings . isNullOrEmpty ( username ) ) || ( Strings . isNullOrEmpty ( password ) ) ) {