Buggy code:
float [ ] faceValues = new float [ numMarketsTotal ] ; float [ ] collateralRequired = new float [ numMarketsTotal ] ; Iterator secIt = securityBeans . iterator ( ) ; int i1 ; for ( i1 = 0 ; secIt . hasNext ( ) ; i1 ++ ) { SecurityPeriodBean secBean = ( ( SecurityPeriodBean ) ( secIt . next ( ) ) ) ; marketTitles [ i1 ] = secBean . getTitle ( ) ; marketTypes [ i1 ] = 0 ; minPrices [ i1 ] = secBean . getMinPrice ( ) ; maxPrices [ i1 ] = secBean . getMaxPrice ( ) ; marketTime [ i1 ] = secBean . getTimeOpen ( ) ; } if ( ( periodBean . getNumLoantypes ( ) ) > 0 ) { Iterator loanIt = loantypeBeans . iterator ( ) ; for ( ; loanIt . hasNext ( ) ; i1 ++ ) { LoantypePeriodBean loanBean = ( ( LoantypePeriodBean ) ( loanIt . next ( ) ) ) ; marketTitles [ i1 ] = loanBean . getTitle ( ) ; marketTypes [ i1 ] = 1 ; minPrices [ i1 ] = loanBean . getMinPrice ( ) ; maxPrices [ i1 ] = loanBean . getMaxPrice ( ) ; marketTime [ i1 ] = marketTime [ 0 ] ; faceValues [ i1 ] = loanBean . getFacevalue ( ) ; collateralRequired [ i1 ] = loanBean . getCollateralsRequired ( ) ; } } if ( ( periodBean . getNumSecLoantypes ( ) ) > 0 ) { if ( secLoantypeBeans == null ) { secLoantypeBeans = new ArrayList ( ) ; for ( int k = 0 ; k < ( periodBean . getNumLoantypes ( ) ) ; k ++ ) { SecLoanPeriodBean secltype = new SecLoanPeriodBean ( ) ; int [ ] constraints = new int [ numGroups ] ; int [ ] initials = new int [ numGroups ] ; boolean [ ] buyPriveleges = new boolean [ numGroups ] ; boolean [ ] sellPriveleges = new boolean [ numGroups ] ; boolean [ ] addSurplus = new boolean [ numGroups ] ; boolean [ ] addDividend = new boolean [ numGroups ] ; for ( int g = 0 ; g < ( numGroups ) ; g ++ ) { initials [ g ] = 0 ; constraints [ g ] = 0 ; buyPriveleges [ g ] = true ; sellPriveleges [ g ] = true ; addDividend [ g ] = false ; addSurplus [ g ] = false ; } secltype . setConstraints ( constraints ) ; secltype . setInitials ( initials ) ; secltype . setBuyPriveleges ( buyPriveleges ) ; secltype . setSellPriveleges ( sellPriveleges ) ; secltype . setAddSurplus ( addSurplus ) ; secltype . setAddDividend ( addDividend ) ; secltype . setTimeOpen ( ( ( LoantypePeriodBean ) ( periodBean . getLoantypes ( ) . get ( k ) ) ) . getTimeOpen ( ) ) ; secLoantypeBeans . add ( secltype ) ; } periodBean . setSecLoantypes ( secLoantypeBeans ) ; } Iterator secloanIt = secLoantypeBeans . iterator ( ) ; for ( int i = 0 ; secloanIt . hasNext ( ) ; i1 ++ , i ++ ) { SecLoanPeriodBean secloanBean = ( ( SecLoanPeriodBean ) ( secloanIt . next ( ) ) ) ; <START_BUG> secloanBean . setTitle ( ( ( ( ( ( SecurityPeriodBean ) ( periodBean . getSecurities ( ) . get ( i ) ) ) . getTitle ( ) ) + "For" ) + ( ( ( LoantypePeriodBean ) ( periodBean . getLoantypes ( ) . get ( i ) ) ) . getTitle ( ) ) ) ) ; <END_BUG> secloanBean . setLoanType ( ( ( LoantypePeriodBean ) ( periodBean . getLoantypes ( ) . get ( i ) ) ) ) ; secloanBean . setMaxPrice ( 1.0F ) ; secloanBean . setMinPrice ( 0.0F ) ; marketTitles [ i1 ] = secloanBean . getTitle ( ) ; marketTypes [ i1 ] = 2 ; minPrices [ i1 ] = secloanBean . getMinPrice ( ) ; maxPrices [ i1 ] = secloanBean . getMaxPrice ( ) ; marketTime [ i1 ] = marketTime [ 0 ] ; collateralRequired [ i1 ] = collateralRequired [ ( i1 - numLoantypes ) ] ; } } SessionBean . log . info ( ( ( ( "SessionBean.createPeriodInfo()<seq2seq4repair_space>is<seq2seq4repair_space>creating<seq2seq4repair_space>a<seq2seq4repair_space>new<seq2seq4repair_space>MarketDef:<seq2seq4repair_space>useGui=" + useGui ) + ",<seq2seq4repair_space>useEffCashValidation=" ) + useEffCashValidation ) ) ; MarketDef minfo = new MarketDef ( numMarkets , numLoantypes , numSecLoantypes , marketTitles , marketTypes , minPrices , maxPrices , faceValues , collateralRequired , marketTime , numDivisions , useGui , useEffCashValidation ) ; SubjectDef sinfo = new SubjectDef ( numSubjects ) ; for ( int i = 0 ; i < ( numSubjects ) ; i ++ ) { sinfo . assignGroup ( i , ( ( SubjectPeriodBean ) ( subjectBeans . get ( i ) ) ) . getGroup ( ) ) ; sinfo . addAnnouncement ( i , ( ( SubjectPeriodBean ) ( subjectBeans . get ( i ) ) ) . getAnnouncement ( ) ) ; } String [ ] groupTitles = new String [ numGroups ] ; for ( int i = 0 ; i < ( groupTitles . length ) ; i ++ ) groupTitles [ i ] = ( ( GroupBean ) ( groups . get ( i ) ) ) . getName ( ) ; GroupDef ginfo = new GroupDef ( numGroups , numMarkets , numLoantypes , numSecLoantypes , groupTitles ) ; for ( int i = 0 ; i < ( groupBeans . size ( ) ) ; i ++ ) { GroupPeriodBean group = ( ( GroupPeriodBean ) ( groupBeans . get ( i ) ) ) ; int groupNum = group . getId ( ) ; ginfo . setCashInitial ( groupNum , group . getCashInitial ( ) ) ; ginfo . setPayoffFunction ( groupNum , getPayoffFunction ( periodBean , group . getPayoffFunctionName ( ) ) ) ;

Fix:
secloanBean . setTitle ( ( ( ( ( ( SecurityPeriodBean ) ( periodBean . getSecurities ( ) . get ( 0 ) ) ) . getTitle ( ) ) + "For" ) + ( ( ( LoantypePeriodBean ) ( periodBean . getLoantypes ( ) . get ( i ) ) ) . getTitle ( ) ) ) ) ;