Skip to content

Commit 318741a

Browse files
committed
Minor clean up
1 parent 1eee6fe commit 318741a

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

src/main/java/tools/jackson/databind/deser/SettableBeanProperty.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ public SettableBeanProperty unwrapped(DeserializationContext ctxt, NameTransform
610610
/**********************************************************************
611611
*/
612612

613-
protected void _throwAsJacksonE(JsonParser p, Exception e, Object value)
613+
protected void _throwAsJacksonE(JsonParser p, Throwable e, Object value)
614614
throws JacksonException
615615
{
616616
if (e instanceof IllegalArgumentException) {
@@ -633,7 +633,7 @@ protected void _throwAsJacksonE(JsonParser p, Exception e, Object value)
633633
_throwAsJacksonE(p, e);
634634
}
635635

636-
protected void _throwAsJacksonE(JsonParser p, Exception e) throws JacksonException
636+
protected void _throwAsJacksonE(JsonParser p, Throwable e) throws JacksonException
637637
{
638638
ClassUtil.throwIfRTE(e);
639639
ClassUtil.throwIfJacksonE(e);
@@ -651,12 +651,6 @@ protected void _throwAsJacksonE(JsonParser p, Exception e) throws JacksonExcepti
651651
throw DatabindException.from(p, ClassUtil.exceptionMessage(e), e);
652652
}
653653

654-
// 10-Oct-2015, tatu: _Should_ be deprecated, too, but its remaining
655-
// callers cannot actually provide a JsonParser
656-
protected void _throwAsJacksonE(Exception e, Object value) throws JacksonException {
657-
_throwAsJacksonE((JsonParser) null, e, value);
658-
}
659-
660654
@Override public String toString() { return "[property '"+getName()+"']"; }
661655

662656
/*

src/main/java/tools/jackson/databind/deser/impl/FieldProperty.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@ public void set(DeserializationContext ctxt, Object instance, Object value)
193193
try {
194194
_field.set(instance, value);
195195
} catch (Exception e) {
196-
// 15-Sep-2015, tatu: How could we get a ref to JsonParser?
197-
_throwAsJacksonE(e, value);
196+
_throwAsJacksonE(ctxt.getParser(), e, value);
198197
}
199198
}
200199

@@ -209,8 +208,7 @@ public Object setAndReturn(DeserializationContext ctxt, Object instance, Object
209208
try {
210209
_field.set(instance, value);
211210
} catch (Exception e) {
212-
// 15-Sep-2015, tatu: How could we get a ref to JsonParser?
213-
_throwAsJacksonE(e, value);
211+
_throwAsJacksonE(ctxt.getParser(), e, value);
214212
}
215213
return instance;
216214
}

src/main/java/tools/jackson/databind/deser/impl/MethodProperty.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ public final void set(DeserializationContext ctxt, Object instance, Object value
184184
try {
185185
_setter.invoke(instance, value);
186186
} catch (Exception e) {
187-
// 15-Sep-2015, tatu: How could we get a ref to JsonParser?
188-
_throwAsJacksonE(e, value);
187+
_throwAsJacksonE(ctxt.getParser(), e, value);
189188
}
190189
}
191190

@@ -202,8 +201,7 @@ public Object setAndReturn(DeserializationContext ctxt,
202201
Object result = _setter.invoke(instance, value);
203202
return (result == null) ? instance : result;
204203
} catch (Exception e) {
205-
// 15-Sep-2015, tatu: How could we get a ref to JsonParser?
206-
_throwAsJacksonE(e, value);
204+
_throwAsJacksonE(ctxt.getParser(), e, value);
207205
return null;
208206
}
209207
}

0 commit comments

Comments
 (0)