Buggy code:
public class DataToArray { private static char [ ] [ ] c ; private static ArrayList < String > lines = new ArrayList < String > ( ) ; private static ArrayList < char [ ] [ ] > chars = new ArrayList < char [ ] [ ] > ( ) ; private static ArrayList < Integer > partitionLength = new ArrayList < Integer > ( ) ; public static String textFile = "MoonlightSonata.txt" ; public static String Title = "NO<seq2seq4repair_space>TITLE" ; public static String SubTitle = "NO<seq2seq4repair_space>SUBTITLE" ; public static float Spacing = 8.0F ; private static ArrayList < char [ ] [ ] > newchars = new ArrayList < char [ ] [ ] > ( ) ; private static int col ; public static ArrayList < char [ ] [ ] > textToArray ( File [ ] source ) throws DocumentException , IOException { DataToArray . lines = new ArrayList < String > ( ) ; DataToArray . chars = new ArrayList < char [ ] [ ] > ( ) ; DataToArray . newchars = new ArrayList < char [ ] [ ] > ( ) ; DataToArray . partitionLength = new ArrayList < Integer > ( ) ; String name = null ; DataToArray . chars . clear ( ) ; DataToArray . lines . clear ( ) ; DataToArray . Title = "<seq2seq4repair_space>" ; DataToArray . SubTitle = "<seq2seq4repair_space>" ; BufferedReader input = null ; String line = "" ; for ( int i = 0 ; i < ( source . length ) ; i ++ ) { name = source [ i ] . getPath ( ) ; input = new BufferedReader ( new FileReader ( name ) ) ; while ( null != ( line = input . readLine ( ) ) ) { if ( ( line . contains ( "subtitle" ) ) || ( line . contains ( "SUBTITLE" ) ) ) { DataToArray . SubTitle = line . substring ( ( ( line . indexOf ( '=' ) ) + 1 ) , line . length ( ) ) ; } else if ( ( line . contains ( "title" ) ) || ( line . contains ( "TITLE" ) ) ) { DataToArray . Title = line . substring ( ( ( line . indexOf ( '=' ) ) + 1 ) , line . length ( ) ) ; } if ( ( line . contains ( "spacing" ) ) || ( line . contains ( "SPACING" ) ) ) { DataToArray . Spacing = Float . parseFloat ( line . substring ( ( ( line . indexOf ( '=' ) ) + 1 ) , line . length ( ) ) ) ; } if ( ( line . trim ( ) . length ( ) ) == 0 ) { continue ; } if ( ( line . charAt ( 0 ) ) == '|' ) { DataToArray . lines . add ( line ) ; } } input . close ( ) ; } for ( int z = 0 ; z < ( DataToArray . lines . size ( ) ) ; z = z + 6 ) { DataToArray . col = DataToArray . lines . get ( z ) . length ( ) ; DataToArray . c = new char [ 6 ] [ ] ; int temp = z ; for ( int i = 0 ; i < 6 ; i ++ , temp ++ ) { DataToArray . c [ i ] = new char [ DataToArray . lines . get ( temp ) . length ( ) ] ; for ( int j = 0 ; j < ( DataToArray . lines . get ( temp ) . length ( ) ) ; j ++ ) { DataToArray . c [ i ] [ j ] = DataToArray . lines . get ( temp ) . charAt ( j ) ; } } DataToArray . chars . add ( DataToArray . c ) ; } <START_BUG> for ( int t = 0 ; t < ( ( DataToArray . chars . size ( ) ) - 1 ) ; t ++ ) { <END_BUG> boolean alreadyBottomed = true ; char [ ] [ ] d = new char [ 6 ] [ DataToArray . chars . get ( t ) [ 0 ] . length ] ; for ( int v = 0 ; v < ( DataToArray . chars . get ( t ) [ 0 ] . length ) ; v ++ ) { for ( int w = 0 ; w < 6 ; w ++ ) { char currentChar = DataToArray . chars . get ( t ) [ w ] [ v ] ; d [ w ] [ v ] = currentChar ; if ( ( ( w == 5 ) && ( currentChar == '|' ) ) && ( ! alreadyBottomed ) ) { v -- ; DataToArray . newchars . add ( d ) ; d = new char [ 6 ] [ DataToArray . chars . get ( t ) [ 0 ] . length ] ; alreadyBottomed = true ; } if ( ( ( w == 5 ) && ( currentChar != '|' ) ) && alreadyBottomed ) { alreadyBottomed = false ; } } } } ArrayList < char [ ] [ ] > finalChars = new ArrayList < char [ ] [ ] > ( ) ; for ( int p = 0 ; p < ( DataToArray . newchars . size ( ) ) ; p ++ ) { finalChars . add ( DataToArray . TrimElement ( DataToArray . newchars . get ( p ) ) ) ; } for ( int i = 0 ; i < ( DataToArray . lines . size ( ) ) ; i ++ ) { } for ( int i = 0 ;

Fix:
for ( int t = 0 ; t < ( DataToArray . chars . size ( ) ) ; t ++ ) {