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

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new eec672be71 Marshall module improvements
eec672be71 is described below

commit eec672be716677f6619a67520ac51cddf2b049ff
Author: James Bognar <[email protected]>
AuthorDate: Tue Dec 9 08:44:23 2025 -0500

    Marshall module improvements
---
 .../src/main/java/org/apache/juneau/BeanMeta.java            | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
index cac0326c63..7581ee04e3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
@@ -557,6 +557,8 @@ public class BeanMeta<T> {
 
        private final Supplier<BeanRegistry> beanRegistry;
 
+       private final Supplier<List<ClassInfo>> classHierarchy;
+
        final boolean sortProperties;
 
        final boolean fluentSetters;
@@ -572,6 +574,15 @@ public class BeanMeta<T> {
                return new BeanRegistry(ctx, null, 
beanDictionaryClasses.toArray(new Class<?>[beanDictionaryClasses.size()]));
        }
 
+       private List<ClassInfo> findClassHierarchy() {
+               var result = new LinkedList<ClassInfo>();
+               // If @Bean.interfaceClass is specified on the parent class, 
then we want
+               // to use the properties defined on that class, not the 
subclass.
+               var c2 = (nn(beanFilter) && nn(beanFilter.getInterfaceClass()) 
? beanFilter.getInterfaceClass() : c);
+               forEachClass(info(c2), stopClass, result::add);
+               return u(result);
+       }
+
        private String findDictionaryName() {
                if (nn(beanFilter) && nn(beanFilter.getTypeName()))
                        return beanFilter.getTypeName();
@@ -628,6 +639,7 @@ public class BeanMeta<T> {
                this.stopClass = opt(bf).map(x -> 
(Class)x.getStopClass()).orElse(Object.class);
 
                this.beanRegistry = memoize(()->findBeanRegistry());
+               this.classHierarchy = memoize(()->findClassHierarchy());
 
                // Local variables for initialization
                var ap = ctx.getAnnotationProvider();

Reply via email to