Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #480 #56

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions framework/src/play/data/binding/Binder.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,16 +368,7 @@ public static Object directBind(String name, Annotation[] annotations, String va
}
}

// custom types
for (Class<?> c : supportedTypes.keySet()) {
Logger.trace("directBind: value [" + value + "] c [" + c + "] Class [" + clazz + "]");
if (c.isAssignableFrom(clazz)) {
Logger.trace("directBind: isAssignableFrom is true");
return nullOrEmpty ? null : supportedTypes.get(c).bind(name, annotations, value, clazz);
}
}

// application custom types
// application custom types have higher priority
for (Class<TypeBinder<?>> c : Play.classloader.getAssignableClasses(TypeBinder.class)) {
if (c.isAnnotationPresent(Global.class)) {
Class<?> forType = (Class) ((ParameterizedType) c.getGenericInterfaces()[0]).getActualTypeArguments()[0];
Expand All @@ -387,6 +378,15 @@ public static Object directBind(String name, Annotation[] annotations, String va
}
}

// custom types
for (Class<?> c : supportedTypes.keySet()) {
Logger.trace("directBind: value [" + value + "] c [" + c + "] Class [" + clazz + "]");
if (c.isAssignableFrom(clazz)) {
Logger.trace("directBind: isAssignableFrom is true");
return nullOrEmpty ? null : supportedTypes.get(c).bind(name, annotations, value, clazz);
}
}

// raw String
if (clazz.equals(String.class)) {
return value;
Expand Down