|
5 | 5 |
|
6 | 6 | import com.fasterxml.jackson.annotation.JacksonInject;
|
7 | 7 | import com.fasterxml.jackson.annotation.JsonCreator;
|
8 |
| -import com.fasterxml.jackson.annotation.JsonProperty; |
9 | 8 |
|
10 | 9 | import com.fasterxml.jackson.databind.*;
|
11 | 10 |
|
@@ -872,12 +871,20 @@ protected void _renameProperties(Map<String, POJOPropertyBuilder> props)
|
872 | 871 | old.addAll(prop);
|
873 | 872 | }
|
874 | 873 | // replace the creatorProperty too, if there is one
|
875 |
| - _updateCreatorProperty(prop, _creatorProperties); |
876 |
| - // [databind#2001]: New name of property was ignored previously? Remove from ignored |
877 |
| - // 01-May-2018, tatu: I have a feeling this will need to be revisited at some point, |
878 |
| - // to avoid removing some types of removals, possibly. But will do for now. |
879 |
| - if (_ignoredPropertyNames != null) { |
880 |
| - _ignoredPropertyNames.remove(name); |
| 874 | + if (_updateCreatorProperty(prop, _creatorProperties)) { |
| 875 | + // [databind#2001]: New name of property was ignored previously? Remove from ignored |
| 876 | + // 01-May-2018, tatu: I have a feeling this will need to be revisited at some point, |
| 877 | + // to avoid removing some types of removals, possibly. But will do for now. |
| 878 | + |
| 879 | + // 16-May-2020, tatu: ... and so the day came, [databind#2118] failed |
| 880 | + // when explicit rename added to ignorals (for READ_ONLY) was suddenly |
| 881 | + // removed from ignoral list. So, added a guard statement above so that |
| 882 | + // ignoral is ONLY removed if there was matching creator property. |
| 883 | + // |
| 884 | + // Chances are this is not the last tweak we need but... that bridge then etc |
| 885 | + if (_ignoredPropertyNames != null) { |
| 886 | + _ignoredPropertyNames.remove(name); |
| 887 | + } |
881 | 888 | }
|
882 | 889 | }
|
883 | 890 | }
|
@@ -1174,16 +1181,17 @@ private PropertyNamingStrategy _findNamingStrategy()
|
1174 | 1181 | _config.canOverrideAccessModifiers());
|
1175 | 1182 | }
|
1176 | 1183 |
|
1177 |
| - protected void _updateCreatorProperty(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties) { |
| 1184 | + protected boolean _updateCreatorProperty(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties) { |
1178 | 1185 |
|
1179 | 1186 | if (creatorProperties != null) {
|
1180 | 1187 | final String intName = prop.getInternalName();
|
1181 | 1188 | for (int i = 0, len = creatorProperties.size(); i < len; ++i) {
|
1182 | 1189 | if (creatorProperties.get(i).getInternalName().equals(intName)) {
|
1183 | 1190 | creatorProperties.set(i, prop);
|
1184 |
| - break; |
| 1191 | + return true; |
1185 | 1192 | }
|
1186 | 1193 | }
|
1187 | 1194 | }
|
| 1195 | + return false; |
1188 | 1196 | }
|
1189 | 1197 | }
|
0 commit comments