Skip to content

Commit 6ee24c3

Browse files
committed
Merge branch '2.10'
2 parents bf00c2d + b387940 commit 6ee24c3

File tree

4 files changed

+65
-2
lines changed

4 files changed

+65
-2
lines changed

release-notes/CREDITS-2.x

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,10 @@ Hesham Massoud (heshamMassoud@github)
956956
(2.10.0)
957957

958958
David Connelly (dconnelly@github)
959-
* Reported#2446: Java 11: Unable to load JDK7 types (annotations, java.nio.file.Path):
959+
* Reported #2446: Java 11: Unable to load JDK7 types (annotations, java.nio.file.Path):
960960
no Java7 support added
961961
(2.10.0)
962+
963+
Wahey (KevynBct@github)
964+
* Reported #2466: Didn't find class "java.nio.file.Path" below Android api 26
965+
(2.10.0)

release-notes/VERSION-2.x

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Project: jackson-databind
44
=== Releases ===
55
------------------------------------------------------------------------
66

7+
2.10.0 (not yet released)
8+
9+
#2466: Didn't find class "java.nio.file.Path" below Android api 26
10+
(reported by KevynBct@github)
11+
712
2.10.0.pr3 (17-Sep-2019)
813
914
#1093: Default typing does not work with `writerFor(Object.class)`

src/main/java/com/fasterxml/jackson/databind/ext/beans/JavaBeansAnnotationsImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public class JavaBeansAnnotationsImpl extends JavaBeansAnnotations
1414
private final Class<?> _bogus;
1515

1616
public JavaBeansAnnotationsImpl() {
17-
// Trigger loading of annotations that only JDK 7 has...
17+
// Trigger loading of annotations that only JDK 7 has, to trigger
18+
// early fail (see [databind#2466])
1819
Class<?> cls = Transient.class;
1920
cls = ConstructorProperties.class;
2021
_bogus = cls;
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.fasterxml.jackson.failing;
2+
3+
import com.fasterxml.jackson.annotation.JacksonInject;
4+
import com.fasterxml.jackson.annotation.JsonAutoDetect;
5+
import com.fasterxml.jackson.annotation.JsonCreator;
6+
import com.fasterxml.jackson.annotation.JsonProperty;
7+
import com.fasterxml.jackson.annotation.JsonSetter;
8+
import com.fasterxml.jackson.annotation.Nulls;
9+
import com.fasterxml.jackson.annotation.PropertyAccessor;
10+
11+
import com.fasterxml.jackson.databind.*;
12+
13+
public class JacksonInject2465Test extends BaseMapTest
14+
{
15+
public static final class TestCase2465 {
16+
private final Internal2465 str;
17+
private final int id;
18+
19+
@JsonCreator
20+
public TestCase2465(@JacksonInject Internal2465 str, @JsonProperty("id") int id) {
21+
this.str = str;
22+
this.id = id;
23+
}
24+
25+
public int fetchId() { return id; }
26+
public Internal2465 fetchInternal() { return str; }
27+
}
28+
29+
public static final class Internal2465 {
30+
final String val;
31+
32+
public Internal2465(String val) {
33+
this.val = val;
34+
}
35+
}
36+
37+
// [databind#2465]
38+
public void testInjectWithCreator() throws Exception
39+
{
40+
ObjectMapper mapper = jsonMapperBuilder()
41+
.defaultSetterInfo(JsonSetter.Value.construct(Nulls.AS_EMPTY, Nulls.AS_EMPTY))
42+
.build();
43+
mapper.setVisibility(mapper.getVisibilityChecker().withVisibility(PropertyAccessor.FIELD,
44+
JsonAutoDetect.Visibility.ANY));
45+
46+
final Internal2465 injected = new Internal2465("test");
47+
TestCase2465 o = mapper.readerFor(TestCase2465.class)
48+
.with(new InjectableValues.Std().addValue(Internal2465.class, injected))
49+
.readValue("{\"id\":3}");
50+
assertEquals(3, o.fetchId());
51+
assertNotNull(o.fetchInternal());
52+
}
53+
}

0 commit comments

Comments
 (0)