Skip to content

Commit

Permalink
Fix #771
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Apr 27, 2015
1 parent 6dcb13f commit db612bb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions release-notes/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,8 @@ John Meyer (jpmeyer@github)
* Reported, contributed fix for #745: EnumDeserializer.deserializerForCreator() fails
when used to deserialize a Map key
(2.5.3)

Andrew Duckett (andrewduckett@github)
* Reported #771: Annotation bundles ignored when added to Mixin
(2.5.4)

2 changes: 2 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Project: jackson-databind

2.5.4 (not yet released)

#771: Annotation bundles ignored when added to Mixin
(reported by Andrew D)
- Fix handling of Enums wrt JSON Schema, when 'toString()' used for serialization

2.5.3 (24-Apr-2015)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ private void resolveMemberMethods()
AnnotatedMethodMap mixins = new AnnotatedMethodMap();
// first: methods from the class itself
_addMemberMethods(_class, _memberMethods, _primaryMixIn, mixins);

// and then augment these with annotations from super-types:
for (Class<?> cls : _superTypes) {
Class<?> mixin = (_mixInResolver == null) ? null : _mixInResolver.findMixInClassFor(cls);
Expand Down Expand Up @@ -594,7 +594,7 @@ protected void _addMemberMethods(Class<?> cls, AnnotatedMethodMap methods,
// first, mixIns, since they have higher priority then class methods
if (mixInCls != null) {
_addMethodMixIns(cls, methods, mixInCls, mixIns);
}
}
if (cls == null) { // just so caller need not check when passing super-class
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public boolean addIfNotPresent(Annotation ann)

/**
* Method called to add specified annotation in the Map.
*
* @return True if the addition changed the contents, that is, this map did not
* already have specified annotation
*/
public boolean add(Annotation ann) {
return _add(ann);
Expand All @@ -106,7 +109,7 @@ protected final boolean _add(Annotation ann) {
_annotations = new HashMap<Class<? extends Annotation>,Annotation>();
}
Annotation previous = _annotations.put(ann.annotationType(), ann);
return (previous != null) && previous.equals(ann);
return (previous == null) || !previous.equals(ann);
}
}

Expand Down

0 comments on commit db612bb

Please sign in to comment.