Skip to content

Commit ebc4e40

Browse files
committed
clean up 2.8-warnings
1 parent e56575c commit ebc4e40

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

afterburner/src/main/java/com/fasterxml/jackson/module/afterburner/deser/OptimizedSettableBeanProperty.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ protected final boolean _deserializeBoolean(JsonParser p, DeserializationContext
187187
return parsed;
188188
}
189189
// Otherwise, no can do:
190-
throw ctxt.mappingException(Boolean.TYPE, t);
190+
return (Boolean) ctxt.handleUnexpectedToken(Boolean.TYPE, p);
191191
}
192192

193193
protected final short _deserializeShort(JsonParser jp, DeserializationContext ctxt)
@@ -252,7 +252,7 @@ protected final int _deserializeInt(JsonParser p, DeserializationContext ctxt)
252252
return parsed;
253253
}
254254
// Otherwise, no can do:
255-
throw ctxt.mappingException(Integer.TYPE, t);
255+
return (Integer) ctxt.handleUnexpectedToken(Integer.TYPE, p);
256256
}
257257

258258
protected final long _deserializeLong(JsonParser p, DeserializationContext ctxt)
@@ -290,7 +290,7 @@ protected final long _deserializeLong(JsonParser p, DeserializationContext ctxt)
290290
}
291291
break;
292292
}
293-
throw ctxt.mappingException(Long.TYPE, p.getCurrentToken());
293+
return (Long) ctxt.handleUnexpectedToken(Long.TYPE, p);
294294
}
295295

296296
protected final String _deserializeString(JsonParser p, DeserializationContext ctxt) throws IOException
@@ -328,7 +328,7 @@ protected final String _deserializeString(JsonParser p, DeserializationContext c
328328
return text;
329329
}
330330
}
331-
throw ctxt.mappingException(String.class, p.getCurrentToken());
331+
return (String) ctxt.handleUnexpectedToken(String.class, p);
332332
}
333333

334334
protected final boolean _deserializeBooleanFromOther(JsonParser p, DeserializationContext ctxt)

afterburner/src/main/java/com/fasterxml/jackson/module/afterburner/deser/OptimizedValueInstantiator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import com.fasterxml.jackson.databind.DeserializationContext;
66
import com.fasterxml.jackson.databind.deser.std.StdValueInstantiator;
7+
import com.fasterxml.jackson.databind.type.TypeFactory;
78

89
/**
910
* Base class for concrete bytecode-generated value instantiators.
@@ -18,7 +19,7 @@ public abstract class OptimizedValueInstantiator
1819
* dummy instance to call factory method.
1920
*/
2021
protected OptimizedValueInstantiator() {
21-
super(/*DeserializationConfig*/null, (Class<?>)String.class);
22+
super(/*DeserializationConfig*/null, TypeFactory.unknownType());
2223
}
2324

2425
/**

guice/src/main/java/com/fasterxml/jackson/module/guice/GuiceAnnotationIntrospector.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,17 @@ else if (m instanceof AnnotatedMethod)
7272
* Depending on whether we have an annotation (or not) return the
7373
* correct Guice key that Jackson will use to query the Injector.
7474
*/
75-
if (guiceAnnotation == null)
76-
{
77-
return Key.get(guiceMember.getGenericType());
75+
if (guiceAnnotation == null) {
76+
// 19-Sep-2016, tatu: Used to pass `getGenericType()`, but that is now deprecated.
77+
// Looking at code in Guice Key, I don't think it does particularly good job
78+
// in resolving generic types, so I don't think change
79+
// return Key.get(guiceMember.getGenericType());
80+
return Key.get((java.lang.reflect.Type) guiceMember.getRawType());
7881
}
79-
return Key.get(guiceMember.getGenericType(), guiceAnnotation);
82+
// return Key.get(guiceMember.getGenericType(), guiceAnnotation);
83+
return Key.get((java.lang.reflect.Type) guiceMember.getRawType(), guiceAnnotation);
8084
}
8185

82-
8386
/*
8487
* We want to figure out if a @BindingAnnotation or @Qualifier
8588
* annotation are present on what we're trying to inject.

0 commit comments

Comments
 (0)