mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-22 16:26:05 +00:00
7173873: JFrame.setDefaultCloseOperation(EXIT_ON_CLOSE) will never lead to SE if EXIT_ON_CLOSE is already set
Reviewed-by: malenkov, serb
This commit is contained in:
parent
56014d30fc
commit
5287640ec6
@ -387,13 +387,14 @@ public class JFrame extends Frame implements WindowConstants,
|
||||
operation != EXIT_ON_CLOSE) {
|
||||
throw new IllegalArgumentException("defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or EXIT_ON_CLOSE");
|
||||
}
|
||||
if (this.defaultCloseOperation != operation) {
|
||||
if (operation == EXIT_ON_CLOSE) {
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
if (security != null) {
|
||||
security.checkExit(0);
|
||||
}
|
||||
|
||||
if (operation == EXIT_ON_CLOSE) {
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
if (security != null) {
|
||||
security.checkExit(0);
|
||||
}
|
||||
}
|
||||
if (this.defaultCloseOperation != operation) {
|
||||
int oldValue = this.defaultCloseOperation;
|
||||
this.defaultCloseOperation = operation;
|
||||
firePropertyChange("defaultCloseOperation", oldValue, operation);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user