forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSerializability.qll
More file actions
30 lines (26 loc) · 928 Bytes
/
Serializability.qll
File metadata and controls
30 lines (26 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* Provides classes and predicates for working with Java Serialization.
*/
import java
private import frameworks.jackson.JacksonSerializability
private import frameworks.google.GoogleHttpClientApi
/**
* A serializable field may be read without code referencing it,
* due to the use of serialization.
*/
abstract class SerializableField extends Field { }
/**
* A deserializable field may be written without code referencing it,
* due to the use of serialization.
*/
abstract class DeserializableField extends Field { }
/**
* A non-`transient` field in a type that (directly or indirectly) implements the `Serializable` interface
* and may be read or written via serialization.
*/
library class StandardSerializableField extends SerializableField, DeserializableField {
StandardSerializableField() {
this.getDeclaringType().getASupertype*() instanceof TypeSerializable and
not this.isTransient()
}
}