Buggy code:
public class BukkitMetrics { 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 < BukkitMetrics . Graph > graphs = Collections . synchronizedSet ( new HashSet < BukkitMetrics . 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 BukkitMetrics ( final Plugin plugin ) throws IOException { } public BukkitMetrics . Graph createGraph ( final String name ) { } public void addGraph ( final BukkitMetrics . 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 ( '{' ) ; BukkitMetrics . appendJSONPair ( json , "guid" , guid ) ; BukkitMetrics . appendJSONPair ( json , "plugin_version" , pluginVersion ) ; BukkitMetrics . appendJSONPair ( json , "server_version" , serverVersion ) ; BukkitMetrics . 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" ; } BukkitMetrics . appendJSONPair ( json , "osname" , osname ) ; BukkitMetrics . appendJSONPair ( json , "osarch" , osarch ) ; BukkitMetrics . appendJSONPair ( json , "osversion" , osversion ) ; BukkitMetrics . appendJSONPair ( json , "cores" , Integer . toString ( coreCount ) ) ; BukkitMetrics . appendJSONPair ( json , "auth_mode" , ( onlineMode ? "1" : "0" ) ) ; BukkitMetrics . appendJSONPair ( json , "java_version" , java_version ) ; if ( isPing ) { BukkitMetrics . 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 < BukkitMetrics . Graph > iter = graphs . iterator ( ) ; while ( iter . hasNext ( ) ) { BukkitMetrics . Graph graph = iter . next ( ) ; StringBuilder graphJson = new StringBuilder ( ) ; graphJson . append ( '{' ) ; for ( BukkitMetrics . Plotter plotter : graph . getPlotters ( ) ) { BukkitMetrics . appendJSONPair ( graphJson , plotter . getColumnName ( ) , Integer . toString ( plotter . getValue ( ) ) ) ; } graphJson . append ( '}' ) ; if ( ! firstGraph ) { json . append ( ',' ) ; } json . append ( BukkitMetrics . escapeJSON ( graph . getName ( ) ) ) ; json . append ( ':' ) ; json . append ( graphJson ) ; firstGraph = false ; } json . append ( '}' ) ; } } json . append ( '}' ) ; URL url = new URL ( ( ( BukkitMetrics . BASE_URL ) + ( String . format ( BukkitMetrics . REPORT_URL , BukkitMetrics . urlEncode ( pluginName ) ) ) ) ) ; URLConnection connection ; if ( isMineshafterPresent ( ) ) { connection = url . openConnection ( Proxy . NO_PROXY ) ; } else { connection = url . openConnection ( ) ; } byte [ ] uncompressed = json . toString ( ) . getBytes ( ) ; byte [ ] compressed = BukkitMetrics . gzip ( json . toString ( ) ) ; connection . addRequestProperty ( "User-Agent" , ( "MCStats//" + ( BukkitMetrics . 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 ( ) ;