File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/main/java/org/embulk/util/json Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 21
21
import com .fasterxml .jackson .core .filter .FilteringParserDelegate ;
22
22
import com .fasterxml .jackson .core .filter .JsonPointerBasedFilter ;
23
23
import com .fasterxml .jackson .core .filter .TokenFilter ;
24
+ import com .fasterxml .jackson .core .json .PackageVersion ;
24
25
import java .io .Closeable ;
25
26
import java .io .IOException ;
26
27
import java .io .InputStream ;
@@ -232,6 +233,7 @@ public static Builder builder() {
232
233
* @return the new builder
233
234
*/
234
235
public static Builder builder (final JsonFactory jsonFactory ) {
236
+ assertJacksonVersion ();
235
237
return new Builder (jsonFactory );
236
238
}
237
239
@@ -267,6 +269,17 @@ public final void close() throws IOException {
267
269
this .jacksonParser .close ();
268
270
}
269
271
272
+ private static void assertJacksonVersion () {
273
+ if (PackageVersion .VERSION .getMajorVersion () != 2 ) {
274
+ throw new UnsupportedOperationException ("embulk-util-json is not used with Jackson 2." );
275
+ }
276
+
277
+ final int minor = PackageVersion .VERSION .getMinorVersion ();
278
+ if (minor < 14 || (minor == 15 && PackageVersion .VERSION .getPatchLevel () <= 2 )) {
279
+ throw new UnsupportedOperationException ("embulk-util-json is not used with Jackson 2.15.3 or later." );
280
+ }
281
+ }
282
+
270
283
private final com .fasterxml .jackson .core .JsonParser jacksonParser ;
271
284
private final InternalJsonValueReader valueReader ;
272
285
You can’t perform that action at this time.
0 commit comments