forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
42 lines (29 loc) · 1.06 KB
/
Test.java
File metadata and controls
42 lines (29 loc) · 1.06 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
import java.io.*;
public class Test {
record T1() implements Serializable {
@Serial
private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0]; // $ Alert
@Serial
private void writeObject(ObjectOutputStream out) throws IOException {} // $ Alert
@Serial
private void readObject(ObjectOutputStream out) throws IOException {} // $ Alert
@Serial
private void readObjectNoData(ObjectOutputStream out) throws IOException { // $ Alert
}
}
record T2() implements Externalizable {
@Override
public void writeExternal(ObjectOutput out) throws IOException { // $ Alert
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { // $ Alert
}
}
record T3() implements Serializable {
public Object writeReplace(ObjectOutput out) throws ObjectStreamException { // COMPLIANT
return new Object();
}
public Object readResolve(ObjectInput in) throws ObjectStreamException { // COMPLIANT
return new Object();
}
}}