Skip to content

Commit 7709d43

Browse files
committed
8344782: Cleanup left over doPrivileged calls and imports in java.desktop
Reviewed-by: honkar
1 parent e03b150 commit 7709d43

File tree

7 files changed

+1
-20
lines changed

7 files changed

+1
-20
lines changed

src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.awt.Color;
2929
import java.awt.Dimension;
3030
import java.awt.KeyboardFocusManager;
31-
import java.security.PrivilegedAction;
3231
import java.util.Enumeration;
3332
import java.util.Locale;
3433
import java.util.ResourceBundle;

src/java.desktop/share/classes/java/awt/Cursor.java

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.beans.ConstructorProperties;
2929
import java.io.InputStream;
3030
import java.io.Serial;
31-
import java.security.AccessController;
3231
import java.util.Hashtable;
3332
import java.util.Properties;
3433
import java.util.StringTokenizer;

src/java.desktop/share/classes/javax/swing/text/html/parser/ParserDelegator.java

-3
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ public void parse(Reader r, HTMLEditorKit.ParserCallback cb, boolean ignoreCharS
121121

122122
/**
123123
* Fetch a resource relative to the ParserDelegator classfile.
124-
* If this is called on 1.2 the loading will occur under the
125-
* protection of a doPrivileged call to allow the ParserDelegator
126-
* to function when used in an applet.
127124
*
128125
* @param name the name of the resource, relative to the
129126
* ParserDelegator class.

src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java

-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@
4141
import java.awt.event.InvocationEvent;
4242
import java.awt.im.spi.InputMethodDescriptor;
4343
import java.lang.reflect.InvocationTargetException;
44-
import java.security.AccessController;
45-
import java.security.PrivilegedAction;
46-
import java.security.PrivilegedActionException;
47-
import java.security.PrivilegedExceptionAction;
4844
import java.util.Hashtable;
4945
import java.util.Iterator;
5046
import java.util.Locale;

src/java.desktop/share/classes/sun/font/FontManagerNativeLibrary.java

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ top of freetype library (that is used in binary form).
6161
* Method acts as trigger to ensure this class is loaded
6262
* (and therefore initializer code is executed).
6363
* Actual loading is performed by static initializer.
64-
* (no need to execute doPrivileged block more than once)
6564
*/
6665
public static void load() {}
6766
}

src/java.desktop/share/classes/sun/swing/WindowsPlacesBar.java

-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
import java.beans.PropertyChangeListener;
3737

3838
import java.io.File;
39-
import java.security.AccessController;
40-
import java.security.PrivilegedAction;
4139

4240
import javax.swing.JToolBar;
4341
import javax.swing.JFileChooser;

src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java

+1-8
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
import java.awt.event.WindowEvent;
4848
import java.awt.peer.ComponentPeer;
4949
import java.awt.peer.WindowPeer;
50-
import java.security.AccessController;
51-
import java.security.PrivilegedAction;
5250
import java.util.ArrayList;
5351
import java.util.HashSet;
5452
import java.util.Set;
@@ -1322,12 +1320,7 @@ private void removeStartupNotification() {
13221320
return;
13231321
}
13241322

1325-
@SuppressWarnings("removal")
1326-
final String desktopStartupId = AccessController.doPrivileged(new PrivilegedAction<String>() {
1327-
public String run() {
1328-
return XToolkit.getEnv("DESKTOP_STARTUP_ID");
1329-
}
1330-
});
1323+
final String desktopStartupId = XToolkit.getEnv("DESKTOP_STARTUP_ID");
13311324
if (desktopStartupId == null) {
13321325
return;
13331326
}

0 commit comments

Comments
 (0)