8344782: Cleanup left over doPrivileged calls and imports in java.desktop
Reviewed-by: honkar
This commit is contained in:
parent
e03b1506d3
commit
7709d435d0
@ -28,7 +28,6 @@ package com.apple.laf;
|
|||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.KeyboardFocusManager;
|
import java.awt.KeyboardFocusManager;
|
||||||
import java.security.PrivilegedAction;
|
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
@ -28,7 +28,6 @@ package java.awt;
|
|||||||
import java.beans.ConstructorProperties;
|
import java.beans.ConstructorProperties;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.security.AccessController;
|
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
@ -121,9 +121,6 @@ public class ParserDelegator extends HTMLEditorKit.Parser implements Serializabl
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch a resource relative to the ParserDelegator classfile.
|
* Fetch a resource relative to the ParserDelegator classfile.
|
||||||
* If this is called on 1.2 the loading will occur under the
|
|
||||||
* protection of a doPrivileged call to allow the ParserDelegator
|
|
||||||
* to function when used in an applet.
|
|
||||||
*
|
*
|
||||||
* @param name the name of the resource, relative to the
|
* @param name the name of the resource, relative to the
|
||||||
* ParserDelegator class.
|
* ParserDelegator class.
|
||||||
|
@ -41,10 +41,6 @@ import java.awt.event.ActionListener;
|
|||||||
import java.awt.event.InvocationEvent;
|
import java.awt.event.InvocationEvent;
|
||||||
import java.awt.im.spi.InputMethodDescriptor;
|
import java.awt.im.spi.InputMethodDescriptor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.security.AccessController;
|
|
||||||
import java.security.PrivilegedAction;
|
|
||||||
import java.security.PrivilegedActionException;
|
|
||||||
import java.security.PrivilegedExceptionAction;
|
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -61,7 +61,6 @@ public class FontManagerNativeLibrary {
|
|||||||
* Method acts as trigger to ensure this class is loaded
|
* Method acts as trigger to ensure this class is loaded
|
||||||
* (and therefore initializer code is executed).
|
* (and therefore initializer code is executed).
|
||||||
* Actual loading is performed by static initializer.
|
* Actual loading is performed by static initializer.
|
||||||
* (no need to execute doPrivileged block more than once)
|
|
||||||
*/
|
*/
|
||||||
public static void load() {}
|
public static void load() {}
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,6 @@ import java.beans.PropertyChangeEvent;
|
|||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.security.AccessController;
|
|
||||||
import java.security.PrivilegedAction;
|
|
||||||
|
|
||||||
import javax.swing.JToolBar;
|
import javax.swing.JToolBar;
|
||||||
import javax.swing.JFileChooser;
|
import javax.swing.JFileChooser;
|
||||||
|
@ -47,8 +47,6 @@ import java.awt.event.FocusEvent;
|
|||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.awt.peer.ComponentPeer;
|
import java.awt.peer.ComponentPeer;
|
||||||
import java.awt.peer.WindowPeer;
|
import java.awt.peer.WindowPeer;
|
||||||
import java.security.AccessController;
|
|
||||||
import java.security.PrivilegedAction;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -1322,12 +1320,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("removal")
|
final String desktopStartupId = XToolkit.getEnv("DESKTOP_STARTUP_ID");
|
||||||
final String desktopStartupId = AccessController.doPrivileged(new PrivilegedAction<String>() {
|
|
||||||
public String run() {
|
|
||||||
return XToolkit.getEnv("DESKTOP_STARTUP_ID");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (desktopStartupId == null) {
|
if (desktopStartupId == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user