File tree 4 files changed +25
-3
lines changed
src/main/java/com/fasterxml/jackson/databind
4 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -1022,3 +1022,8 @@ Greg Arakelian (arakelian@github)
1022
1022
* Reported #2566: `MissingNode.toString()` returns `null` (4 character token) instead
1023
1023
of empty string
1024
1024
(2.10.2)
1025
+
1026
+ Tobias Preuss (johnjohndoe@github)
1027
+ * Reported #2599: NoClassDefFoundError at DeserializationContext.<init> on Android 4.1.2
1028
+ and Jackson 2.10.0
1029
+ (2.10.3)
Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ Project: jackson-databind
4
4
=== Releases ===
5
5
------------------------------------------------------------------------
6
6
7
+ 2.10.3 (not yet released)
8
+
9
+ #2599 : NoClassDefFoundError at DeserializationContext.<init> on Android 4.1.2 and Jackson 2.10.0
10
+ (reported by Tobias P)
11
+
7
12
2.10.2 (05 -Jan-2020 )
8
13
9
14
#2101 : `FAIL_ON_NULL_FOR_PRIMITIVES` failure does not indicate field name in exception message
Original file line number Diff line number Diff line change @@ -155,7 +155,10 @@ protected DeserializationContext(DeserializerFactory df) {
155
155
protected DeserializationContext (DeserializerFactory df ,
156
156
DeserializerCache cache )
157
157
{
158
- _factory = Objects .requireNonNull (df , "Cannot pass null DeserializerFactory" );
158
+ if (df == null ) {
159
+ throw new NullPointerException ("Cannot pass null DeserializerFactory" );
160
+ }
161
+ _factory = df ;
159
162
if (cache == null ) {
160
163
cache = new DeserializerCache ();
161
164
}
Original file line number Diff line number Diff line change @@ -245,8 +245,17 @@ public DefaultTypeResolverBuilder(DefaultTyping t) {
245
245
* @since 2.10
246
246
*/
247
247
public DefaultTypeResolverBuilder (DefaultTyping t , PolymorphicTypeValidator ptv ) {
248
- _appliesFor = Objects .requireNonNull (t , "Can not pass `null` DefaultTyping" );
249
- _subtypeValidator = Objects .requireNonNull (ptv , "Can not pass `null` PolymorphicTypeValidator" );
248
+ _appliesFor = _requireNonNull (t , "Can not pass `null` DefaultTyping" );
249
+ _subtypeValidator = _requireNonNull (ptv , "Can not pass `null` PolymorphicTypeValidator" );
250
+ }
251
+
252
+ // 20-Jan-2020: as per [databind#2599] Objects.requireNonNull() from JDK7 not in all Android so
253
+ private static <T > T _requireNonNull (T value , String msg ) {
254
+ // Replacement for: return Objects.requireNonNull(t, msg);
255
+ if (value == null ) {
256
+ throw new NullPointerException (msg );
257
+ }
258
+ return value ;
250
259
}
251
260
252
261
/**
You can’t perform that action at this time.
0 commit comments