Skip to content

Commit

Permalink
[playframework#1224] Made sure Character fields can be binded.
Browse files Browse the repository at this point in the history
  • Loading branch information
pepite committed Nov 14, 2011
1 parent 00aec8d commit 662a61d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion framework/src/play/data/binding/Binder.java
Expand Up @@ -542,7 +542,12 @@ public static Object directBind(String name, Annotation[] annotations, String va
if (clazz.equals(String.class)) {
return value;
}


// Handles the case where the model property is a sole character
if (clazz.equals(Character.class)) {
return value.charAt(0);
}

// Enums
if (Enum.class.isAssignableFrom(clazz)) {
return nullOrEmpty ? null : Enum.valueOf((Class<Enum>) clazz, value);
Expand Down

0 comments on commit 662a61d

Please sign in to comment.