Skip to content

Commit

Permalink
Reorder annotation merging to solve 3 out of 4 remaining test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 26, 2017
1 parent 2f7dd37 commit 5ad1371
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ protected Map<String, POJOPropertyBuilder> getPropertyMap() {

/**
* Internal method that will collect actual property information.
*
* @since 2.6
*/
protected void collectAll()
{
Expand All @@ -299,17 +297,14 @@ protected void collectAll()
// Remove ignored properties, first; this MUST precede annotation merging
// since logic relies on knowing exactly which accessor has which annotation
_removeUnwantedProperties(props);

// then merge annotations, to simplify further processing
for (POJOPropertyBuilder property : props.values()) {
property.mergeAnnotations(_forSerialization);
}
// and then remove unneeded accessors (wrt read-only, read-write)
_removeUnwantedAccessor(props);

// Rename remaining properties
_renameProperties(props);

// then merge annotations, to simplify further processing
for (POJOPropertyBuilder property : props.values()) {
property.mergeAnnotations(_forSerialization);
}
// And use custom naming strategy, if applicable...
PropertyNamingStrategy naming = _findNamingStrategy();
if (naming != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public class POJOPropertyBuilder
/**
* Marker value used to denote that no reference-property information found for
* this property
*
* @since 2.9
*/
private final static AnnotationIntrospector.ReferenceProperty NOT_REFEFERENCE_PROP =
AnnotationIntrospector.ReferenceProperty.managed("");
Expand Down Expand Up @@ -400,9 +398,8 @@ public AnnotatedMethod getGetter()
}
// But if multiple, verify that they do not conflict...
for (; next != null; next = next.next) {
/* [JACKSON-255] Allow masking, i.e. do not report exception if one
* is in super-class from the other
*/
// Allow masking, i.e. do not report exception if one
// is in super-class from the other
Class<?> currClass = curr.value.getDeclaringClass();
Class<?> nextClass = next.value.getDeclaringClass();
if (currClass != nextClass) {
Expand Down

0 comments on commit 5ad1371

Please sign in to comment.