|
4 | 4 | import java.io.StringReader;
|
5 | 5 | import java.math.BigDecimal;
|
6 | 6 | import java.math.BigInteger;
|
7 |
| -import java.util.Arrays; |
8 | 7 | import java.util.List;
|
9 | 8 | import java.util.Map;
|
10 | 9 |
|
@@ -111,79 +110,6 @@ static DecimalHolder4917 of(BigDecimal value) {
|
111 | 110 | }
|
112 | 111 | }
|
113 | 112 |
|
114 |
| - static class Point { |
115 |
| - private Double x; |
116 |
| - private Double y; |
117 |
| - |
118 |
| - public Double getX() { |
119 |
| - return x; |
120 |
| - } |
121 |
| - |
122 |
| - public void setX(Double x) { |
123 |
| - this.x = x; |
124 |
| - } |
125 |
| - |
126 |
| - public Double getY() { |
127 |
| - return y; |
128 |
| - } |
129 |
| - |
130 |
| - public void setY(Double y) { |
131 |
| - this.y = y; |
132 |
| - } |
133 |
| - } |
134 |
| - |
135 |
| - @JsonTypeInfo( |
136 |
| - use = JsonTypeInfo.Id.NAME, |
137 |
| - include = JsonTypeInfo.As.EXISTING_PROPERTY, |
138 |
| - property = "type", |
139 |
| - visible = true) |
140 |
| - @JsonSubTypes(@JsonSubTypes.Type(value = CenterResult.class, name = "center")) |
141 |
| - static abstract class Result { |
142 |
| - private String type; |
143 |
| - |
144 |
| - public String getType() { |
145 |
| - return type; |
146 |
| - } |
147 |
| - |
148 |
| - public void setType(String type) { |
149 |
| - this.type = type; |
150 |
| - } |
151 |
| - } |
152 |
| - |
153 |
| - static class CenterResult extends Result { |
154 |
| - private Point center; |
155 |
| - |
156 |
| - private Double radius; |
157 |
| - |
158 |
| - public Double getRadius() { |
159 |
| - return radius; |
160 |
| - } |
161 |
| - |
162 |
| - public void setRadius(Double radius) { |
163 |
| - this.radius = radius; |
164 |
| - } |
165 |
| - |
166 |
| - public Point getCenter() { |
167 |
| - return center; |
168 |
| - } |
169 |
| - |
170 |
| - public void setCenter(Point center) { |
171 |
| - this.center = center; |
172 |
| - } |
173 |
| - } |
174 |
| - |
175 |
| - static class Root { |
176 |
| - private Result[] results; |
177 |
| - |
178 |
| - public Result[] getResults() { |
179 |
| - return results; |
180 |
| - } |
181 |
| - |
182 |
| - public void setResults(Result[] results) { |
183 |
| - this.results = results; |
184 |
| - } |
185 |
| - } |
186 |
| - |
187 | 113 | /*
|
188 | 114 | /**********************************************************************
|
189 | 115 | /* Helper classes, serializers/deserializers/resolvers
|
@@ -544,23 +470,4 @@ public void bigDecimal4917V3() throws Exception
|
544 | 470 | assertEquals(new BigDecimal("100.00"), issue.decimal);
|
545 | 471 | assertEquals(50, issue.number);
|
546 | 472 | }
|
547 |
| - |
548 |
| - // https://github.com/FasterXML/jackson-core/issues/1397 |
549 |
| - @Test |
550 |
| - public void issue1397() throws Exception { |
551 |
| - var dataString = a2q("{" + |
552 |
| - "'results': [ { " + |
553 |
| - "'radius': 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, " + |
554 |
| - "'type': 'center', " + |
555 |
| - "'center': { " + |
556 |
| - "'x': -11.0, " + |
557 |
| - "'y': -2.0 } } ] }"); |
558 |
| - |
559 |
| - Root object = MAPPER.readValue(dataString, Root.class); |
560 |
| - |
561 |
| - CenterResult result = (CenterResult) Arrays.stream(object.getResults()).findFirst().orElseThrow(); |
562 |
| - |
563 |
| - System.out.println(result.getCenter().getX()); |
564 |
| - System.out.println(result.getCenter().getY()); |
565 |
| - } |
566 | 473 | }
|
0 commit comments