Buggy code:
public class MuninNode { private String str_nodename ; private String str_hostname = "unset" ; private int i_port = 4949 ; private String str_group ; private boolean b_isRunning = false ; private long l_lastFrontendQuery ; private String str_muninVersion = "" ; private transient CopyOnWriteArrayList < MuninPlugin > v_loaded_plugins ; private int i_GraphCount = 0 ; private int i_lastRun = 0 ; private Integer node_id = 0 ; private Integer user_id = 0 ; private int queryInterval = 0 ; private int last_plugin_load = 0 ; private boolean is_init = false ; private transient Socket lastSocket ; private String str_via = "unset" ; public void setQueryInterval ( Integer p_int ) { } public int getQueryInterval ( ) { } public int getGraphCount ( ) { } public String getHostname ( ) { } public void setHostname ( String str_hostname ) { } public int getPort ( ) { } public void setPort ( int i_port ) { } public String getNodename ( ) { } public void setNodename ( String str_nodename ) { } public String getGroup ( ) { } public void setGroup ( String str_group ) { } public boolean isRunning ( ) { } public void setIsRunning ( boolean p_isRunning ) { } public CopyOnWriteArrayList < MuninPlugin > getPluginList ( ) { } public boolean loadPlugins ( ) { } public void run ( ) { b_isRunning = true ; if ( this . str_via . equals ( "unset" ) ) { muninmxcd . logger . info ( ( ( getHostname ( ) ) + "<seq2seq4repair_space>Monitoring<seq2seq4repair_space>job<seq2seq4repair_space>started" ) ) ; } else { muninmxcd . logger . info ( ( ( ( ( getHostname ( ) ) + "<seq2seq4repair_space>(VIA:<seq2seq4repair_space>" ) + ( this . str_via ) ) + ")<seq2seq4repair_space>Monitoring<seq2seq4repair_space>job<seq2seq4repair_space>started" ) ) ; } int iCurTime = getUnixtime ( ) ; int iPluginRefreshTime = ( last_plugin_load ) + 86400 ; try { <START_BUG> if ( ( getPluginList ( ) . size ( ) ) > 1 ) { <END_BUG> if ( ! ( is_init ) ) { muninmxcd . logger . info ( ( ( "[Job:<seq2seq4repair_space>" + ( getHostname ( ) ) ) + "]<seq2seq4repair_space>Updating<seq2seq4repair_space>Database" ) ) ; for ( MuninPlugin it_pl : getPluginList ( ) ) { if ( ( it_pl . getGraphs ( ) . size ( ) ) > 0 ) { dbUpdatePluginForNode ( getNode_id ( ) , it_pl ) ; } } dbDeleteMissingPlugins ( getNode_id ( ) , getPluginList ( ) ) ; muninmxcd . logger . info ( ( ( "[Job:<seq2seq4repair_space>" + ( getHostname ( ) ) ) + "]<seq2seq4repair_space>Databaseupdate<seq2seq4repair_space>Done" ) ) ; is_init = true ; } else { if ( iCurTime > iPluginRefreshTime ) { muninmxcd . logger . info ( ( "Refreshing<seq2seq4repair_space>Plugins<seq2seq4repair_space>on<seq2seq4repair_space>" + ( this . getHostname ( ) ) ) ) ; this . loadPlugins ( ) ; dbUpdateAllPluginsForNode ( this ) ; } } } else { this . loadPlugins ( ) ; } Socket clientSocket = new Socket ( ) ; clientSocket . setSoTimeout ( 30000 ) ; clientSocket . setKeepAlive ( false ) ; clientSocket . setReuseAddress ( false ) ; if ( this . str_via . equals ( "unset" ) ) { clientSocket . connect ( new InetSocketAddress ( this . getHostname ( ) , this . getPort ( ) ) , 30000 ) ; } else { clientSocket . connect ( new InetSocketAddress ( this . getStr_via ( ) , this . getPort ( ) ) , 30000 ) ; } lastSocket = clientSocket ; SocketCheck sc = new SocketCheck ( clientSocket , getUnixtime ( ) ) ; if ( muninmxcd . p . getProperty ( "kill.sockets" ) . equals ( "true" ) ) { sc . setHostname ( this . getHostname ( ) ) ; v_sockets . add ( sc ) ; } this . i_lastRun = getUnixtime ( ) ; Iterator it = this . getLoadedPlugins ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { MuninPlugin l_mp = ( ( MuninPlugin ) ( it . next ( ) ) ) ; if ( muninmxcd . logMore ) { muninmxcd . logger . info ( ( ( ( getHostname ( ) ) + "<seq2seq4repair_space>fetching<seq2seq4repair_space>graphs<seq2seq4repair_space>for<seq2seq4repair_space>" ) + ( l_mp . getPluginName ( ) . toUpperCase ( ) ) ) ) ; } l_mp . updateAllGraps ( this . getHostname ( ) , this . getPort ( ) , clientSocket , getQueryInterval ( ) ) ; queuePluginFetch ( l_mp . returnAllGraphs ( ) , l_mp . getPluginName ( ) ) ; } clientSocket . close ( ) ; if ( muninmxcd . p . getProperty ( "kill.sockets" ) . equals ( "true" ) ) { v_sockets . remove ( sc ) ; } sc = null ; } catch ( Exception ex ) { muninmxcd . logger . fatal ( ( ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>thread<seq2seq4repair_space>for<seq2seq4repair_space>host:<seq2seq4repair_space>" + ( getHostname ( ) ) ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( ex . getLocalizedMessage ( ) ) ) ) ; ex . printStackTrace ( ) ; } int iRunTime = ( getUnixtime ( ) ) - iCurTime ; dbUpdateLastContact ( this . getNode_id ( ) ) ; muninmxcd . logger . info ( ( ( ( getHostname ( ) ) + "<seq2seq4repair_space>Monitoring<seq2seq4repair_space>job<seq2seq4repair_space>stopped<seq2seq4repair_space>-<seq2seq4repair_space>runtime:<seq2seq4repair_space>" ) + iRunTime ) ) ; } private void queuePluginFetch ( ArrayList < MuninGraph > p_almg , String p_strPluginName ) { } public CopyOnWriteArrayList < MuninPlugin > getLoadedPlugins ( ) { } public void setLoadedPlugins ( CopyOnWriteArrayList < MuninPlugin > v_loaded_plugins ) { } public long getLastFrontendQuery ( ) { } public void setLastFrontendQuery ( long l_lastFrontendQuery ) { } public void setLastFrontendQuery ( ) { } private void cleanUpGraphs ( ) { } public Integer getNode_id ( ) { } public void setNode_id ( Integer node_id ) { } public Integer getUser_id ( ) { } public void setUser_id ( Integer user_id ) { } public Socket getLastSocket ( ) { } public String getStr_via ( ) { } public void setStr_via ( String str_via ) { } }

Fix:
if ( ( getPluginList ( ) . size ( ) ) > 0 ) {