Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8254161: Prevent instantiation of EnumSet subclasses through deserialization #611

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/java.base/share/classes/java/util/EnumSet.java
Original file line number Diff line number Diff line change
@@ -480,6 +480,7 @@ Object writeReplace() {
}

/**
* Throws {@code InvalidObjectException}.
* @param s the stream
* @throws java.io.InvalidObjectException always
*/
@@ -488,4 +489,14 @@ private void readObject(java.io.ObjectInputStream s)
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");
}
}