Buggy code:
public class CustomFXMDataCollectorImpl implements Agent , ASPPropertyListener , CustomFXMDataCollectorCollectors { public static final String FXM_CUSTOM_MODEL_NAME = "FXMCustomModel" ; private final Logger mLogger ; private final RegistrationService mRegistrationService ; private final CustomFXMDataCollectorSupportBundle mBundle ; private final CustomFXMDataCollectorDataProvider mDataProvider ; private CustomFXMDataCollectorPropertyWrapper mProperties ; private TopologySubmitter3 mSubmitter ; private UnitService mUnitService ; private TimestampService mTimestampService ; public CustomFXMDataCollectorImpl ( ServiceFactory serviceFactory ) throws ServiceNotAvailableException { } CustomFXMDataCollectorImpl ( ServiceFactory serviceFactory , CustomFXMDataCollectorDataProvider dataProvider ) throws ServiceNotAvailableException { } @ Override public void destroy ( ) { } @ Override public void startDataCollection ( ) { } @ Override public void stopDataCollection ( ) { } public void propertiesChanged ( ) { } @ Override public void collectFrequentDownloads ( long collectionFreqInMs ) { mLogger . debug ( "Collect<seq2seq4repair_space>Frequent<seq2seq4repair_space>Downloads<seq2seq4repair_space>collector<seq2seq4repair_space>invoked" ) ; mLogger . debug ( ( "SampleFreq:" + collectionFreqInMs ) ) ; Connection connect = null ; try { Class . forName ( "com.mysql.jdbc.Driver" ) ; connect = DriverManager . getConnection ( ( ( ( ( ( ( ( ( "jdbc:mysql:////" + ( mProperties . getFxmHostname ( ) ) ) + ":" ) + ( mProperties . getFxmPort ( ) ) ) + "//UserSession?" ) + "user=" ) + ( mProperties . getUserName ( ) ) ) + "&password=" ) + ( mProperties . getPassword ( ) ) ) ) ; mLogger . debug ( "Connection<seq2seq4repair_space>established<seq2seq4repair_space>!" ) ; Statement statement = connect . createStatement ( ) ; PreparedStatement preparedStatement = connect . prepareStatement ( ( "select<seq2seq4repair_space>s.ClientIP<seq2seq4repair_space>saugerip,<seq2seq4repair_space>u.Count<seq2seq4repair_space>anzahl<seq2seq4repair_space>" + ( ( "from<seq2seq4repair_space>Session<seq2seq4repair_space>s,<seq2seq4repair_space>UserSessionValueCount<seq2seq4repair_space>u<seq2seq4repair_space>" + "where<seq2seq4repair_space>s.ResourceID<seq2seq4repair_space>=<seq2seq4repair_space>u.ResourceID<seq2seq4repair_space>and<seq2seq4repair_space>s.UserAgent<seq2seq4repair_space>not<seq2seq4repair_space>like<seq2seq4repair_space>'%bot%'<seq2seq4repair_space>and<seq2seq4repair_space>u.Count<seq2seq4repair_space>><seq2seq4repair_space>?<seq2seq4repair_space>" ) + "order<seq2seq4repair_space>by<seq2seq4repair_space>u.Count<seq2seq4repair_space>desc<seq2seq4repair_space>limit<seq2seq4repair_space>?;" ) ) ) ; preparedStatement . setInt ( 1 , mProperties . getLowLimit ( ) ) ; preparedStatement . setInt ( 2 , mProperties . getNumSessions ( ) ) ; ResultSet resultSet = preparedStatement . executeQuery ( ) ; mLogger . debug ( ( "Result<seq2seq4repair_space>:" + ( resultSet . toString ( ) ) ) ) ; CustomFXMCollection collection = new CustomFXMCollection ( mProperties . getFxmHostname ( ) , new CustomFXMCollectionRoot ( CustomFXMDataCollectorImpl . FXM_CUSTOM_MODEL_NAME ) ) ; <START_BUG> CustomFXMFrequentHitSessions frequentHits = new CustomFXMFrequentHitSessions ( ) ; <END_BUG> collection . setFrequentHits ( frequentHits ) ; List < TopHitSessionsEntry > sessions = frequentHits . getTopHitSessions ( ) ; resultSet . beforeFirst ( ) ; int i = 1 ; while ( resultSet . next ( ) ) { System . out . println ( ( ( ( ( i + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( resultSet . getString ( 1 ) ) ) + "<seq2seq4repair_space>,<seq2seq4repair_space>" ) + ( resultSet . getString ( 2 ) ) ) ) ; i ++ ; TopHitSessionsEntry entry = new TopHitSessionsEntry ( resultSet . getString ( 1 ) ) ; entry . setHits ( resultSet . getLong ( 2 ) ) ; sessions . add ( entry ) ; } collection . submit ( mSubmitter , mUnitService , collectionFreqInMs , mTimestampService . getCorrectedTimestamp ( ) . getTimeInMillis ( ) ) ; connect . close ( ) ; } catch ( ClassNotFoundException e ) { mLogger . errorUnexpected ( "noDriver" , e ) ; } catch ( SQLException e ) { mLogger . errorUnexpected ( "sqlException" , e ) ; } catch ( TopologyException e ) { mLogger . errorUnexpected ( "TopologyException" , e ) ; } finally { if ( connect != null ) try { connect . close ( ) ; } catch ( SQLException e ) { } } } No newline ; at end ; of file ; }

Fix:
CustomFXMFrequentHitSessions frequentHits = new CustomFXMFrequentHitSessions ( collection ) ;