@@ -44,16 +44,18 @@ public List<BeanPropertyDefinition> updateProperties(DeserializationConfig confi
4444 if (acc == null ) {
4545 continue ;
4646 }
47- /* First: handle "as text"? Such properties
48- * are exposed as values of 'unnamed' fields; so one way to
49- * map them is to rename property to have name ""... (and
50- * hope this does not break other parts...)
51- */
47+ // First: handle "as text"? Such properties are exposed as values of 'unnamed'
48+ // properties; so one way to map them is to rename property to have special
49+ // name (and hope this does not break other parts...)
5250 Boolean b = AnnotationUtil .findIsTextAnnotation (config , intr , acc );
5351 if (b != null && b .booleanValue ()) {
54- // unwrapped properties will appear as 'unnamed' (empty String)
5552 BeanPropertyDefinition newProp = prop .withSimpleName (_cfgNameForTextValue );
5653 if (newProp != prop ) {
54+ // 24-Mar-2026, tatu: Create defensive copy
55+ if (changed == 0 ) {
56+ propDefs = new ArrayList <>(propDefs );
57+ }
58+ ++changed ;
5759 propDefs .set (i , newProp );
5860 }
5961 continue ;
@@ -67,7 +69,7 @@ public List<BeanPropertyDefinition> updateProperties(DeserializationConfig confi
6769 && !localName .equals (prop .getName ())) {
6870 // make copy-on-write as necessary
6971 if (changed == 0 ) {
70- propDefs = new ArrayList <BeanPropertyDefinition >(propDefs );
72+ propDefs = new ArrayList <>(propDefs );
7173 }
7274 ++changed ;
7375 propDefs .set (i , prop .withSimpleName (localName ));
0 commit comments