Buggy code:
public class BalanceSheetGifiActionBean extends GenericActionBean { private List < AccountBean > assetList ; private List < AccountBean > liabilityList ; private List < AccountBean > equityList ; private BigDecimal totalAssets ; private BigDecimal totalLiabilities ; private BigDecimal totalEquities ; private BigDecimal totalLiabEqu ; private BigDecimal netIncome ; private Date endDate = new Date ( ) ; private AccountService accountService ; @ SpringBean ( "accountService" ) public void injectAccountService ( AccountService svc ) { } public List < AccountBean > getAssetList ( ) { } public List < AccountBean > getLiabilityList ( ) { } public List < AccountBean > getEquityList ( ) { } public BigDecimal getTotalAssets ( ) { } public BigDecimal getTotalLiabilities ( ) { } public BigDecimal getTotalEquities ( ) { } public BigDecimal getTotalLiabEqu ( ) { } public BigDecimal getNetIncome ( ) { } public Date getEndDate ( ) { } public void setEndDate ( Date endDate ) { } public String getCompanyName ( ) { } @ DefaultHandler public Resolution view ( ) { try { int reAccountId = Integer . parseInt ( getParameter ( ACCOUNT_RETAINED_EARNINGS ) ) ; List < AccountBean > tempAccountList = accountService . getAccountBalances ( getStartDate ( ) , reAccountId ) ; BigDecimal reBalance = BigDecimal . ZERO ; if ( ( tempAccountList != null ) && ( ( tempAccountList . size ( ) ) > 0 ) ) { AccountBean account = tempAccountList . get ( 0 ) ; reBalance = account . getBalance ( ) ; } <START_BUG> tempAccountList = accountService . getGifiAccountBalances ( endDate , 0 ) ; <END_BUG> assetList = new LinkedList < AccountBean > ( ) ; liabilityList = new LinkedList < AccountBean > ( ) ; equityList = new LinkedList < AccountBean > ( ) ; totalAssets = BigDecimal . ZERO ; totalLiabilities = BigDecimal . ZERO ; totalEquities = BigDecimal . ZERO ; netIncome = BigDecimal . ZERO ; int equityAccounts = 0 ; for ( AccountBean account : tempAccountList ) { if ( ( account . getType ( ) ) == ( AccountType . INCOME ) ) { if ( account . isHasNegativeBalance ( ) ) netIncome = netIncome . subtract ( account . getBalance ( ) ) ; else netIncome = netIncome . add ( account . getBalance ( ) ) ; } else if ( ( account . getType ( ) ) == ( AccountType . EXPENSE ) ) { if ( account . isHasNegativeBalance ( ) ) netIncome = netIncome . add ( account . getBalance ( ) ) ; else netIncome = netIncome . subtract ( account . getBalance ( ) ) ; } } for ( AccountBean account : tempAccountList ) { if ( ( account . getType ( ) ) == ( AccountType . ASSET ) ) { assetList . add ( account ) ; if ( account . isHasNegativeBalance ( ) ) totalAssets = totalAssets . subtract ( account . getBalance ( ) ) ; else totalAssets = totalAssets . add ( account . getBalance ( ) ) ; } else if ( ( account . getType ( ) ) == ( AccountType . LIABILITY ) ) { liabilityList . add ( account ) ; if ( account . isHasNegativeBalance ( ) ) totalLiabilities = totalLiabilities . subtract ( account . getBalance ( ) ) ; else totalLiabilities = totalLiabilities . add ( account . getBalance ( ) ) ; } else if ( ( account . getType ( ) ) == ( AccountType . OWNERS_EQUITY ) ) { equityList . add ( account ) ; if ( String . valueOf ( account . getAccountId ( ) ) . equals ( getParameter ( ACCOUNT_INCOME_SUMMARY_GIFI ) ) ) account . setBalance ( netIncome ) ; else if ( String . valueOf ( account . getAccountId ( ) ) . equals ( getParameter ( ACCOUNT_RETAINED_EARNINGS_GIFI ) ) ) { equityAccounts += account . getAccountId ( ) ; account . setBalance ( reBalance ) ; SimpleDateFormat format = new SimpleDateFormat ( "MMMM<seq2seq4repair_space>d,<seq2seq4repair_space>yyyy" ) ; account . setName ( ( ( ( account . getName ( ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>as<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( format . format ( getStartDate ( ) ) ) ) ) ; } else if ( String . valueOf ( account . getAccountId ( ) ) . equals ( getParameter ( ACCOUNT_SHARE_CAPITAL_GIFI ) ) ) equityAccounts += account . getAccountId ( ) ; if ( account . isHasNegativeBalance ( ) ) totalEquities = totalEquities . subtract ( account . getBalance ( ) ) ; else totalEquities = totalEquities . add ( account . getBalance ( ) ) ; } } totalLiabEqu = totalLiabilities . add ( totalEquities ) ; fixEquityListIfNeeded ( equityAccounts ) ; } catch ( DataAccessException e ) { return handleException ( e ) ; } return new ForwardResolution ( "//report//balance-sheet-gifi.jsp" ) ; } private Date getStartDate ( ) { } private void fixEquityListIfNeeded ( int equityAccounts ) { } }

Fix:
tempAccountList = accountService . getGifiAccountBalances ( endDate , null ) ;