Skip to content

Commit

Permalink
Fix #635
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Nov 25, 2014
1 parent 35ec0dd commit 87e4661
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ javax.xml.datatype, javax.xml.namespace, javax.xml.parsers
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.4.4</version>
<version>2.4.5-SNAPSHOT</version>
</dependency>

<!-- and for testing we need a few libraries
Expand Down
5 changes: 5 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Project: jackson-databind
=== Releases ===
------------------------------------------------------------------------

2.4.5 (not yet released)

#635: Reduce cachability of `Map` deserializers, to avoid problems with per-property config changes
(regression due to #604)

2.4.4 (24-Nov-2014)

(jackson-core)#158: Setter confusion on assignable types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected final boolean _isStdKeyDeser(JavaType mapType, KeyDeserializer keyDese
return ((rawKeyType == String.class || rawKeyType == Object.class)
&& isDefaultKeyDeserializer(keyDeser));
}

public void setIgnorableProperties(String[] ignorable) {
_ignorableProperties = (ignorable == null || ignorable.length == 0) ?
null : ArrayBuilders.arrayToSet(ignorable);
Expand Down Expand Up @@ -285,11 +285,20 @@ public JsonDeserializer<Object> getContentDeserializer() {
/**
* Turns out that these are expensive enough to create so that caching
* does make sense.
*<p>
* IMPORTANT: but, note, that instances CAN NOT BE CACHED if there is
* a value type deserializer; this caused an issue with 2.4.4 of
* JAXB Annotations (failing a test).
* It is also possible that some other settings could make deserializers
* un-cacheable; but on the other hand, caching can make a big positive
* difference with performance... so it's a hard choice.
*
* @since 2.4.4
*/
@Override
public boolean isCachable() { return true; }
public boolean isCachable() {
return (_valueTypeDeserializer == null) && (_ignorableProperties == null);
}

@Override
@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -566,8 +575,8 @@ protected void wrapAndThrow(Throwable t, Object ref, String key) throws IOExcept
throw JsonMappingException.wrapWithPath(t, ref, key);
}

private void handleUnresolvedReference(JsonParser jp, MapReferringAccumulator accumulator, Object key,
UnresolvedForwardReference reference)
private void handleUnresolvedReference(JsonParser jp, MapReferringAccumulator accumulator,
Object key, UnresolvedForwardReference reference)
throws JsonMappingException
{
if (accumulator == null) {
Expand All @@ -577,7 +586,7 @@ private void handleUnresolvedReference(JsonParser jp, MapReferringAccumulator ac
reference.getRoid().appendReferring(referring);
}

private final static class MapReferringAccumulator {
private final static class MapReferringAccumulator {
private final Class<?> _valueType;
private Map<Object,Object> _result;
/**
Expand Down Expand Up @@ -641,7 +650,7 @@ private final static class MapReferring extends Referring {
public final Map<Object, Object> next = new LinkedHashMap<Object, Object>();
public final Object key;

private MapReferring(MapReferringAccumulator parent, UnresolvedForwardReference ref,
protected MapReferring(MapReferringAccumulator parent, UnresolvedForwardReference ref,
Class<?> valueType, Object key)
{
super(ref, valueType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class SimpleFilterProvider
extends FilterProvider
implements java.io.Serializable // since 2.1
{
// for 2.3.0
private static final long serialVersionUID = -6305772546718366447L;
// for 2.5+
private static final long serialVersionUID = 1L;

/**
* Mappings from ids to filters.
Expand Down

0 comments on commit 87e4661

Please sign in to comment.