mirror of
https://github.com/github/codeql.git
synced 2025-12-21 03:06:31 +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)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,4 +31,4 @@ class HasFlowTest extends InlineExpectationsTest {
|
|||||||
value = ""
|
value = ""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ import java.util.*;
|
|||||||
public abstract class JsonNode implements Iterable<JsonNode> {
|
public abstract class JsonNode implements Iterable<JsonNode> {
|
||||||
public JsonNode() {
|
public JsonNode() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,4 +25,4 @@ public class MappingIterator<T> implements Iterator<T>, Closeable {
|
|||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,4 +79,4 @@ public class ObjectReader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user