You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "carnevalegiacomo (via GitHub)" <gi...@apache.org> on 2023/08/31 16:33:29 UTC

[GitHub] [camel] carnevalegiacomo opened a new pull request, #11261: Mapstruct: Method must be public in DefaultMapStructFinder.discoverMa…

carnevalegiacomo opened a new pull request, #11261:
URL: https://github.com/apache/camel/pull/11261

   Mapstruct component works with 4.0.0-RC2 version but It doesn't work with 4.0.0 version (get java.lang.IllegalAccessException).
   
   In the 4.0.0, the method discoverMappings (class DefaultMapStructFinder) considers implementation classes (autogenerated) and not interfaces.
   
   Sometimes, in the implementation classes, there are private methods and so discoverMappings method throws java.lang.IllegalAccessException.
   
   ## Skip private and protected methods
   ### org.apache.camel.component.mapstruct.DefaultMapStructFinder:discoverMappings
   ```java
       @Override
       public int discoverMappings(Class<?> clazz) {
           final AtomicInteger answer = new AtomicInteger();
           try {
               // is there a generated mapper
               final Object mapper = Mappers.getMapper(clazz);
               if (mapper != null) {
                   ReflectionHelper.doWithMethods(mapper.getClass(), mc -> {
                       // must be public
                       if (!Modifier.isPublic(mc.getModifiers())) {
                           return;
                       }
   ............
   ```
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus merged pull request #11261: Mapstruct: Method must be public in DefaultMapStructFinder.discoverMa…

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #11261:
URL: https://github.com/apache/camel/pull/11261


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #11261: Mapstruct: Method must be public in DefaultMapStructFinder.discoverMa…

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11261:
URL: https://github.com/apache/camel/pull/11261#issuecomment-1701385905

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :camel: Maintainers, please note that first-time contributors *require manual approval* for the GitHub Actions to run.
   
   :warning: Please note that the changes on this PR may be **tested automatically** if they change components.
   
   :robot: Use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot.
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org