IN PROGRESS - issue SWF-720: Multiple checkboxes to Collection mapping

http://jira.springframework.org/browse/SWF-720
This commit is contained in:
Keith Donald
2008-06-23 14:23:46 +00:00
parent 301931e617
commit a5d1f726b2
2 changed files with 15 additions and 2 deletions

View File

@@ -46,7 +46,10 @@ public class GenericFormatterRegistry implements FormatterRegistry {
Assert.notNull(clazz, "The formatted class argument is required");
Assert.hasText(id, "The id of the custom formatter is required");
Formatter formatter = (Formatter) formattersById.get(id);
if (formatter != null && formatter.getObjectType().equals(clazz)) {
if (formatter != null && !formatter.getObjectType().equals(clazz)) {
throw new IllegalArgumentException(
"Provided class argument does not match registered Formatter objectType [" + clazz.getName()
+ "]; unable to return custom Formatter instance " + formatter);
}
return formatter;
}