Buggy code:
@ Component ( immediate = true ) @ Service public class DeviceManager extends AbstractListenerProviderRegistry < DeviceEvent , DeviceListener , DeviceProvider , DeviceProviderService > implements DeviceAdminService , DeviceProviderRegistry , DeviceService { private static final String DEVICE_ID_NULL = "Device<seq2seq4repair_space>ID<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ; private static final String PORT_NUMBER_NULL = "Port<seq2seq4repair_space>number<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ; private static final String DEVICE_DESCRIPTION_NULL = "Device<seq2seq4repair_space>description<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ; private static final String PORT_DESCRIPTION_NULL = "Port<seq2seq4repair_space>description<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ; private static final String PORT_DESC_LIST_NULL = "Port<seq2seq4repair_space>description<seq2seq4repair_space>list<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ; private final Logger log = getLogger ( getClass ( ) ) ; private final DeviceStoreDelegate delegate = new DeviceManager . InternalStoreDelegate ( ) ; private final MastershipListener mastershipListener = new DeviceManager . InternalMastershipListener ( ) ; private NodeId localNodeId ; private ScheduledExecutorService backgroundService ; private final NetworkConfigListener networkConfigListener = new DeviceManager . InternalNetworkConfigListener ( ) ; @ Reference ( cardinality = ReferenceCardinality . MANDATORY_UNARY ) protected DeviceStore store ; @ Reference ( cardinality = ReferenceCardinality . MANDATORY_UNARY ) protected ClusterService clusterService ; @ Reference ( cardinality = ReferenceCardinality . MANDATORY_UNARY ) protected MastershipService mastershipService ; @ Reference ( cardinality = ReferenceCardinality . MANDATORY_UNARY ) protected MastershipTermService termService ; @ Reference ( cardinality = ReferenceCardinality . MANDATORY_UNARY ) protected NetworkConfigService networkConfigService ; @ Activate public void activate ( ) { } @ Deactivate public void deactivate ( ) { } @ Override public int getDeviceCount ( ) { } @ Override public Iterable < Device > getDevices ( ) { } @ Override public Iterable < Device > getAvailableDevices ( ) { } @ Override public Device getDevice ( DeviceId deviceId ) { } @ Override public MastershipRole getRole ( DeviceId deviceId ) { } @ Override public List < Port > getPorts ( DeviceId deviceId ) { } @ Override public List < PortStatistics > getPortStatistics ( DeviceId deviceId ) { } @ Override public List < PortStatistics > getPortDeltaStatistics ( DeviceId deviceId ) { } @ Override public Port getPort ( DeviceId deviceId , PortNumber portNumber ) { } @ Override public boolean isAvailable ( DeviceId deviceId ) { } private boolean isReachable ( DeviceId deviceId ) { } @ Override public void removeDevice ( DeviceId deviceId ) { } @ Override protected DeviceProviderService createProviderService ( DeviceProvider provider ) { } private void mastershipCheck ( ) { } private class InternalDeviceProviderService extends AbstractProviderService < DeviceProvider > implements DeviceProviderService { InternalDeviceProviderService ( DeviceProvider provider ) { } private boolean applyRole ( DeviceId deviceId , MastershipRole newRole ) { } @ Override public void deviceConnected ( DeviceId deviceId , DeviceDescription deviceDescription ) { } @ Override public void deviceDisconnected ( DeviceId deviceId ) { } @ Override public void updatePorts ( DeviceId deviceId , List < PortDescription > portDescriptions ) { } @ Override public void portStatusChanged ( DeviceId deviceId , PortDescription portDescription ) { } private PortDescription consolidate ( DeviceId did , PortDescription desc ) { } @ Override public void receivedRoleReply ( DeviceId deviceId , MastershipRole requested , MastershipRole response ) { } @ Override public void updatePortStatistics ( DeviceId deviceId , Collection < PortStatistics > portStatistics ) { } } private boolean isAllowed ( BasicDeviceConfig cfg ) { } private boolean applyRoleAndProbe ( DeviceId deviceId , MastershipRole newRole ) { } private void reassertRole ( final DeviceId did , final MastershipRole nextRole ) { } private void handleMastershipEvent ( MastershipEvent event ) { } private class InternalMastershipListener implements MastershipListener { @ Override public void event ( MastershipEvent event ) { } } private class InternalStoreDelegate implements DeviceStoreDelegate { @ Override public void notify ( DeviceEvent event ) { } } @ Override public Iterable < Device > getDevices ( Type type ) { } @ Override public Iterable < Device > getAvailableDevices ( Type type ) { } private class InternalNetworkConfigListener implements NetworkConfigListener { @ Override public boolean isRelevant ( NetworkConfigEvent event ) { } @ Override public void event ( NetworkConfigEvent event ) { DeviceEvent de = null ; if ( event . configClass ( ) . equals ( BasicDeviceConfig . class ) ) { <START_BUG> log . info ( "Detected<seq2seq4repair_space>Device<seq2seq4repair_space>network<seq2seq4repair_space>config<seq2seq4repair_space>event<seq2seq4repair_space>{}" , event . type ( ) ) ; <END_BUG> DeviceId did = ( ( DeviceId ) ( event . subject ( ) ) ) ; BasicDeviceConfig cfg = networkConfigService . getConfig ( did , BasicDeviceConfig . class ) ; if ( ! ( isAllowed ( cfg ) ) ) { kickOutBadDevice ( did ) ; } else { Device dev = getDevice ( did ) ; DeviceDescription desc = ( dev == null ) ? null : BasicDeviceOperator . descriptionOf ( dev ) ; desc = BasicDeviceOperator . combine ( cfg , desc ) ; if ( ( desc != null ) && ( ( getProvider ( did ) ) != null ) ) { de = store . createOrUpdateDevice ( getProvider ( did ) . id ( ) , did , desc ) ; } } } if ( event . configClass ( ) . equals ( OpticalPortConfig . class ) ) { ConnectPoint cpt = ( ( ConnectPoint ) ( event . subject ( ) ) ) ; DeviceId did = cpt . deviceId ( ) ; Port dpt = getPort ( did , cpt . port ( ) ) ; if ( dpt != null ) { OpticalPortConfig opc = networkConfigService . getConfig ( cpt , OpticalPortConfig . class ) ; PortDescription desc = OpticalPortOperator . descriptionOf ( dpt ) ; desc = OpticalPortOperator . combine ( opc , desc ) ; if ( ( desc != null ) && ( ( getProvider ( did ) ) != null ) ) { de = store . updatePortStatus ( getProvider ( did ) . id ( ) , did , desc ) ; } } } if ( de != null ) { post ( de ) ; } } private void kickOutBadDevice ( DeviceId deviceId ) { } } }

Fix:
log . debug ( "Detected<seq2seq4repair_space>device<seq2seq4repair_space>network<seq2seq4repair_space>config<seq2seq4repair_space>event<seq2seq4repair_space>{}" , event . type ( ) ) ;