Browse Source

Polishing

pull/1250/merge
Juergen Hoeller 8 years ago
parent
commit
5458a427a1
  1. 5
      spring-core/src/main/java/org/springframework/core/convert/Property.java
  2. 3
      spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AbstractNamedValueMethodArgumentResolver.java

5
spring-core/src/main/java/org/springframework/core/convert/Property.java

@ -47,8 +47,7 @@ import org.springframework.util.StringUtils; @@ -47,8 +47,7 @@ import org.springframework.util.StringUtils;
*/
public final class Property {
private static Map<Property, Annotation[]> annotationCache =
new ConcurrentReferenceHashMap<>();
private static Map<Property, Annotation[]> annotationCache = new ConcurrentReferenceHashMap<>();
private final Class<?> objectType;
@ -72,7 +71,7 @@ public final class Property { @@ -72,7 +71,7 @@ public final class Property {
this.readMethod = readMethod;
this.writeMethod = writeMethod;
this.methodParameter = resolveMethodParameter();
this.name = (name == null ? resolveName() : name);
this.name = (name != null ? name : resolveName());
}

3
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AbstractNamedValueMethodArgumentResolver.java

@ -108,8 +108,7 @@ public abstract class AbstractNamedValueMethodArgumentResolver implements Handle @@ -108,8 +108,7 @@ public abstract class AbstractNamedValueMethodArgumentResolver implements Handle
}
if (!ClassUtils.isAssignableValue(parameter.getParameterType(), arg)) {
arg = this.conversionService.convert(
arg, TypeDescriptor.valueOf(arg.getClass()), new TypeDescriptor(parameter));
arg = this.conversionService.convert(arg, TypeDescriptor.forObject(arg), new TypeDescriptor(parameter));
}
handleResolvedValue(arg, namedValueInfo.name, parameter, message);

Loading…
Cancel
Save