Skip to content

Commit 32001a6

Browse files
committed
Merge branch '2.7' into 2.8
2 parents 33c8e7d + 6b9782b commit 32001a6

File tree

2 files changed

+27
-33
lines changed

2 files changed

+27
-33
lines changed

release-notes/VERSION

+8-22
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ Project: jackson-databind
2525

2626
#935: `@JsonProperty(access = Access.READ_ONLY)` - unexpected behaviour
2727
#1317: '@JsonIgnore' annotation not working with creator properties, serialization
28-
#1367: No Object Id found for an instance when using `@ConstructorProperties`
29-
#1505: @JsonEnumDefaultValue should take precedence over FAIL_ON_NUMBERS_FOR_ENUMS
30-
(suggested by Stephan S)
31-
#1506: Missing `KeyDeserializer` for `CharSequence`
32-
#1513: `MapSerializer._orderEntries()` throws NPE when operating on `ConcurrentHashMap`
33-
(reported by Sovietaced@github)
34-
- Simplified processing of class annotations (for `AnnotatedClass`) to try to
35-
solve rare concurrency problems with "root name" annotations.
3628

3729
2.8.6 (12-Jan-2017)
3830

@@ -168,23 +160,17 @@ Project: jackson-databind
168160
#1277: Add caching of resolved generic types for `TypeFactory`
169161
(requested by Andriy P)
170162

171-
2.7.9 (not released yet)
163+
164+
2.7.9 (04-Feb-2017)
172165

173166
#1367: No Object Id found for an instance when using `@ConstructorProperties`
174-
(reported by kajo-bellabeat@github; fix by diegode@github)
175-
#1432: Off by 1 bug in PropertyValueBuffer
176-
(reported by Kevin D)
177-
#1439: NPE when using with filter id, serializing `java.util.Map` types
178-
#1451: Type parameter not passed by `ObjectWriter` if serializer pre-fetch disabled
179-
(reported by Frédéric C)
180-
#1456: `TypeFactory` type resolution broken in 2.7 for generic types
181-
when using `constructType` with context
182-
(reported by Dmitry S)
183-
#1476: Wrong constructor picked up when deserializing object
184-
(reported by laurentgo@github)
185-
#1501: `ArrayIndexOutOfBoundsException` on non-static inner class constructor
186-
(reported by Kevin H)
167+
#1505: @JsonEnumDefaultValue should take precedence over FAIL_ON_NUMBERS_FOR_ENUMS
168+
(suggested by Stephan S)
187169
#1506: Missing `KeyDeserializer` for `CharSequence`
170+
#1513: `MapSerializer._orderEntries()` throws NPE when operating on `ConcurrentHashMap`
171+
(reported by Sovietaced@github)
172+
- Simplified processing of class annotations (for `AnnotatedClass`) to try to
173+
solve rare concurrency problems with "root name" annotations.
188174

189175
2.7.8 (26-Sep-2016)
190176

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

+19-11
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public final class AnnotatedClass
116116
* Member methods of interest; for now ones with 0 or 1 arguments
117117
* (just optimization, since others won't be used now)
118118
*/
119-
protected AnnotatedMethodMap _memberMethods;
119+
protected AnnotatedMethodMap _memberMethods;
120120

121121
/**
122122
* Member fields of interest: ones that are either public,
@@ -538,23 +538,28 @@ private void resolveCreators()
538538
*/
539539
private void resolveMemberMethods()
540540
{
541-
_memberMethods = new AnnotatedMethodMap();
541+
_memberMethods = _resolveMemberMethods();
542+
}
543+
544+
private AnnotatedMethodMap _resolveMemberMethods()
545+
{
546+
AnnotatedMethodMap memberMethods = new AnnotatedMethodMap();
542547
AnnotatedMethodMap mixins = new AnnotatedMethodMap();
543548
// first: methods from the class itself
544-
_addMemberMethods(_class, this, _memberMethods, _primaryMixIn, mixins);
549+
_addMemberMethods(_class, this, memberMethods, _primaryMixIn, mixins);
545550

546551
// and then augment these with annotations from super-types:
547552
for (JavaType type : _superTypes) {
548553
Class<?> mixin = (_mixInResolver == null) ? null : _mixInResolver.findMixInClassFor(type.getRawClass());
549554
_addMemberMethods(type.getRawClass(),
550555
new TypeResolutionContext.Basic(_typeFactory, type.getBindings()),
551-
_memberMethods, mixin, mixins);
556+
memberMethods, mixin, mixins);
552557
}
553558
// Special case: mix-ins for Object.class? (to apply to ALL classes)
554559
if (_mixInResolver != null) {
555560
Class<?> mixin = _mixInResolver.findMixInClassFor(Object.class);
556561
if (mixin != null) {
557-
_addMethodMixIns(_class, _memberMethods, mixin, mixins);
562+
_addMethodMixIns(_class, memberMethods, mixin, mixins);
558563
}
559564
}
560565

@@ -575,14 +580,15 @@ private void resolveMemberMethods()
575580
// Since it's from java.lang.Object, no generics, no need for real type context:
576581
AnnotatedMethod am = _constructMethod(m, this);
577582
_addMixOvers(mixIn.getAnnotated(), am, false);
578-
_memberMethods.add(am);
583+
memberMethods.add(am);
579584
}
580585
} catch (Exception e) { }
581586
}
582587
}
583588
}
589+
return memberMethods;
584590
}
585-
591+
586592
/**
587593
* Method that will collect all member (non-static) fields
588594
* that are either public, or have at least a single annotation
@@ -591,14 +597,16 @@ private void resolveMemberMethods()
591597
private void resolveFields()
592598
{
593599
Map<String,AnnotatedField> foundFields = _findFields(_type, this, null);
600+
List<AnnotatedField> f;
594601
if (foundFields == null || foundFields.size() == 0) {
595-
_fields = Collections.emptyList();
602+
f = Collections.emptyList();
596603
} else {
597-
_fields = new ArrayList<AnnotatedField>(foundFields.size());
598-
_fields.addAll(foundFields.values());
604+
f = new ArrayList<AnnotatedField>(foundFields.size());
605+
f.addAll(foundFields.values());
599606
}
607+
_fields = f;
600608
}
601-
609+
602610
/*
603611
/**********************************************************
604612
/* Helper methods for resolving class annotations

0 commit comments

Comments
 (0)