undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com Patches, unit tests, benchmarks, whitepaper, and outreach briefs. Public domain — no copyright claimed. Use freely.
This commit is contained in:
commit
0a580b313d
70422 changed files with 17213626 additions and 0 deletions
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8202056
|
||||
* @compile/ref=SerialMethodMods.out -XDrawDiagnostics -Xlint:serial SerialMethodMods.java
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
|
||||
abstract class SerialMethodMods implements Serializable {
|
||||
private static final long serialVersionUID = 42;
|
||||
|
||||
// Should be private
|
||||
void writeObject(ObjectOutputStream stream) throws IOException {
|
||||
stream.defaultWriteObject();
|
||||
}
|
||||
|
||||
// Should be private
|
||||
public void readObject(ObjectInputStream stream)
|
||||
throws IOException, ClassNotFoundException {
|
||||
stream.defaultReadObject();
|
||||
}
|
||||
|
||||
// Should be concrete instance method
|
||||
private static void readObjectNoData() throws ObjectStreamException {}
|
||||
|
||||
// Should be concrete instance method
|
||||
public abstract Object writeReplace() throws ObjectStreamException;
|
||||
|
||||
// Should be concrete instance method
|
||||
public static Object readResolve() throws ObjectStreamException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue