Buggy code:
final class SuspectEventProcessor implements Runnable { private static final Logger LOG = LoggerFactory . getLogger ( SuspectEventProcessor . class ) ; private static final String EVENT_SOURCE = "OpenNMS.Capsd" ; private static String SQL_RETRIEVE_INTERFACE_NODEID_PREFIX = "SELECT<seq2seq4repair_space>nodeId<seq2seq4repair_space>FROM<seq2seq4repair_space>ipinterface<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ; private static final String SQL_RETRIEVE_IPINTERFACES_ON_NODEID = "SELECT<seq2seq4repair_space>ipaddr<seq2seq4repair_space>FROM<seq2seq4repair_space>ipinterface<seq2seq4repair_space>WHERE<seq2seq4repair_space>nodeid<seq2seq4repair_space>=<seq2seq4repair_space>?<seq2seq4repair_space>and<seq2seq4repair_space>ismanaged<seq2seq4repair_space>!=<seq2seq4repair_space>'D'" ; String m_suspectIf ; private CapsdDbSyncer m_capsdDbSyncer ; private PluginManager m_pluginManager ; private static Set < String > m_queuedSuspectTracker ; SuspectEventProcessor ( CapsdDbSyncer capsdDbSyncer , PluginManager pluginManager , String ifAddress ) { } private DbNodeEntry getExistingNodeEntry ( Connection dbc , IfCollector collector ) throws SQLException { } private String getDuplicateIpaddress ( List < String > ipListA , List < String > ipListB ) { } private DbNodeEntry createNode ( Connection dbc , InetAddress ifaddr , IfCollector collector ) throws SQLException { InetAddress primaryIf = determinePrimaryInterface ( collector ) ; IfSnmpCollector snmpc = collector . getSnmpCollector ( ) ; IfSmbCollector smbc = collector . getSmbCollector ( ) ; DbNodeEntry entryNode = DbNodeEntry . create ( ) ; Date now = new Date ( ) ; entryNode . setCreationTime ( now ) ; entryNode . setLastPoll ( now ) ; entryNode . setNodeType ( ACTIVE ) ; entryNode . setLabel ( primaryIf . getHostName ( ) ) ; if ( entryNode . getLabel ( ) . equals ( str ( primaryIf ) ) ) entryNode . setLabelSource ( ADDRESS ) ; else entryNode . setLabelSource ( HOSTNAME ) ; if ( snmpc != null ) { if ( snmpc . hasSystemGroup ( ) ) { SystemGroup sysgrp = snmpc . getSystemGroup ( ) ; String sysObjectId = sysgrp . getSysObjectID ( ) ; if ( sysObjectId != null ) entryNode . setSystemOID ( sysObjectId ) ; else SuspectEventProcessor . LOG . warn ( "SuspectEventProcessor:<seq2seq4repair_space>{}<seq2seq4repair_space>has<seq2seq4repair_space>NO<seq2seq4repair_space>sysObjectId!!!!" , str ( ifaddr ) ) ; String str = sysgrp . getSysName ( ) ; SuspectEventProcessor . LOG . debug ( "SuspectEventProcessor:<seq2seq4repair_space>{}<seq2seq4repair_space>has<seq2seq4repair_space>sysName:<seq2seq4repair_space>{}" , str ( ifaddr ) , str ) ; <START_BUG> if ( ( str != null ) && ( ( str . length ( ) ) > 0 ) ) { <END_BUG> entryNode . setSystemName ( str ) ; if ( ( entryNode . getLabelSource ( ) ) == ( NodeLabelSource . ADDRESS ) ) { entryNode . setLabel ( str ) ; entryNode . setLabelSource ( SYSNAME ) ; } } str = sysgrp . getSysDescr ( ) ; SuspectEventProcessor . LOG . debug ( "SuspectEventProcessor:<seq2seq4repair_space>{}<seq2seq4repair_space>has<seq2seq4repair_space>sysDescription:<seq2seq4repair_space>{}" , str ( ifaddr ) , str ) ; if ( ( str != null ) && ( ( str . length ( ) ) > 0 ) ) entryNode . setSystemDescription ( str ) ; str = sysgrp . getSysLocation ( ) ; SuspectEventProcessor . LOG . debug ( "SuspectEventProcessor:<seq2seq4repair_space>{}<seq2seq4repair_space>has<seq2seq4repair_space>sysLocation:<seq2seq4repair_space>{}" , str ( ifaddr ) , str ) ; if ( ( str != null ) && ( ( str . length ( ) ) > 0 ) ) entryNode . setSystemLocation ( str ) ; str = sysgrp . getSysContact ( ) ; SuspectEventProcessor . LOG . debug ( "SuspectEventProcessor:<seq2seq4repair_space>{}<seq2seq4repair_space>has<seq2seq4repair_space>sysContact:<seq2seq4repair_space>{}" , str ( ifaddr ) , str ) ; if ( ( str != null ) && ( ( str . length ( ) ) > 0 ) ) entryNode . setSystemContact ( str ) ; } } if ( smbc != null ) { if ( ( ( smbc . getNbtName ( ) ) != null ) && ( ( entryNode . getLabelSource ( ) ) != ( NodeLabelSource . HOSTNAME ) ) ) { entryNode . setLabel ( smbc . getNbtName ( ) ) ; entryNode . setLabelSource ( NETBIOS ) ; entryNode . setNetBIOSName ( entryNode . getLabel ( ) ) ; if ( ( smbc . getDomainName ( ) ) != null ) { entryNode . setDomainName ( smbc . getDomainName ( ) ) ; } } } entryNode . store ( dbc ) ; return entryNode ; } private void addInterfaces ( Connection dbc , DbNodeEntry node , boolean useExistingNode , InetAddress ifaddr , IfCollector collector ) throws SQLException { } private int addSnmpInterfaces ( Connection dbc , InetAddress ifaddr , int nodeId , IfCollector collector , DbIpInterfaceEntry ipIfEntry ) throws SQLException { } private Package getPackageForNewInterface ( Connection dbc , InetAddress ifaddr , DbIpInterfaceEntry ipIfEntry , boolean addrUnmanaged ) throws SQLException { } private int getIfIndexForNewInterface ( Connection dbc , InetAddress ifaddr , IfCollector collector , DbIpInterfaceEntry ipIfEntry ) throws SQLException { } private void getSubInterfacesForNewInterface ( Connection dbc , DbNodeEntry node , InetAddress ifaddr , IfCollector collector , Date now , int nodeId , int ifIndex ) throws SQLException { } private void addSubIpInterfaces ( Connection dbc , DbNodeEntry node , IfCollector collector , Date now , int nodeId , CapsdConfig cFactory , PollerConfig pollerCfgFactory , IfSnmpCollector snmpc ) throws SQLException { } private boolean addIfTableSnmpInterfaces ( Connection dbc , InetAddress ifaddr , int nodeId , IfCollector collector ) throws SQLException { } private long getInterfaceSpeed ( IfTableEntry ifte , IfXTableEntry ifxte ) { } private void addSupportedProtocols ( DbNodeEntry node , InetAddress ifaddr , List < SupportedProtocol > protocols , boolean addrUnmanaged , int ifIndex , Package ipPkg ) throws SQLException { } private boolean isServicePolled ( String ifAddr , String svcName , Package ipPkg ) { } private boolean isServicePolledLocally ( String ifAddr , String svcName , Package ipPkg ) { } static boolean supportsSnmp ( List < SupportedProtocol > supportedProtocols ) { } static boolean hasIfIndex ( InetAddress ipaddr , IfSnmpCollector snmpc ) { } static int getIfType ( InetAddress ipaddr , IfSnmpCollector snmpc ) { } static InetAddress compareAndSelectPrimary ( InetAddress currentIf , InetAddress oldPrimary ) { } private List < InetAddress > buildLBSnmpAddressList ( IfCollector collector ) { } private List < InetAddress > buildSnmpAddressList ( IfCollector collector ) { } private InetAddress determinePrimaryInterface ( IfCollector collector ) { } @ Override public void run ( ) { } List < InetAddress > getPrimarySnmpInterfaceFromDb ( Connection dbc , DbNodeEntry node ) throws SQLException { }

Fix:
if ( ( str != null ) && ( ! ( "" . equals ( str . trim ( ) ) ) ) ) {