You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/10/10 11:30:33 UTC

[camel] branch camel-3.x updated: Mapstruct: Method must be public in DefaultMapStructFinder.discoverMappings (#11261)

This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.x by this push:
     new f2034db6047 Mapstruct: Method must be public in DefaultMapStructFinder.discoverMappings (#11261)
f2034db6047 is described below

commit f2034db6047b8078eafde7fc9f7751c1d58fbb32
Author: Giacomo <gc...@imolainformatica.it>
AuthorDate: Thu Aug 31 20:27:00 2023 +0200

    Mapstruct: Method must be public in DefaultMapStructFinder.discoverMappings (#11261)
---
 .../org/apache/camel/component/mapstruct/DefaultMapStructFinder.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/components/camel-mapstruct/src/main/java/org/apache/camel/component/mapstruct/DefaultMapStructFinder.java b/components/camel-mapstruct/src/main/java/org/apache/camel/component/mapstruct/DefaultMapStructFinder.java
index f68993ed877..4c335c8b7ad 100644
--- a/components/camel-mapstruct/src/main/java/org/apache/camel/component/mapstruct/DefaultMapStructFinder.java
+++ b/components/camel-mapstruct/src/main/java/org/apache/camel/component/mapstruct/DefaultMapStructFinder.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.mapstruct;
 
+import java.lang.reflect.Modifier;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.camel.CamelContext;
@@ -58,6 +59,10 @@ public class DefaultMapStructFinder extends ServiceSupport implements MapStructM
             final Object mapper = Mappers.getMapper(clazz);
             if (mapper != null) {
                 ReflectionHelper.doWithMethods(mapper.getClass(), mc -> {
+                    // must be public
+                    if (!Modifier.isPublic(mc.getModifiers())) {
+                        return;
+                    }
                     // must not be a default method
                     if (mc.isDefault()) {
                         return;