Buggy code:
private static int statsdUdpListenerPort_ = ApplicationConfiguration . VALUE_NOT_SET_CODE ; private static boolean graphiteAggregatorTcpListenerEnabled_ = false ; private static int graphiteAggregatorTcpListenerPort_ = ApplicationConfiguration . VALUE_NOT_SET_CODE ; private static boolean graphiteAggregatorUdpListenerEnabled_ = false ; private static int graphiteAggregatorUdpListenerPort_ = ApplicationConfiguration . VALUE_NOT_SET_CODE ; private static boolean graphitePassthroughTcpListenerEnabled_ = false ; private static int graphitePassthroughTcpListenerPort_ = ApplicationConfiguration . VALUE_NOT_SET_CODE ; private static boolean graphitePassthroughUdpListenerEnabled_ = false ; private static int graphitePassthroughUdpListenerPort_ = ApplicationConfiguration . VALUE_NOT_SET_CODE ; private static boolean openTsdbTcpTelnetListenerEnabled_ = false ; private static int openTsdbTcpTelnetListenerPort_ = ApplicationConfiguration . VALUE_NOT_SET_CODE ; private static boolean globalMetricNamePrefixEnabled_ = false ; private static String globalMetricNamePrefixValue_ = null ; private static String globalAggregatedMetricsSeparatorString_ = null ; private static boolean statsdMetricNamePrefixEnabled_ = false ; private static String statsdMetricNamePrefixValue_ = null ; private static boolean statsdMetricNameSuffixEnabled_ = false ; private static String statsdMetricNameSuffixValue_ = null ; private static boolean statsdCounterMetricNamePrefixEnabled_ = false ; private static String statsdCounterMetricNamePrefixValue_ = null ; private static boolean statsdGaugeMetricNamePrefixEnabled_ = false ; private static String statsdGaugeMetricNamePrefixValue_ = null ; private static boolean statsdTimerMetricNamePrefixEnabled_ = false ; private static String statsdTimerMetricNamePrefixValue_ = null ; private static boolean statsdSetMetricNamePrefixEnabled_ = false ; private static String statsdSetMetricNamePrefixValue_ = null ; private static boolean graphiteAggregatorMetricNamePrefixEnabled_ = false ; private static String graphiteAggregatorMetricNamePrefixValue_ = null ; private static boolean graphitePassthroughMetricNamePrefixEnabled_ = false ; private static String graphitePassthroughMetricNamePrefixValue_ = null ; private static boolean openTsdbMetricNamePrefixEnabled_ = false ; private static String openTsdbMetricNamePrefixValue_ = null ; private static boolean statsdCounterSendZeroOnInactive_ = false ; private static boolean statsdTimerSendZeroOnInactive_ = false ; private static boolean statsdGaugeSendPreviousValue_ = false ; private static boolean statsdSetSendZeroOnInactive_ = false ; private static boolean graphiteAggregatorSendPreviousValue_ = false ; private static boolean graphitePassthroughSendPreviousValue_ = false ; private static boolean openTsdbSendPreviousValue_ = false ; private static StatsdNthPercentiles statsdNthPercentiles_ = null ; private static boolean statsdUseLegacyNameSpacing_ = false ; private static boolean alertRoutineEnabled_ = false ; private static int alertRoutineInterval_ = ApplicationConfiguration . VALUE_NOT_SET_CODE ; private static boolean alertSendEmailEnabled_ = false ; private static int alertMaxMetricsInEmail_ = ApplicationConfiguration . VALUE_NOT_SET_CODE ; private static boolean alertOutputAlertStatusToGraphite_ = false ; private static String alertOutputAlertStatusToGraphiteMetricPrefix_ = null ; private static String alertStatsAggLocation_ = null ; private static long alertWaitTimeAfterRestart_ = ApplicationConfiguration . VALUE_NOT_SET_CODE ; private static String alertSmtpHost_ = null ; private static int alertSmtpPort_ = ApplicationConfiguration . VALUE_NOT_SET_CODE ; private static String alertSmtpUsername_ = null ; private static String alertSmtpPassword_ = null ; private static int alertSmtpConnectionTimeout_ = ApplicationConfiguration . VALUE_NOT_SET_CODE ; private static boolean alertSmtpUseSslTls_ = false ; private static boolean alertSmtpUseStartTls_ = false ; private static String alertSmtpFromAddress_ = null ; private static String alertSmtpFromName_ = null ; private static final List < HttpLink > customActionUrls_ = new ArrayList < > ( ) ; public static boolean initialize ( InputStream configurationInputStream , boolean isUsingDefaultSettings ) { } private static boolean setApplicationConfigurationValues ( ) { } private static List < GraphiteOutputModule > readGraphiteOutputModules ( ) { List < GraphiteOutputModule > graphiteOutputModules = new ArrayList < > ( ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { String graphiteOutputModuleKey = "graphite_output_module_" + ( i + 1 ) ; String graphiteOutputModuleValue = ApplicationConfiguration . applicationConfiguration_ . getString ( graphiteOutputModuleKey , null ) ; if ( graphiteOutputModuleValue == null ) continue ; try { CSVReader reader = new CSVReader ( new StringReader ( graphiteOutputModuleValue ) ) ; List < String [ ] > csvValuesArray = reader . readAll ( ) ; if ( ( ( csvValuesArray != null ) && ( ! ( csvValuesArray . isEmpty ( ) ) ) ) && ( ( csvValuesArray . get ( 0 ) ) != null ) ) { String [ ] csvValues = csvValuesArray . get ( 0 ) ; if ( ( csvValues . length ) >= 4 ) { boolean isOutputEnabled = Boolean . valueOf ( csvValues [ 0 ] ) ; String host = csvValues [ 1 ] ; int port = Integer . valueOf ( csvValues [ 2 ] ) ; int numSendRetryAttempts = Integer . valueOf ( csvValues [ 3 ] ) ; <START_BUG> int maxMetricsPerMessage = 100 ; <END_BUG> if ( ( csvValues . length ) > 4 ) maxMetricsPerMessage = Integer . valueOf ( csvValues [ 4 ] ) ; GraphiteOutputModule graphiteOutputModule = new GraphiteOutputModule ( isOutputEnabled , host , port , numSendRetryAttempts , maxMetricsPerMessage ) ; graphiteOutputModules . add ( graphiteOutputModule ) ; } } } catch ( Exception e ) { ApplicationConfiguration . logger . error ( ( ( ( e . toString ( ) ) + ( System . lineSeparator ( ) ) ) + ( StackTrace . getStringFromStackTrace ( e ) ) ) ) ; } } return graphiteOutputModules ; } private static List < OpenTsdbTelnetOutputModule > readOpenTsdbTelnetOutputModules ( ) { } private static List < OpenTsdbHttpOutputModule > readOpenTsdbHttpOutputModules ( ) { } private static List < HttpLink > readCustomActionUrls ( ) { } public static boolean isUsingDefaultSettings ( ) { } public static PropertiesConfiguration getApplicationConfiguration ( ) { } public static int getFlushTimeAgg ( ) { } public static boolean isDebugModeEnabled ( ) { } public static List < GraphiteOutputModule > getGraphiteOutputModules ( ) { } public static List < OpenTsdbTelnetOutputModule > getOpenTsdbTelnetOutputModules ( ) { } public static List < OpenTsdbHttpOutputModule > getOpenTsdbHttpOutputModules ( ) { } public static boolean isStatsdTcpListenerEnabled ( ) { } public static int getStatsdTcpListenerPort ( ) { } public static boolean isStatsdUdpListenerEnabled ( ) { } public static int getStatsdUdpListenerPort ( ) { } public static boolean isGraphiteAggregatorTcpListenerEnabled ( ) { } public static int getGraphiteAggregatorTcpListenerPort ( ) { } public static boolean isGraphiteAggregatorUdpListenerEnabled ( ) { } public static int getGraphiteAggregatorUdpListenerPort ( ) { } public static boolean isGraphitePassthroughTcpListenerEnabled ( ) { } public static int getGraphitePassthroughTcpListenerPort ( ) { } public static boolean isGraphitePassthroughUdpListenerEnabled ( ) { } public static int getGraphitePassthroughUdpListenerPort ( ) { } public static boolean isOpenTsdbTcpTelnetListenerEnabled ( ) { } public static int getOpenTsdbTcpTelnetListenerPort ( ) { } public static boolean isGlobalMetricNamePrefixEnabled ( ) { } public static String getGlobalMetricNamePrefixValue ( ) { }

Fix:
int maxMetricsPerMessage = 1000 ;