File tree Expand file tree Collapse file tree 4 files changed +47
-0
lines changed
main/java/com/fasterxml/jackson/databind/deser/impl
test/java/com/fasterxml/jackson/databind/creators Expand file tree Collapse file tree 4 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -488,3 +488,7 @@ Josh Caplan (jecaplan@github)
488
488
489
489
Frédéric Camblor (fcamblor@github)
490
490
* Reported #1451: Type parameter not passed by `ObjectWriter` if serializer pre-fetch disabled
491
+
492
+ Kevin Hogeland (khogeland@github)
493
+ * Reported #1501: `ArrayIndexOutOfBoundsException` on non-static inner class constructor
494
+ (2.7.9)
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ Project: jackson-databind
20
20
(reported by Dmitry S)
21
21
#1476: Wrong constructor picked up when deserializing object
22
22
(reported by laurentgo@github)
23
+ #1501: `ArrayIndexOutOfBoundsException` on non-static inner class constructor
24
+ (reported by Kevin H)
23
25
#1506: Missing `KeyDeserializer` for `CharSequence`
24
26
25
27
2.7.8 (26-Sep-2016)
Original file line number Diff line number Diff line change @@ -83,6 +83,15 @@ public InnerClassProperty withName(PropertyName newName) {
83
83
public InnerClassProperty withValueDeserializer (JsonDeserializer <?> deser ) {
84
84
return new InnerClassProperty (this , deser );
85
85
}
86
+
87
+ @ Override
88
+ public void assignIndex (int index ) { _delegate .assignIndex (index ); }
89
+
90
+ @ Override
91
+ public int getPropertyIndex () { return _delegate .getPropertyIndex (); }
92
+
93
+ @ Override
94
+ public int getCreatorIndex () { return _delegate .getCreatorIndex (); }
86
95
87
96
// // // BeanProperty impl
88
97
Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .databind .creators ;
2
+
3
+ import com .fasterxml .jackson .annotation .JsonCreator ;
4
+ import com .fasterxml .jackson .annotation .JsonProperty ;
5
+ import com .fasterxml .jackson .databind .*;
6
+
7
+ // for [databind#1501]
8
+ public class InnerClassCreatorTest extends BaseMapTest
9
+ {
10
+ static class Something {
11
+ public InnerSomething a ;
12
+
13
+ // important: must name the parameter (param names module, or explicit)
14
+ @ JsonCreator
15
+ public Something (@ JsonProperty ("a" ) InnerSomething a ) { this .a = a ; }
16
+
17
+ public Something () { a = new InnerSomething (); }
18
+
19
+ class InnerSomething {
20
+ @ JsonCreator
21
+ public InnerSomething () { }
22
+ }
23
+ }
24
+
25
+ public void testIssue1501 () throws Exception
26
+ {
27
+ ObjectMapper mapper = new ObjectMapper ();
28
+ mapper .disable (SerializationFeature .FAIL_ON_EMPTY_BEANS );
29
+ String ser = mapper .writeValueAsString (new Something ());
30
+ mapper .readValue (ser , Something .class );
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments