Buggy code:
CsvReader for ( int j = - 1 ; j < Ph2Run ; j ++ ) { String outputFile = getExtFileName ( j , Ph2 ) ; CsvReader products = new CsvReader ( outputFile , ';' ) ; products . skipLine ( ) ; products . readHeaders ( ) ; while ( products . readRecord ( ) ) { for ( LevelNodeGraphInfo lnode : levelVector ) { double value = Double . parseDouble ( products . get ( lnode . getNodeName ( ) ) ) ; if ( ( chartObj . getFStep ( ) ) == 1 ) { int jbounds ; for ( jbounds = 0 ; jbounds < ( ( bounds . capacity ( ) ) - 1 ) ; jbounds ++ ) { if ( ( value >= ( bounds . elementAt ( jbounds ) ) ) && ( value <= ( bounds . elementAt ( ( jbounds + 1 ) ) ) ) ) break ; else continue ; } if ( value == ( bounds . lastElement ( ) ) ) lnode . getSeries ( ) . add ( xIntercept , bounds . lastElement ( ) ) ; else lnode . getSeries ( ) . add ( xIntercept , bounds . elementAt ( jbounds ) ) ; } else lnode . getSeries ( ) . add ( xIntercept , value ) ; if ( prSet == 0 ) { if ( lnode . getNodeName ( ) . equals ( prNodeName ) ) { initValue = value ; prSet ++ ; } } if ( set == 0 ) { min = value ; max = value ; set ++ ; } else { if ( min > value ) min = value ; if ( max < value ) max = value ; } } xIntercept ++ ; } products . close ( ) ; } for ( int j = 0 ; j < Ph3Run ; j ++ ) { String outputFile = getExtFileName ( j , Ph3 ) ; CsvReader products = new CsvReader ( outputFile , ';' ) ; products . skipLine ( ) ; products . readHeaders ( ) ; while ( products . readRecord ( ) ) { for ( LevelNodeGraphInfo lnode : levelVector ) { double value = Double . parseDouble ( products . get ( lnode . getNodeName ( ) ) ) ; if ( ( chartObj . getFStep ( ) ) == 1 ) { int jbounds ; for ( jbounds = 0 ; jbounds < ( ( bounds . capacity ( ) ) - 1 ) ; jbounds ++ ) { if ( ( value >= ( bounds . elementAt ( jbounds ) ) ) && ( value <= ( bounds . elementAt ( ( jbounds + 1 ) ) ) ) ) break ; else continue ; } if ( value == ( bounds . lastElement ( ) ) ) lnode . getSeries ( ) . add ( xIntercept , bounds . lastElement ( ) ) ; else lnode . getSeries ( ) . add ( xIntercept , bounds . elementAt ( jbounds ) ) ; } else lnode . getSeries ( ) . add ( xIntercept , value ) ; if ( prSet == 0 ) { if ( lnode . getNodeName ( ) . equals ( prNodeName ) ) { initValue = value ; prSet ++ ; } } if ( set == 0 ) { min = value ; max = value ; set ++ ; } else { if ( min > value ) min = value ; if ( max < value ) max = value ; } } xIntercept ++ ; } products . close ( ) ; } for ( int j = 0 ; j < Ph4Run ; j ++ ) { String outputFile = getExtFileName ( j , Ph4 ) ; CsvReader products = new CsvReader ( outputFile , ';' ) ; products . skipLine ( ) ; products . readHeaders ( ) ; while ( products . readRecord ( ) ) { for ( LevelNodeGraphInfo lnode : levelVector ) { double value = Double . parseDouble ( products . get ( lnode . getNodeName ( ) ) ) ; if ( ( chartObj . getFStep ( ) ) == 1 ) { int jbounds ; for ( jbounds = 0 ; jbounds < ( ( bounds . capacity ( ) ) - 1 ) ; jbounds ++ ) { if ( ( value >= ( bounds . elementAt ( jbounds ) ) ) && ( value <= ( bounds . elementAt ( ( jbounds + 1 ) ) ) ) ) break ; else continue ; } if ( value == ( bounds . lastElement ( ) ) ) lnode . getSeries ( ) . add ( xIntercept , bounds . lastElement ( ) ) ; else lnode . getSeries ( ) . add ( xIntercept , bounds . elementAt ( jbounds ) ) ; } else lnode . getSeries ( ) . add ( xIntercept , value ) ; if ( prSet == 0 ) { if ( lnode . getNodeName ( ) . equals ( prNodeName ) ) { initValue = value ; prSet ++ ; } } if ( set == 0 ) { min = value ; max = value ; set ++ ; } else { if ( min > value ) min = value ; if ( max < value ) max = value ; } } xIntercept ++ ; } products . close ( ) ; } } int i = 0 ; if ( folder . equals ( "phase2" ) ) i = - 1 ; for ( ; i < run ; i ++ ) { String outputFile = getFileName ( i , fname ) ; CsvReader products = new CsvReader ( outputFile , ';' ) ; products . skipLine ( ) ; products . readHeaders ( ) ; String [ ] productHeaders = products . getHeaders ( ) ; int iter = 0 ; if ( iter == 0 ) { for ( int k = 0 ; k < ( productHeaders . length ) ; k ++ ) { if ( productHeaders [ k ] . equalsIgnoreCase ( "pdr_date" ) ) { pdr_date_index = k ; } else if ( productHeaders [ k ] . equalsIgnoreCase ( "prr_date" ) ) { prr_date_index = k ; } else if ( productHeaders [ k ] . equalsIgnoreCase ( "isr_date" ) ) { isr_date_index = k ; } else if ( productHeaders [ k ] . equalsIgnoreCase ( "cdr_date" ) ) { cdr_date_index = k ; } else if ( productHeaders [ k ] . equalsIgnoreCase ( "frr_date" ) ) { frr_date_index = k ; } } } while ( products . readRecord ( ) ) { for ( LevelNodeGraphInfo lnode : levelVector ) { String records = products . getRawRecord ( ) ; String [ ] recordEntries = records . split ( ";" ) ; if ( iter == 0 ) { cdr_date = Double . valueOf ( recordEntries [ cdr_date_index ] ) ; prr_date = Double . valueOf ( recordEntries [ prr_date_index ] ) ; pdr_date = Double . valueOf ( recordEntries [ pdr_date_index ] ) ; isr_date = Double . valueOf ( recordEntries [ isr_date_index ] ) ; frr_date = Double . valueOf ( recordEntries [ frr_date_index ] ) ; if ( ( chartObj . getGlobal ( ) ) == 1 ) max_xIntercept = ( ( int ) ( isr_date ) ) ; else { if ( folder . equals ( "phase2" ) ) <START_BUG> max_xIntercept = 810 ; <END_BUG>

Fix:
max_xIntercept = ( ( int ) ( cdr_date ) ) ;