mirror of
https://github.com/github/codeql.git
synced 2025-12-21 11:16:30 +01:00
Cleanup Jackson logic after code review
This commit is contained in:
@@ -72,18 +72,6 @@ private class ExplicitlyWrittenJacksonSerializableType extends JacksonSerializab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A type whose values are explicitly deserialized in a call to a Jackson method. */
|
|
||||||
private class ExplicitlyReadJacksonSerializableType extends JacksonDeserializableType {
|
|
||||||
ExplicitlyReadJacksonSerializableType() {
|
|
||||||
exists(MethodAccess ma |
|
|
||||||
// A call to a Jackson read method...
|
|
||||||
ma.getMethod() instanceof JacksonReadValueMethod and
|
|
||||||
// ...where `this` is used in the final argument, indicating that this type will be deserialized.
|
|
||||||
usesType(ma.getArgument(ma.getNumArgument() - 1).getType(), this)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** A type used in a `JacksonSerializableField` declaration. */
|
/** A type used in a `JacksonSerializableField` declaration. */
|
||||||
private class FieldReferencedJacksonSerializableType extends JacksonSerializableType {
|
private class FieldReferencedJacksonSerializableType extends JacksonSerializableType {
|
||||||
FieldReferencedJacksonSerializableType() {
|
FieldReferencedJacksonSerializableType() {
|
||||||
@@ -123,6 +111,13 @@ private class ExplicitlyReadJacksonDeserializableType extends JacksonDeserializa
|
|||||||
exists(TypeLiteralToJacksonDatabindFlowConfiguration conf |
|
exists(TypeLiteralToJacksonDatabindFlowConfiguration conf |
|
||||||
usesType(conf.getSourceWithFlowToJacksonDatabind().getTypeName().getType(), this)
|
usesType(conf.getSourceWithFlowToJacksonDatabind().getTypeName().getType(), this)
|
||||||
)
|
)
|
||||||
|
or
|
||||||
|
exists(MethodAccess ma |
|
||||||
|
// A call to a Jackson read method...
|
||||||
|
ma.getMethod() instanceof JacksonReadValueMethod and
|
||||||
|
// ...where `this` is used in the final argument, indicating that this type will be deserialized.
|
||||||
|
usesType(ma.getArgument(ma.getNumArgument() - 1).getType(), this)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user