Skip to content

Commit bf42522

Browse files
committed
Backport for #379 in 2.3
1 parent e0e97bc commit bf42522

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

release-notes/VERSION

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ Version: 2.3.2 (xx-xxx-2014)
33

44
#378: Fix a problem with custom enum deserializer construction
55
(reported by BokoEnos@github)
6+
#379: Fix a problem with (re)naming of Creator properties; needed to make
7+
Paranamer module work with NamingStrategy.
8+
(reported by Chris P, cpilsworth@github)
69

710
------------------------------------------------------------------------
811
=== History: ===

src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -700,16 +700,8 @@ protected void _renameProperties()
700700
} else {
701701
old.addAll(prop);
702702
}
703-
704703
// replace the creatorProperty too, if there is one
705-
if (_creatorProperties != null) {
706-
for (int i = 0; i < _creatorProperties.size(); ++i) {
707-
if (_creatorProperties.get(i).getInternalName().equals(prop.getInternalName())) {
708-
_creatorProperties.set(i, prop);
709-
break;
710-
}
711-
}
712-
}
704+
_updateCreatorProperty(prop, _creatorProperties);
713705
}
714706
}
715707
}
@@ -757,6 +749,8 @@ protected void _renameUsing(PropertyNamingStrategy naming)
757749
} else {
758750
old.addAll(prop);
759751
}
752+
// replace the creatorProperty too, if there is one
753+
_updateCreatorProperty(prop, _creatorProperties);
760754
}
761755
}
762756

@@ -858,4 +852,15 @@ private PropertyNamingStrategy _findNamingStrategy()
858852
return (PropertyNamingStrategy) ClassUtil.createInstance(namingClass,
859853
_config.canOverrideAccessModifiers());
860854
}
855+
856+
protected void _updateCreatorProperty(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties) {
857+
if (creatorProperties != null) {
858+
for (int i = 0, len = creatorProperties.size(); i < len; ++i) {
859+
if (creatorProperties.get(i).getInternalName().equals(prop.getInternalName())) {
860+
creatorProperties.set(i, prop);
861+
break;
862+
}
863+
}
864+
}
865+
}
861866
}

0 commit comments

Comments
 (0)