mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-07 12:14:55 +00:00
8254161: Prevent instantiation of EnumSet subclasses through deserialization
Reviewed-by: dfuchs, alanb, rriggs, smarks
This commit is contained in:
parent
3d23bd8e5b
commit
34583ebdfc
@ -480,6 +480,7 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws {@code InvalidObjectException}.
|
||||
* @param s the stream
|
||||
* @throws java.io.InvalidObjectException always
|
||||
*/
|
||||
@ -488,4 +489,14 @@ public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
|
||||
throws java.io.InvalidObjectException {
|
||||
throw new java.io.InvalidObjectException("Proxy required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws {@code InvalidObjectException}.
|
||||
* @throws java.io.InvalidObjectException always
|
||||
*/
|
||||
@java.io.Serial
|
||||
private void readObjectNoData()
|
||||
throws java.io.InvalidObjectException {
|
||||
throw new java.io.InvalidObjectException("Proxy required");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user