Polishing

This commit is contained in:
Juergen Hoeller
2015-11-14 23:52:39 +01:00
parent 4b682275c9
commit 1cb6069734
2 changed files with 5 additions and 5 deletions

View File

@@ -389,9 +389,9 @@ abstract class SerializableTypeWrapper {
public Type getType() {
Object result = this.result;
if (result == null) {
// Lazy invocation of the target method
// Lazy invocation of the target method on the provided type
result = ReflectionUtils.invokeMethod(this.method, this.provider.getType());
// Cache the result for further calls
// Cache the result for further calls to getType()
this.result = result;
}
return (result instanceof Type[] ? ((Type[]) result)[this.index] : (Type) result);
@@ -405,7 +405,7 @@ abstract class SerializableTypeWrapper {
private void readObject(ObjectInputStream inputStream) throws IOException, ClassNotFoundException {
inputStream.defaultReadObject();
this.method = ReflectionUtils.findMethod(this.provider.getType().getClass(), this.methodName);
Assert.state(this.method.getReturnType() == Type.class || this.method.getReturnType() == Type[].class);
Assert.state(Type.class == this.method.getReturnType() || Type[].class == this.method.getReturnType());
}
}