Skip to content

Commit

Permalink
Minor javadoc additions wrt #868, change jackson-core/annotations dep…
Browse files Browse the repository at this point in the history
…s to 2.6.0 (release)
  • Loading branch information
cowtowncoder committed Jul 17, 2015
1 parent 4333eb6 commit a23ff9f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-parent</artifactId>
<version>2.6.0-rc1</version>
<version>2.6.1</version>
</parent>

<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.0-rc5-SNAPSHOT</version>
<version>2.6.0-SNAPSHOT</version>
<name>jackson-databind</name>
<packaging>bundle</packaging>
<description>General data-binding functionality for Jackson: works on core streaming API</description>
Expand All @@ -20,7 +20,7 @@
<connection>scm:git:[email protected]:FasterXML/jackson-databind.git</connection>
<developerConnection>scm:git:[email protected]:FasterXML/jackson-databind.git</developerConnection>
<url>http://github.com/FasterXML/jackson-databind</url>
<tag>jackson-databind-2.6.0-rc3</tag>
<tag>HEAD</tag>
</scm>

<properties>
Expand Down Expand Up @@ -69,12 +69,12 @@ javax.xml.datatype, javax.xml.namespace, javax.xml.parsers
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.6.0-rc3</version>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.6.0-rc3</version>
<version>2.6.0</version>
</dependency>

<!-- and for testing we need a few libraries
Expand Down
1 change: 1 addition & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Project: jackson-databind
#840: Change semantics of `@JsonPropertyOrder(alphabetic)` to only count `true` value
#848: Custom serializer not used if POJO has `@JsonValue`
#849: Possible problem with `NON_EMPTY` exclusion, `int`s, `Strings`
#868: Annotations are lost in the case of duplicate methods
- Remove old cglib compatibility tests; cause problems in Eclipse
- Add `withFilterId()` method in `JsonSerializer` (demote from `BeanSerializer`)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.io.IOException;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.deser.ContextualDeserializer;
import com.fasterxml.jackson.databind.deser.ResolvableDeserializer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,15 @@ private AnnotationMap _mergeAnnotations(int index, Linked<? extends AnnotatedMem
return ann;
}

/**
* Replacement, as per [databind#868], of simple access to annotations, which
* does "deep merge" if an as necessary.
*<pre>
* nodes[index].value.getAllAnnotations()
*</pre>
*
* @since 2.6
*/
private <T extends AnnotatedMember> AnnotationMap _getAllAnnotations(Linked<T> node) {
AnnotationMap ann = node.value.getAllAnnotations();
if (node.next != null) {
Expand All @@ -722,7 +731,17 @@ private <T extends AnnotatedMember> AnnotationMap _getAllAnnotations(Linked<T> n
return ann;
}

/**
* Helper method to handle recursive merging of annotations within accessor class,
* to ensure no annotations are accidentally dropped within chain when non-visible
* and secondary accessors are pruned later on.
*<p>
* See [databind#868] for more information.
*
* @since 2.6
*/
private <T extends AnnotatedMember> Linked<T> _applyAnnotations(Linked<T> node, AnnotationMap ann) {
@SuppressWarnings("unchecked")
T value = (T) node.value.withAnnotations(ann);
if (node.next != null) {
node = node.withNext(_applyAnnotations(node.next, ann));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void testPointerLoadingMappingIteratorOne() throws Exception {
assertTrue(pojo.name.containsKey("value"));
assertEquals(1234, pojo.name.get("value"));
assertFalse(itr.hasNext());
itr.close();
}

public void testPointerLoadingMappingIteratorMany() throws Exception {
Expand All @@ -101,5 +102,6 @@ public void testPointerLoadingMappingIteratorMany() throws Exception {
assertTrue(pojo.name.containsKey("value"));
assertEquals(5678, pojo.name.get("value"));
assertFalse(itr.hasNext());
itr.close();
}
}

0 comments on commit a23ff9f

Please sign in to comment.