IDEMPIERE-455 Discover and fix FindBugs problems / Pattern BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY

This commit is contained in:
Carlos Ruiz 2012-12-06 15:45:41 -05:00
parent 1e30b56290
commit c39cc3b81d
1 changed files with 4 additions and 3 deletions

View File

@ -472,9 +472,10 @@ public class MProject extends X_C_Project
public MInvoice[] getMInvoices(){
StringBuilder sb = new StringBuilder();
sb.append(MInvoice.COLUMNNAME_C_Project_ID).append("=?");
Query qry = new Query(getCtx(), MInvoice.Table_Name, sb.toString(), get_TrxName());
qry.setParameters(getC_Project_ID());
return (MInvoice[]) qry.list().toArray();
List<MInvoice> list = new Query(getCtx(), MInvoice.Table_Name, sb.toString(), get_TrxName())
.setParameters(getC_Project_ID())
.list();
return list.toArray(new MInvoice[list.size()]);
}
} // MProject