final String language = (String) entry.getKey();
final Properties properties = (Properties) entry.getValue();
if (properties.containsKey(nameProperty)) {
final Locale locale =
convertPropertiesLanguageToLocale(language);
final PolicyDescriptor policyDescriptor =
retrievePolicyDescriptor(connection, policyName, locale);
if (policyDescriptor != null) {
result.add(policyDescriptor);
}
}
}
if(result.size() == 0){
// property not found in any locale so wee need to add at least
// default one
final Locale locale =
convertPropertiesLanguageToLocale("");
final PolicyDescriptor policyDescriptor =
retrievePolicyDescriptor(connection, policyName, locale);
if (policyDescriptor != null) {
result.add(policyDescriptor);
}
}