Buggy code:
public class Metrics { private static final int REVISION = 6 ; private static final String BASE_URL = "http:////mcstats.org" ; private static final String REPORT_URL = "//report//%s" ; private static final String CUSTOM_DATA_SEPARATOR = "~~" ; private static final int PING_INTERVAL = 10 ; private final Plugin plugin ; private final Set < Metrics . Graph > graphs = Collections . synchronizedSet ( new HashSet < Metrics . Graph > ( ) ) ; private final Metrics . Graph defaultGraph = new Metrics . Graph ( "Default" ) ; 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 void addCustomData ( final Metrics . Plotter plotter ) { } 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> final StringBuilder data = new StringBuilder ( ) ; data . append ( Metrics . encode ( "guid" ) ) . append ( '=' ) . append ( Metrics . encode ( guid ) ) ; Metrics . encodeDataPair ( data , "version" , pluginVersion ) ; Metrics . encodeDataPair ( data , "server" , serverVersion ) ; Metrics . encodeDataPair ( data , "players" , Integer . toString ( playersOnline ) ) ; Metrics . encodeDataPair ( data , "revision" , String . valueOf ( Metrics . REVISION ) ) ; 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 . encodeDataPair ( data , "osname" , osname ) ; Metrics . encodeDataPair ( data , "osarch" , osarch ) ; Metrics . encodeDataPair ( data , "osversion" , osversion ) ; Metrics . encodeDataPair ( data , "cores" , Integer . toString ( coreCount ) ) ; Metrics . encodeDataPair ( data , "online-mode" , Boolean . toString ( onlineMode ) ) ; Metrics . encodeDataPair ( data , "java_version" , java_version ) ; if ( isPing ) { Metrics . encodeDataPair ( data , "ping" , "true" ) ; } synchronized ( graphs ) { final Iterator < Metrics . Graph > iter = graphs . iterator ( ) ; while ( iter . hasNext ( ) ) { final Metrics . Graph graph = iter . next ( ) ; for ( Metrics . Plotter plotter : graph . getPlotters ( ) ) { final String key = String . format ( "C%s%s%s%s" , Metrics . CUSTOM_DATA_SEPARATOR , graph . getName ( ) , Metrics . CUSTOM_DATA_SEPARATOR , plotter . getColumnName ( ) ) ; final String value = Integer . toString ( plotter . getValue ( ) ) ; Metrics . encodeDataPair ( data , key , value ) ; } } } URL url = new URL ( ( ( Metrics . BASE_URL ) + ( String . format ( Metrics . REPORT_URL , Metrics . encode ( pluginName ) ) ) ) ) ; URLConnection connection ; if ( isMineshafterPresent ( ) ) { connection = url . openConnection ( Proxy . NO_PROXY ) ; } else { connection = url . openConnection ( ) ; } connection . setDoOutput ( true ) ; final OutputStreamWriter writer = new OutputStreamWriter ( connection . getOutputStream ( ) ) ; writer . write ( data . toString ( ) ) ; writer . flush ( ) ; final BufferedReader reader = new BufferedReader ( new InputStreamReader ( connection . getInputStream ( ) ) ) ; final String response = reader . readLine ( ) ; writer . close ( ) ; reader . close ( ) ; if ( ( response == null ) || ( response . startsWith ( "ERR" ) ) ) { throw new IOException ( response ) ; } else { if ( response . contains ( "OK<seq2seq4repair_space>This<seq2seq4repair_space>is<seq2seq4repair_space>your<seq2seq4repair_space>first<seq2seq4repair_space>update<seq2seq4repair_space>this<seq2seq4repair_space>hour" ) ) { synchronized ( graphs ) { final Iterator < Metrics . Graph > iter = graphs . iterator ( ) ; while ( iter . hasNext ( ) ) { final Metrics . Graph graph = iter . next ( ) ; for ( Metrics . Plotter plotter : graph . getPlotters ( ) ) { plotter . reset ( ) ; } } } } } } private boolean isMineshafterPresent ( ) { } private static void encodeDataPair ( final StringBuilder buffer , final String key , final String value ) throws UnsupportedEncodingException { } private static String encode ( final String text ) throws UnsupportedEncodingException { } public static class Graph { private final String name ; private final Set < Metrics . Plotter > plotters = new LinkedHashSet < Metrics . Plotter > ( ) ; private Graph ( final String name ) { } public String getName ( ) { }

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