[hidden email] wrote:
> --- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy (added)
> +++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy Thu Aug 28 06:39:13 2008
> +if (userLogin) {
> + companies = delegator.findByAnd("PartyRelationship",
> + [partyIdTo: userLogin.partyId,
> + roleTypeIdTo: "CONTACT",
> + roleTypeIdFrom: "ACCOUNT"]);
> + if (companies) {
> + company = companies.get(0);
> + context.myCompanyId = company.partyIdFrom;
> + } else {
> + context.myCompanyId = userLogin.partyId;
> + }
> +}
So, you use [:] for fast map creation, Map.field for fast putting, but
then use .get(int) to fetch from the list.
Why not use:
company = companies[0]?