Skip to content

Commit

Permalink
Merge branch '2.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Dec 1, 2019
2 parents 4555a7e + f3da1aa commit af2ae8e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
4 changes: 4 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,10 @@ Mark Schäfer (mark--@github)
* Reported #2520: Sub-optimal exception message when failing to deserialize non-static inner classes
(2.10.1)
Fabian Lange (CodingFabian@github)
* Reported #2556: Contention in `TypeNameIdResolver.idFromClass()`
(2.10.2)
Ville Koskela (vjkoskela@github)
* Contributed #2487: BeanDeserializerBuilder Protected Factory Method for Extension
(2.11.0)
Expand Down
2 changes: 2 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Project: jackson-databind
(reported by Jon A)
#2553: JsonDeserialize(contentAs=...) broken with raw collections
(reported by cpopp@github)
#2556: Contention in `TypeNameIdResolver.idFromClass()`
(reported by Fabian L)
2.10.1 (09-Nov-2019)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,31 @@ protected String idFromClass(DatabindContext ctxt, Class<?> cls)
// `JavaType` being resolved, not underlying class. Hence commented out in
// 3.x. There should be better way to support whatever the use case is.

// 29-Nov-2019, tatu: Looking at 2.x, test in `TestTypeModifierNameResolution` suggested
// that use of `TypeModifier` was used for demoting some types (from impl class to
// interface. For what that's worth. Still not supported for 3.x until proven necessary

// cls = _typeFactory.constructType(cls).getRawClass();

final String key = cls.getName();
String name;

synchronized (_typeToId) {
name = _typeToId.get(key);
}

if (name == null) {
// 24-Feb-2011, tatu: As per [JACKSON-498], may need to dynamically look up name
// can either throw an exception, or use default name...
if (ctxt.isAnnotationProcessingEnabled()) {
name = ctxt.getAnnotationIntrospector().findTypeName(ctxt.getConfig(),
ctxt.introspectClassAnnotations(cls));
}
if (name == null) {
// 24-Feb-2011, tatu: As per [JACKSON-498], may need to dynamically look up name
// can either throw an exception, or use default name...
if (ctxt.isAnnotationProcessingEnabled()) {
name = ctxt.getAnnotationIntrospector().findTypeName(ctxt.getConfig(),
ctxt.introspectClassAnnotations(cls));
}
if (name == null) {
// And if still not found, let's choose default?
name = _defaultTypeId(cls);
}
// And if still not found, let's choose default?
name = _defaultTypeId(cls);
}
synchronized (_typeToId) {
_typeToId.put(key, name);
}
}
Expand Down

0 comments on commit af2ae8e

Please sign in to comment.