Buggy code:
public char [ ] getAlphabet ( ) { } public String getWorkspace ( ) { } public void jBtnLigenPressed ( int index ) { } public void jBtnTurnierePressed ( int index ) { } public void jBtnGruppenphaseActionPerformed ( ) { } public void jBtnKORundeActionPerformed ( ) { } public void jBtnAlleGruppenPressed ( ) { } public void jBtnGruppePressed ( int index ) { } public void jBtnKORundePressed ( int index ) { } private void jCBSaisonauswahlItemStateChanged ( ItemEvent evt ) { } public void jCBDefStarttagItemStateChanged ( ItemEvent evt ) { } private void ligaspezifischesachenladen ( ) { } private void turnierspezifischeSachenLaden ( ) { } @ SuppressWarnings ( "unused" ) private void testLigaAusgabeSpielplanUndErgebnisse ( ) { } public void jBtnSpieltageActionPerformed ( ) { } public void jBtnTabelleActionPerformed ( ) { } public void jBtnStatistikActionPerformed ( ) { } public void jBtnOptionenActionPerformed ( ) { } public void uebersichtAnzeigen ( String name ) { } public void teamsVerbessern ( ) { } public void mannschaftHinzufuegen ( ) { } public String getTournamentWorkspaceFromShortName ( String shortName , int season ) { } private void addLeagueActionPerformed ( ) { } private void addTournamentActionPerformed ( ) { } public void addNewLeague ( String name , int season , int numberOfTeams , int spGgSG , String [ ] teamsNames , int [ ] anzahlen , boolean isSTSS , int defaultST , String KOTs , int [ ] defKOTs ) { for ( Liga liga : ligen ) { if ( liga . getName ( ) . equals ( name ) ) { message ( "A<seq2seq4repair_space>league<seq2seq4repair_space>with<seq2seq4repair_space>this<seq2seq4repair_space>name<seq2seq4repair_space>already<seq2seq4repair_space>exists." ) ; return ; } } if ( teamsNames == null ) { teamsNames = new String [ numberOfTeams + 1 ] ; teamsNames [ 0 ] = "" + numberOfTeams ; for ( int i = 1 ; i < ( teamsNames . length ) ; i ++ ) teamsNames [ i ] = "Team<seq2seq4repair_space>" + i ; } String defaultKOTs = "" + ( defKOTs [ 0 ] ) ; for ( int i = 1 ; i < ( defKOTs . length ) ; i ++ ) defaultKOTs += "," + ( defKOTs [ i ] ) ; String daten = ( "NAME*" + name ) + ";" ; daten = ( ( daten + "D_ST*" ) + defaultST ) + ";" ; daten = ( ( daten + "DKT*" ) + defaultKOTs ) + ";" ; daten = ( ( daten + "ISSTSS*" ) + isSTSS ) + ";" ; daten = ( ( daten + "A_MS*" ) + numberOfTeams ) + ";" ; daten = ( ( daten + "A_SGDG*" ) + spGgSG ) + ";" ; daten = ( ( daten + "A_CL*" ) + ( anzahlen [ 0 ] ) ) + ";" ; daten = ( ( daten + "A_CLQ*" ) + ( anzahlen [ 1 ] ) ) + ";" ; daten = ( ( daten + "A_EL*" ) + ( anzahlen [ 2 ] ) ) + ";" ; daten = ( ( daten + "A_REL*" ) + ( anzahlen [ 3 ] ) ) + ";" ; daten = ( ( daten + "A_ABS*" ) + ( anzahlen [ 4 ] ) ) + ";" ; daten = ( ( daten + "A_SAI*" ) + 1 ) + ";" ; daten = ( ( daten + "S0*" ) + season ) + "*S0;" ; String saison ; if ( isSTSS ) saison = ( season + "_" ) + ( season + 1 ) ; else saison = "" + season ; File leagueFile = new File ( ( ( ( workspace ) + ( File . separator ) ) + name ) ) ; File seasonFile = new File ( ( ( ( ( ( workspace ) + ( File . separator ) ) + name ) + ( File . separator ) ) + saison ) ) ; try { leagueFile . mkdir ( ) ; seasonFile . mkdir ( ) ; } catch ( Exception e ) { error ( "Error<seq2seq4repair_space>while<seq2seq4repair_space>creating<seq2seq4repair_space>directories!" ) ; } <START_BUG> int numberOfMatchdays = ( 4 * ( ( int ) ( Math . round ( ( ( ( double ) ( numberOfTeams ) ) // 2 ) ) ) ) ) - 2 ; <END_BUG> int numberOfMatches = numberOfTeams // 2 ; String [ ] spielplan = new String [ numberOfMatchdays + 1 ] ; String [ ] ergebnisplan = new String [ numberOfMatchdays ] ; String representation = "" ; for ( int i = 0 ; i < numberOfMatches ; i ++ ) { representation += "f" ; } spielplan [ 0 ] = KOTs ; for ( int i = 0 ; i < numberOfMatchdays ; i ++ ) { spielplan [ ( i + 1 ) ] = representation + ";" ; ergebnisplan [ i ] = representation + ";" ; } inDatei ( ( ( ( seasonFile . getAbsolutePath ( ) ) + ( File . separator ) ) + "Mannschaften.txt" ) , teamsNames ) ; inDatei ( ( ( ( seasonFile . getAbsolutePath ( ) ) + ( File . separator ) ) + "Spielplan.txt" ) , spielplan ) ; inDatei ( ( ( ( seasonFile . getAbsolutePath ( ) ) + ( File . separator ) ) + "Ergebnisse.txt" ) , ergebnisplan ) ; ( anzahlLigen ) ++ ; Liga [ ] oldLigen = ligen ; ligen = new Liga [ anzahlLigen ] ; for ( int i = 0 ; i < ( oldLigen . length ) ; i ++ ) { ligen [ i ] = oldLigen [ i ] ; } ligen [ ( ( ligen . length ) - 1 ) ] = new Liga ( ( ( ligen . length ) - 1 ) , this , daten ) ; saveConfiguration ( ) ; loadConfiguration ( ) ; buildLeaguesButtons ( ) ; message ( "Successfully<seq2seq4repair_space>created<seq2seq4repair_space>new<seq2seq4repair_space>league." ) ; }

Fix:
int numberOfMatchdays = spGgSG * ( ( 2 * ( ( int ) ( Math . round ( ( ( ( double ) ( numberOfTeams ) ) // 2 ) ) ) ) ) - 1 ) ;