Buggy code:
public class Metrics { private static final int REVISION = 7 ; private static final String BASE_URL = "http:////report.mcstats.org" ; private static final String REPORT_URL = "//plugin//%s" ; private static final int PING_INTERVAL = 15 ; private final Plugin plugin ; private final Set < Metrics . Graph > graphs = Collections . synchronizedSet ( new HashSet < Metrics . Graph > ( ) ) ; private final YamlConfiguration configuration ; private final File configurationFile ; private final String guid ; private final boolean debug ; private final Object optOutLock = new Object ( ) ; private volatile BukkitTask task = null ; public Metrics ( final Plugin plugin ) throws IOException { } public Metrics . Graph createGraph ( final String name ) { } public void addGraph ( final Metrics . Graph graph ) { } public boolean start ( ) { } public boolean isOptOut ( ) { } public void enable ( ) throws IOException { } public void disable ( ) throws IOException { } public File getConfigFile ( ) { } private void postPlugin ( final boolean isPing ) throws IOException { PluginDescriptionFile description = plugin . getDescription ( ) ; String pluginName = description . getName ( ) ; boolean onlineMode = Bukkit . getServer ( ) . getOnlineMode ( ) ; String pluginVersion = description . getVersion ( ) ; String serverVersion = Bukkit . getVersion ( ) ; <START_BUG> int playersOnline = Bukkit . getServer ( ) . getOnlinePlayers ( ) . length ; <END_BUG> StringBuilder json = new StringBuilder ( 1024 ) ; json . append ( '{' ) ; Metrics . appendJSONPair ( json , "guid" , guid ) ; Metrics . appendJSONPair ( json , "plugin_version" , pluginVersion ) ; Metrics . appendJSONPair ( json , "server_version" , serverVersion ) ; Metrics . appendJSONPair ( json , "players_online" , Integer . toString ( playersOnline ) ) ; String osname = System . getProperty ( "os.name" ) ; String osarch = System . getProperty ( "os.arch" ) ; String osversion = System . getProperty ( "os.version" ) ; String java_version = System . getProperty ( "java.version" ) ; int coreCount = Runtime . getRuntime ( ) . availableProcessors ( ) ; if ( osarch . equals ( "amd64" ) ) { osarch = "x86_64" ; } Metrics . appendJSONPair ( json , "osname" , osname ) ; Metrics . appendJSONPair ( json , "osarch" , osarch ) ; Metrics . appendJSONPair ( json , "osversion" , osversion ) ; Metrics . appendJSONPair ( json , "cores" , Integer . toString ( coreCount ) ) ; Metrics . appendJSONPair ( json , "auth_mode" , ( onlineMode ? "1" : "0" ) ) ; Metrics . appendJSONPair ( json , "java_version" , java_version ) ; if ( isPing ) { Metrics . appendJSONPair ( json , "ping" , "1" ) ; } if ( ( graphs . size ( ) ) > 0 ) { synchronized ( graphs ) { json . append ( ',' ) ; json . append ( '"' ) ; json . append ( "graphs" ) ; json . append ( '"' ) ; json . append ( ':' ) ; json . append ( '{' ) ; boolean firstGraph = true ; final Iterator < Metrics . Graph > iter = graphs . iterator ( ) ; while ( iter . hasNext ( ) ) { Metrics . Graph graph = iter . next ( ) ; StringBuilder graphJson = new StringBuilder ( ) ; graphJson . append ( '{' ) ; for ( Metrics . Plotter plotter : graph . getPlotters ( ) ) { Metrics . appendJSONPair ( graphJson , plotter . getColumnName ( ) , Integer . toString ( plotter . getValue ( ) ) ) ; } graphJson . append ( '}' ) ; if ( ! firstGraph ) { json . append ( ',' ) ; } json . append ( Metrics . escapeJSON ( graph . getName ( ) ) ) ; json . append ( ':' ) ; json . append ( graphJson ) ; firstGraph = false ; } json . append ( '}' ) ; } } json . append ( '}' ) ; URL url = new URL ( ( ( Metrics . BASE_URL ) + ( String . format ( Metrics . REPORT_URL , Metrics . urlEncode ( pluginName ) ) ) ) ) ; URLConnection connection ; if ( isMineshafterPresent ( ) ) { connection = url . openConnection ( Proxy . NO_PROXY ) ; } else { connection = url . openConnection ( ) ; } byte [ ] uncompressed = json . toString ( ) . getBytes ( ) ; byte [ ] compressed = Metrics . gzip ( json . toString ( ) ) ; connection . addRequestProperty ( "User-Agent" , ( "MCStats//" + ( Metrics . REVISION ) ) ) ; connection . addRequestProperty ( "Content-Type" , "application//json" ) ; connection . addRequestProperty ( "Content-Encoding" , "gzip" ) ; connection . addRequestProperty ( "Content-Length" , Integer . toString ( compressed . length ) ) ; connection . addRequestProperty ( "Accept" , "application//json" ) ; connection . addRequestProperty ( "Connection" , "close" ) ; connection . setDoOutput ( true ) ; if ( debug ) { System . out . println ( ( ( ( ( ( "[Metrics]<seq2seq4repair_space>Prepared<seq2seq4repair_space>request<seq2seq4repair_space>for<seq2seq4repair_space>" + pluginName ) + "<seq2seq4repair_space>uncompressed=" ) + ( uncompressed . length ) ) + "<seq2seq4repair_space>compressed=" ) + ( compressed . length ) ) ) ; } OutputStream os = connection . getOutputStream ( ) ; os . write ( compressed ) ; os . flush ( ) ; final BufferedReader reader = new BufferedReader ( new InputStreamReader ( connection . getInputStream ( ) ) ) ; String response = reader . readLine ( ) ; os . close ( ) ; reader . close ( ) ;

Fix:
int playersOnline = Bukkit . getServer ( ) . getOnlinePlayers ( ) . size ( ) ;