Skip to content

Commit 8b4a4cd

Browse files
committed
Fix a regression resulting from removal of ClassUtil caching of access to methods etc.
1 parent c745da5 commit 8b4a4cd

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ public void resolve(DeserializationContext ctxt)
515515
// Need to link managed references with matching back references
516516
prop = _resolveManagedReferenceProperty(ctxt, prop);
517517

518-
// [databind#351[: need to wrap properties that require object id resolution.
518+
// [databind#351]: need to wrap properties that require object id resolution.
519519
if (!(prop instanceof ManagedReferenceProperty)) {
520520
prop = _resolvedObjectIdProperty(ctxt, prop);
521521
}

src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBuilder.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ public void addBackReferenceProperty(String referenceName, SettableBeanProperty
183183
if (_backRefProperties == null) {
184184
_backRefProperties = new HashMap<String, SettableBeanProperty>(4);
185185
}
186+
// 15-Sep-2016, tatu: For some reason fixing access at point of `build()` does
187+
// NOT work (2 failing unit tests). Not 100% clear why, but for now force
188+
// access set early; unfortunate, but since it works....
189+
prop.fixAccess(_config);
186190
_backRefProperties.put(referenceName, prop);
187191
// also: if we had property with same name, actually remove it
188192
if (_properties != null) {
@@ -207,7 +211,7 @@ public void addInjectable(PropertyName propName, JavaType propType,
207211
_injectables.add(new ValueInjector(propName, propType,
208212
contextAnnotations, member, valueId));
209213
}
210-
214+
211215
/**
212216
* Method that will add property name as one of properties that can
213217
* be ignored if not recognized.
@@ -462,11 +466,15 @@ private void _fixAccess(Collection<SettableBeanProperty> mainProps)
462466
*/
463467
prop.fixAccess(_config);
464468
}
469+
// 15-Sep-2016, tatu: Access via back-ref properties has been done earlier
470+
// as it has to, for some reason, so not repeated here.
471+
/*
465472
if (_backRefProperties != null) {
466473
for (SettableBeanProperty prop : _backRefProperties.values()) {
467474
prop.fixAccess(_config);
468475
}
469476
}
477+
*/
470478
if (_anySetter != null) {
471479
_anySetter.fixAccess(_config);
472480
}

src/main/java/com/fasterxml/jackson/databind/deser/impl/FieldProperty.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public final void set(Object instance, Object value) throws IOException
132132
try {
133133
_field.set(instance, value);
134134
} catch (Exception e) {
135-
// 15-Sep-2015, tatu: How coud we get a ref to JsonParser?
135+
// 15-Sep-2015, tatu: How could we get a ref to JsonParser?
136136
_throwAsIOE(e, value);
137137
}
138138
}
@@ -143,7 +143,7 @@ public Object setAndReturn(Object instance, Object value) throws IOException
143143
try {
144144
_field.set(instance, value);
145145
} catch (Exception e) {
146-
// 15-Sep-2015, tatu: How coud we get a ref to JsonParser?
146+
// 15-Sep-2015, tatu: How could we get a ref to JsonParser?
147147
_throwAsIOE(e, value);
148148
}
149149
return instance;

src/main/java/com/fasterxml/jackson/databind/deser/impl/ManagedReferenceProperty.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ public final class ManagedReferenceProperty
2222
private static final long serialVersionUID = 1L;
2323

2424
protected final String _referenceName;
25-
25+
2626
/**
2727
* Flag that indicates whether property to handle is a container type
2828
* (array, Collection, Map) or not.
2929
*/
3030
protected final boolean _isContainer;
31-
31+
3232
protected final SettableBeanProperty _managedProperty;
3333

3434
protected final SettableBeanProperty _backProperty;
35-
35+
3636
public ManagedReferenceProperty(SettableBeanProperty forward, String refName,
3737
SettableBeanProperty backward, Annotations contextAnnotations, boolean isContainer)
3838
{
@@ -66,7 +66,7 @@ protected ManagedReferenceProperty(ManagedReferenceProperty src, PropertyName ne
6666
public ManagedReferenceProperty withName(PropertyName newName) {
6767
return new ManagedReferenceProperty(this, newName);
6868
}
69-
69+
7070
@Override
7171
public ManagedReferenceProperty withValueDeserializer(JsonDeserializer<?> deser) {
7272
return new ManagedReferenceProperty(this, deser);
@@ -83,7 +83,7 @@ public void fixAccess(DeserializationConfig config) {
8383
/* BeanProperty impl
8484
/**********************************************************
8585
*/
86-
86+
8787
@Override
8888
public <A extends Annotation> A getAnnotation(Class<A> acls) {
8989
return _managedProperty.getAnnotation(acls);

src/main/java/com/fasterxml/jackson/databind/deser/impl/MethodProperty.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public Object deserializeSetAndReturn(JsonParser p,
119119
return null;
120120
}
121121
}
122-
122+
123123
@Override
124124
public final void set(Object instance, Object value) throws IOException
125125
{

0 commit comments

Comments
 (0)