throw new IllegalArgumentException("The Locale argument cannot be null");
}
// TODO: This may cause concurrent modification exceptions
Iterator itr = iterator();
Description fallBack = null;
while (itr.hasNext())
{
Description desc = (Description) itr.next();
if (desc.getLocale().equals(arg0))
{
return desc;
}
// set fall back if we have a Locale that only has
// language set.
else if (desc.getLocale().getLanguage().equals(arg0.getLanguage()))
{
fallBack = desc;
}
else if (fallBack == null && desc.getLocale().equals(JetspeedLocale.getDefaultLocale()))
{
fallBack = desc;
}
}
return fallBack;