From e4283b9a4d23b1ffc518b3d181290072b00513bf Mon Sep 17 00:00:00 2001 From: Wilds Date: Sat, 26 Oct 2019 02:42:06 +0200 Subject: [PATCH] fix projection with EnumSet --- .../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 486d133623..a52692b9e5 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 @@ private Object projectCollectionElements(Collection sources, TypeInformation< 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()));