Buggy code:
private Hashtable < Integer , Ally > mAllies = null ; private Hashtable < Integer , Tribe > mTribes = null ; private Hashtable < String , Ally > mAlliesByName = null ; private Hashtable < String , Ally > mAlliesByTagName = null ; private Hashtable < String , Tribe > mTribesByName = null ; private List < UnitHolder > mUnits = null ; private Hashtable < String , UnitHolder > mUnitsByName = null ; private List < DataHolderListener > mListeners = null ; private boolean bAborted = false ; private static DataHolder SINGLETON = null ; private boolean loading = false ; private int currentBonusType = 0 ; private boolean DATA_VALID = false ; public static synchronized DataHolder getSingleton ( ) { } DataHolder ( ) { } private void initialize ( ) { } public boolean isDataValid ( ) { } public long getDataAge ( ) { } public synchronized void addDataHolderListener ( DataHolderListener pListener ) { } public synchronized void removeDataHolderListener ( DataHolderListener pListener ) { } public String getDataDirectory ( ) { } public int getCurrentBonusType ( ) { } public boolean isDataAvailable ( String pServerId ) { } public boolean isDataAvailable ( ) { } public boolean serverSupported ( ) { } public boolean loadData ( boolean pReload ) { } public boolean loadLiveData ( ) { } public boolean isLoading ( ) { } private boolean createLocalDataCopy ( String pServerDir ) { } public boolean readLocalDataCopy ( String pServerDir ) { } public Hashtable < Integer , Tribe > getTribesForServer ( String pServer ) { } private Hashtable < Integer , Tribe > getTribesForServer ( String pServer , Hashtable < Integer , Tribe > pTribes ) { } public Hashtable < Integer , Ally > getAlliesForServer ( String pServer ) { } private Hashtable < Integer , Ally > getAlliesForServer ( String pServer , Hashtable < Integer , Ally > pAllies ) { } private boolean downloadData ( ) { } private boolean downloadLiveData ( ) { URL file = null ; String serverDir = getDataDirectory ( ) ; DataHolder . logger . info ( ( ( "Using<seq2seq4repair_space>server<seq2seq4repair_space>dir<seq2seq4repair_space>'" + serverDir ) + "'" ) ) ; new File ( serverDir ) . mkdirs ( ) ; try { String sURL = ServerManager . getServerURL ( GlobalOptions . getSelectedServer ( ) ) ; DataHolder . logger . debug ( "Download<seq2seq4repair_space>server<seq2seq4repair_space>settings" ) ; fireDataHolderEvents ( "Lese<seq2seq4repair_space>Server<seq2seq4repair_space>Einstellungen" ) ; File target = new File ( ( serverDir + "//settings.xml" ) ) ; if ( target . exists ( ) ) { target . delete ( ) ; } file = new URL ( ( sURL + "//interface.php?func=get_config" ) ) ; downloadDataFile ( file , "settings_tmp.xml" ) ; copyFile ( new File ( "settings_tmp.xml" ) , target ) ; if ( ! ( serverSupported ( ) ) ) { return false ; } DataHolder . logger . info ( ( "Downloading<seq2seq4repair_space>new<seq2seq4repair_space>data<seq2seq4repair_space>version<seq2seq4repair_space>from<seq2seq4repair_space>" + sURL ) ) ; fireDataHolderEvents ( "Lade<seq2seq4repair_space>Dörferliste" ) ; file = new URL ( ( sURL + "//map//village.txt.gz" ) ) ; DataHolder . logger . debug ( "<seq2seq4repair_space>+<seq2seq4repair_space>Start<seq2seq4repair_space>reading<seq2seq4repair_space>villages" ) ; downloadDataFile ( file , "village.tmp" ) ; DataHolder . logger . debug ( "<seq2seq4repair_space>-<seq2seq4repair_space>Finished<seq2seq4repair_space>reading<seq2seq4repair_space>villages" ) ; BufferedReader r = new BufferedReader ( new InputStreamReader ( new GZIPInputStream ( new FileInputStream ( "village.tmp" ) ) ) ) ; String line = "" ; DataHolder . logger . debug ( "<seq2seq4repair_space>+<seq2seq4repair_space>Start<seq2seq4repair_space>parsing<seq2seq4repair_space>villages" ) ; while ( ( line = r . readLine ( ) ) != null ) { line = line . replaceAll ( ",," , ",<seq2seq4repair_space>," ) ; Village v = Village . parseFromPlainData ( line ) ; <START_BUG> if ( ( ( ( ( v != null ) && ( ( v . getX ( ) ) > 0 ) ) && ( ( v . getX ( ) ) < ( mVillages . length ) ) ) && ( ( v . getY ( ) ) > 0 ) ) && ( ( v . getY ( ) ) < ( mVillages [ 0 ] . length ) ) ) { <END_BUG> mVillages [ v . getX ( ) ] [ v . getY ( ) ] = v ; } } r . close ( ) ; DataHolder . logger . debug ( "<seq2seq4repair_space>-<seq2seq4repair_space>Finished<seq2seq4repair_space>parsing<seq2seq4repair_space>villages" ) ; fireDataHolderEvents ( "Lade<seq2seq4repair_space>Spielerliste" ) ; file = new URL ( ( sURL + "//map//tribe.txt.gz" ) ) ; DataHolder . logger . debug ( "<seq2seq4repair_space>+<seq2seq4repair_space>Start<seq2seq4repair_space>reading<seq2seq4repair_space>tribes" ) ; downloadDataFile ( file , "tribe.tmp" ) ; DataHolder . logger . debug ( "<seq2seq4repair_space>-<seq2seq4repair_space>Finished<seq2seq4repair_space>reading<seq2seq4repair_space>tribes" ) ; r = new BufferedReader ( new InputStreamReader ( new GZIPInputStream ( new FileInputStream ( "tribe.tmp" ) ) ) ) ; line = "" ; DataHolder . logger . debug ( "<seq2seq4repair_space>+<seq2seq4repair_space>Start<seq2seq4repair_space>parsing<seq2seq4repair_space>tribes" ) ; while ( ( line = r . readLine ( ) ) != null ) { line = line . replaceAll ( ",," , ",<seq2seq4repair_space>," ) ; Tribe t = Tribe . parseFromPlainData ( line ) ; if ( ( t != null ) && ( ( t . getName ( ) ) != null ) ) { mTribes . put ( t . getId ( ) , t ) ; mTribesByName . put ( t . getName ( ) , t ) ; } } r . close ( ) ; DataHolder . logger . debug ( "<seq2seq4repair_space>-<seq2seq4repair_space>Finished<seq2seq4repair_space>parsing<seq2seq4repair_space>tribes" ) ; fireDataHolderEvents ( "Lade<seq2seq4repair_space>Stämmeliste" ) ; file = new URL ( ( sURL + "//map//ally.txt.gz" ) ) ; DataHolder . logger . debug ( "<seq2seq4repair_space>+<seq2seq4repair_space>Start<seq2seq4repair_space>reading<seq2seq4repair_space>allies" ) ; downloadDataFile ( file , "ally.tmp" ) ; DataHolder . logger . debug ( "<seq2seq4repair_space>-<seq2seq4repair_space>Finished<seq2seq4repair_space>reading<seq2seq4repair_space>allies" ) ; r = new BufferedReader ( new InputStreamReader ( new GZIPInputStream ( new FileInputStream ( "ally.tmp" ) ) ) ) ; line = "" ; DataHolder . logger . debug ( "<seq2seq4repair_space>+<seq2seq4repair_space>Start<seq2seq4repair_space>parsing<seq2seq4repair_space>allies" ) ; while ( ( line = r . readLine ( ) ) != null ) { line = line . replaceAll ( ",," , ",<seq2seq4repair_space>," ) ; Ally a = Ally . parseFromPlainData ( line ) ;

Fix:
if ( ( ( ( ( v != null ) && ( ( v . getX ( ) ) >= 0 ) ) && ( ( v . getX ( ) ) < ( mVillages . length ) ) ) && ( ( v . getY ( ) ) >= 0 ) ) && ( ( v . getY ( ) ) < ( mVillages [ 0 ] . length ) ) ) {