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 092bd8dcb9 Marshall module improvements
092bd8dcb9 is described below
commit 092bd8dcb98dfc9271145a554fc89262bd55253a
Author: James Bognar <[email protected]>
AuthorDate: Tue Dec 9 10:13:46 2025 -0500
Marshall module improvements
---
.../src/main/java/org/apache/juneau/BeanMap.java | 2 +-
.../src/main/java/org/apache/juneau/BeanMeta.java | 14 +++++---------
.../src/main/java/org/apache/juneau/BeanSession.java | 2 +-
3 files changed, 7 insertions(+), 11 deletions(-)
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
index c39d68f264..5005c9daf4 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
@@ -106,7 +106,7 @@ public class BeanMap<T> extends AbstractMap<String,Object>
implements Delegate<T
this.session = session;
this.bean = bean;
this.meta = meta;
- if (meta.constructorArgs.length > 0)
+ if (isNotEmpty(meta.getConstructorArgs()))
propertyCache = new TreeMap<>();
this.typePropertyName =
session.getBeanTypePropertyName(meta.classMeta);
}
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 b1ada01321..1427ceda25 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
@@ -485,10 +485,7 @@ public class BeanMeta<T> {
}
/** The constructor for this bean. */
- protected final BeanConstructor constructor2;
-
- /** For beans with constructors with Beanc annotation, this is the list
of constructor arg properties. */
- protected final String[] constructorArgs;
+ protected final BeanConstructor beanConstructor;
// Other fields
final String typePropertyName; // "_type"
property actual name.
@@ -900,8 +897,7 @@ public class BeanMeta<T> {
this.getterProps = u(getterProps);
this.setterProps = u(setterProps);
this.dynaProperty = dynaProperty.get();
- this.constructorArgs = constructorArgs.get();
- this.constructor2 = new BeanConstructor(opt(constructor.get()),
l(constructorArgs.get()));
+ this.beanConstructor = new
BeanConstructor(opt(constructor.get()), l(constructorArgs.get()));
this.sortProperties = sortProperties;
this.typeProperty = BeanPropertyMeta.builder(this,
typePropertyName).canRead().canWrite().rawMetaType(ctx.string()).beanRegistry(beanRegistry.get()).build();
@@ -913,15 +909,15 @@ public class BeanMeta<T> {
}
protected boolean hasConstructor() {
- return constructor2.constructor().isPresent();
+ return beanConstructor.constructor().isPresent();
}
protected ConstructorInfo getConstructor() {
- return constructor2.constructor().orElse(null);
+ return beanConstructor.constructor().orElse(null);
}
protected List<String> getConstructorArgs() {
- return constructor2.args();
+ return beanConstructor.args();
}
@Override /* Overridden from Object */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java
index 7006796ea7..de7c08f462 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java
@@ -1025,7 +1025,7 @@ public class BeanSession extends ContextSession {
if (m == null)
return null;
T bean = null;
- if (m.constructorArgs.length == 0)
+ if (isEmpty(m.getConstructorArgs()))
bean = newBean(outer, c);
return new BeanMap<>(this, bean, m);
}