Buggy code:
public class TableConstructionPhases implements Pld { private static TreeMap < String , PPLSchema > allPPLSchemas = new TreeMap < String , PPLSchema > ( ) ; private ArrayList < PPLTable > tables = new ArrayList < PPLTable > ( ) ; private ArrayList < Phase > phases = new ArrayList < Phase > ( ) ; private int columnsNumber = 0 ; private Integer [ ] [ ] schemaColumnId = null ; private int maxDeletions = 1 ; private int maxInsersions = 1 ; private int maxUpdates = 1 ; private Integer [ ] segmentSize = new Integer [ 3 ] ; private int totalChanges = 0 ; public TableConstructionPhases ( GlobalDataKeeper globalDataKeeper ) { } public String [ ] constructColumns ( ) { } public String [ ] [ ] constructRows ( ) { } private String [ ] constructOneRow ( PPLTable oneTable , int schemaVersion , String schemaName ) { String [ ] oneRow = new String [ columnsNumber ] ; int deletedAllTable = 0 ; int pointerCell = 0 ; int updn = 0 ; int deln = 0 ; int insn = 0 ; int totalChangesForOnePhase = 0 ; oneRow [ pointerCell ] = oneTable . getName ( ) ; if ( schemaVersion == 0 ) { pointerCell ++ ; } else { for ( int p = 0 ; p < ( phases . size ( ) ) ; p ++ ) { TreeMap < Integer , PPLTransition > phasePPLTransitions = phases . get ( p ) . getPhasePPLTransitions ( ) ; for ( Map . Entry < Integer , PPLTransition > tr : phasePPLTransitions . entrySet ( ) ) { if ( tr . getValue ( ) . getOldVersionName ( ) . equals ( schemaName ) ) { pointerCell = p + 1 ; break ; } } } } System . out . println ( ( ( ( oneTable . getName ( ) ) + "<seq2seq4repair_space>" ) + pointerCell ) ) ; int initialization = 0 ; if ( schemaVersion > 0 ) { initialization = schemaVersion - 1 ; } for ( int p = 0 ; p < ( phases . size ( ) ) ; p ++ ) { TreeMap < Integer , PPLTransition > phasePPLTransitions = phases . get ( p ) . getPhasePPLTransitions ( ) ; totalChangesForOnePhase = 0 ; Integer [ ] mapKeys = new Integer [ phasePPLTransitions . size ( ) ] ; int pos2 = 0 ; for ( Integer key : phasePPLTransitions . keySet ( ) ) { mapKeys [ ( pos2 ++ ) ] = key ; } Integer pos3 = null ; <START_BUG> for ( int i = initialization ; i < ( phasePPLTransitions . size ( ) ) ; i ++ ) { <END_BUG> pos3 = mapKeys [ i ] ; PPLTransition tmpTL = phasePPLTransitions . get ( pos3 ) ; String sc = tmpTL . getNewVersionName ( ) ; ArrayList < TableChange > tmpTR = tmpTL . getTableChanges ( ) ; updn = 0 ; deln = 0 ; insn = 0 ; if ( tmpTR != null ) { for ( int j = 0 ; j < ( tmpTR . size ( ) ) ; j ++ ) { TableChange tableChange = tmpTR . get ( j ) ; if ( tableChange . getAffectedTableName ( ) . equals ( oneTable . getName ( ) ) ) { ArrayList < AtomicChange > atChs = tableChange . getTableAtChForOneTransition ( ) ; for ( int k = 0 ; k < ( atChs . size ( ) ) ; k ++ ) { if ( atChs . get ( k ) . getType ( ) . contains ( "Addition" ) ) { insn ++ ; if ( insn > ( maxInsersions ) ) { maxInsersions = insn ; } totalChangesForOnePhase = totalChangesForOnePhase + insn ; totalChanges = ( totalChanges ) + insn ; } else if ( atChs . get ( k ) . getType ( ) . contains ( "Deletion" ) ) { deln ++ ; if ( deln > ( maxDeletions ) ) { maxDeletions = deln ; } totalChangesForOnePhase = totalChangesForOnePhase + deln ; totalChanges = ( totalChanges ) + deln ; boolean existsLater = getNumOfAttributesOfNextSchema ( sc , oneTable . getName ( ) ) ; if ( ! existsLater ) { deletedAllTable = 1 ; } } else { updn ++ ; if ( updn > ( maxUpdates ) ) { maxUpdates = updn ; } totalChangesForOnePhase = totalChangesForOnePhase + updn ; totalChanges = ( totalChanges ) + updn ; } } } } } if ( oneTable . getName ( ) . contains ( "t_trigger_type" ) ) { System . out . println ( ( ( ( ( ( oneTable . getName ( ) ) + "@@" ) + totalChangesForOnePhase ) + "<seq2seq4repair_space>" ) + pointerCell ) ) ; } if ( pointerCell >= ( columnsNumber ) ) { break ; } oneRow [ pointerCell ] = Integer . toString ( totalChangesForOnePhase ) ; pointerCell ++ ; if ( deletedAllTable == 1 ) { break ; } insn = 0 ; updn = 0 ; deln = 0 ; } } for ( int i = 0 ; i < ( oneRow . length ) ; i ++ ) { if ( ( oneRow [ i ] ) == null ) { oneRow [ i ] = "" ; } } String lala = "" ; for ( int i = 0 ; i < ( oneRow . length ) ; i ++ ) { lala = ( lala + ( oneRow [ i ] ) ) + "," ; } System . out . println ( ( ( ( oneTable . getName ( ) ) + "<seq2seq4repair_space>" ) + lala ) ) ; return oneRow ; } public Integer [ ] getSegmentSize ( ) { } private boolean getNumOfAttributesOfNextSchema ( String schema , String table ) { } }

Fix:
for ( int i = 0 ; i < ( phasePPLTransitions . size ( ) ) ; i ++ ) {