Skip to content

Commit

Permalink
Fix #2519
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Oct 24, 2019
1 parent 293f736 commit dc09248
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 28 deletions.
5 changes: 5 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -990,3 +990,8 @@ Johan Haleby (johanhaleby@github)
* Reported #2513: BigDecimalAsStringSerializer in NumberSerializer throws IllegalStateException
in 2.10
(2.10.1)
Richard Wise (Woodz@github)
* Reported #2519: Serializing `BigDecimal` values inside containers ignores shape override
(2.10.1)
2 changes: 2 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Project: jackson-databind
(contributed by Marc M)
#2513: BigDecimalAsStringSerializer in NumberSerializer throws IllegalStateException in 2.10
(reported by Johan H)
#2519: Serializing `BigDecimal` values inside containers ignores shape override
(reported by Richard W)

2.10.0 (26-Sep-2019)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ public abstract class ConcreteBeanPropertyBase
*/
protected final PropertyMetadata _metadata;

/**
* Lazily accessed value for per-property format override definition.
*
* @since 2.8
*/
protected transient JsonFormat.Value _propertyFormat;

/**
* @since 2.9
*/
Expand All @@ -47,7 +40,6 @@ protected ConcreteBeanPropertyBase(PropertyMetadata md) {

protected ConcreteBeanPropertyBase(ConcreteBeanPropertyBase src) {
_metadata = src._metadata;
_propertyFormat = src._propertyFormat;
}

@Override
Expand Down Expand Up @@ -78,27 +70,19 @@ public final JsonFormat.Value findFormatOverrides(AnnotationIntrospector intr) {
@Override
public JsonFormat.Value findPropertyFormat(MapperConfig<?> config, Class<?> baseType)
{
// 15-Apr-2016, tatu: Let's calculate lazily, retain; assumption being however that
// baseType is always the same
JsonFormat.Value v = _propertyFormat;
if (v == null) {
JsonFormat.Value v1 = config.getDefaultPropertyFormat(baseType);
JsonFormat.Value v2 = null;
AnnotationIntrospector intr = config.getAnnotationIntrospector();
if (intr != null) {
AnnotatedMember member = getMember();
if (member != null) {
v2 = intr.findFormat(member);
}
}
if (v1 == null) {
v = (v2 == null) ? EMPTY_FORMAT : v2;
} else {
v = (v2 == null) ? v1 : v1.withOverrides(v2);
JsonFormat.Value v1 = config.getDefaultPropertyFormat(baseType);
JsonFormat.Value v2 = null;
AnnotationIntrospector intr = config.getAnnotationIntrospector();
if (intr != null) {
AnnotatedMember member = getMember();
if (member != null) {
v2 = intr.findFormat(member);
}
_propertyFormat = v;
}
return v;
if (v1 == null) {
return (v2 == null) ? EMPTY_FORMAT : v2;
}
return (v2 == null) ? v1 : v1.withOverrides(v2);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.ser.jdk;

import java.math.BigDecimal;
import java.util.*;
Expand Down

0 comments on commit dc09248

Please sign in to comment.