From 36b95d39cea9f3560a6d989241d14c2c3352c764 Mon Sep 17 00:00:00 2001 From: Wilds Date: Sat, 26 Oct 2019 02:42:06 +0200 Subject: [PATCH] DATACMNS-1598 - Fix interface projection returning EnumSet. EnumSet's are now constructed with a proper component type. Original pull request: #409. --- .../data/projection/ProjectingMethodInterceptor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java b/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java index 486d13362..a52692b9e 100644 --- a/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java +++ b/src/main/java/org/springframework/data/projection/ProjectingMethodInterceptor.java @@ -93,7 +93,7 @@ class ProjectingMethodInterceptor implements MethodInterceptor { Class rawType = type.getType(); Collection result = CollectionFactory.createCollection(rawType.isArray() ? List.class : rawType, - sources.size()); + type.getComponentType().getType(), sources.size()); for (Object source : sources) { result.add(getProjection(source, type.getRequiredComponentType().getType()));