DATACMNS-867 - Second draft.

This commit is contained in:
Oliver Gierke
2016-06-21 16:52:28 +02:00
parent 57ed50a730
commit d4811e29d9
222 changed files with 2297 additions and 2138 deletions

View File

@@ -107,11 +107,11 @@ class ProjectingMethodInterceptor implements MethodInterceptor {
sources.size());
for (Object source : sources) {
result.add(getProjection(source, type.getComponentType().getType()));
result.add(getProjection(source, type.getRequiredComponentType().getType()));
}
if (rawType.isArray()) {
return result.toArray((Object[]) Array.newInstance(type.getComponentType().getType(), result.size()));
return result.toArray((Object[]) Array.newInstance(type.getRequiredComponentType().getType(), result.size()));
}
return result;
@@ -130,7 +130,7 @@ class ProjectingMethodInterceptor implements MethodInterceptor {
Map<Object, Object> result = CollectionFactory.createMap(type.getType(), sources.size());
for (Entry<?, ?> source : sources.entrySet()) {
result.put(source.getKey(), getProjection(source.getValue(), type.getMapValueType().getType()));
result.put(source.getKey(), getProjection(source.getValue(), type.getRequiredMapValueType().getType()));
}
return result;

View File

@@ -144,7 +144,7 @@ class ProxyProjectionFactory implements ProjectionFactory, ResourceLoaderAware,
Assert.notNull(projectionType, "Projection type must not be null!");
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
for (PropertyDescriptor descriptor : getProjectionInformation(projectionType).getInputProperties()) {
result.add(descriptor.getName());

View File

@@ -70,7 +70,7 @@ public class SpelAwareProxyProjectionFactory extends ProxyProjectionFactory impl
if (!typeCache.containsKey(projectionType)) {
AnnotationDetectionMethodCallback<Value> callback = new AnnotationDetectionMethodCallback<Value>(Value.class);
AnnotationDetectionMethodCallback<Value> callback = new AnnotationDetectionMethodCallback<>(Value.class);
ReflectionUtils.doWithMethods(projectionType, callback);
typeCache.put(projectionType, callback.hasFoundAnnotation());