From f573637243b7f10f96f5ba02252be887a1f9ce8c Mon Sep 17 00:00:00 2001 From: Dario Date: Fri, 29 Nov 2024 23:24:30 +0100 Subject: [PATCH] fix return type check --- .../eu/koboo/en2do/mongodb/RepositoryInvocationHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/koboo/en2do/mongodb/RepositoryInvocationHandler.java b/src/main/java/eu/koboo/en2do/mongodb/RepositoryInvocationHandler.java index e5e90d2..299c154 100644 --- a/src/main/java/eu/koboo/en2do/mongodb/RepositoryInvocationHandler.java +++ b/src/main/java/eu/koboo/en2do/mongodb/RepositoryInvocationHandler.java @@ -108,7 +108,7 @@ private Object executeMethod(IndexedMethod indexedMethod, Object[] arg case FILTER: findIterable = repositoryMeta.createIterable(Filters.and((Bson) arguments[arguments.length - 1], filter), methodName); - if (method.getReturnType().isAssignableFrom(Collection.class)) { + if (Collection.class.isAssignableFrom(method.getReturnType())) { return findIterable.into(new ArrayList<>()); } return findIterable.first();