Skip to content

Commit 395e404

Browse files
author
Abhishek Kumar
committedNov 21, 2024
8344066: Remove SecurityManager uses from the jdk.accessibility module
Reviewed-by: prr
1 parent dfa18fe commit 395e404

File tree

4 files changed

+12
-169
lines changed

4 files changed

+12
-169
lines changed
 

‎src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java

-37
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.awt.event.*;
3030
import javax.swing.*;
3131
import javax.swing.event.*;
32-
import sun.awt.AWTPermissions;
3332

3433
/**
3534
* <P>The {@code AWTEventMonitor} implements a suite of listeners that are
@@ -85,17 +84,6 @@ public static Component getComponentWithFocus() {
8584
return componentWithFocus;
8685
}
8786

88-
/*
89-
* Check permissions
90-
*/
91-
private static void checkInstallPermission() {
92-
@SuppressWarnings("removal")
93-
SecurityManager security = System.getSecurityManager();
94-
if (security != null) {
95-
security.checkPermission(AWTPermissions.ALL_AWT_EVENTS_PERMISSION);
96-
}
97-
}
98-
9987
/**
10088
* Adds the specified listener to receive all {@link EventID#COMPONENT COMPONENT}
10189
* events on each component instance in the Java Virtual Machine as they occur.
@@ -108,7 +96,6 @@ private static void checkInstallPermission() {
10896
*/
10997
public static void addComponentListener(ComponentListener l) {
11098
if (componentListener == null) {
111-
checkInstallPermission();
11299
awtListener.installListeners(EventID.COMPONENT);
113100
}
114101
componentListener = AWTEventMulticaster.add(componentListener, l);
@@ -190,7 +177,6 @@ public static void removeFocusListener(FocusListener l) {
190177
*/
191178
public static void addKeyListener(KeyListener l) {
192179
if (keyListener == null) {
193-
checkInstallPermission();
194180
awtListener.installListeners(EventID.KEY);
195181
}
196182
keyListener = AWTEventMulticaster.add(keyListener, l);
@@ -222,7 +208,6 @@ public static void removeKeyListener(KeyListener l) {
222208
*/
223209
public static void addMouseListener(MouseListener l) {
224210
if (mouseListener == null) {
225-
checkInstallPermission();
226211
awtListener.installListeners(EventID.MOUSE);
227212
}
228213
mouseListener = AWTEventMulticaster.add(mouseListener, l);
@@ -254,7 +239,6 @@ public static void removeMouseListener(MouseListener l) {
254239
*/
255240
public static void addMouseMotionListener(MouseMotionListener l) {
256241
if (mouseMotionListener == null) {
257-
checkInstallPermission();
258242
awtListener.installListeners(EventID.MOTION);
259243
}
260244
mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, l);
@@ -286,7 +270,6 @@ public static void removeMouseMotionListener(MouseMotionListener l) {
286270
*/
287271
public static void addWindowListener(WindowListener l) {
288272
if (windowListener == null) {
289-
checkInstallPermission();
290273
awtListener.installListeners(EventID.WINDOW);
291274
}
292275
windowListener = AWTEventMulticaster.add(windowListener, l);
@@ -318,7 +301,6 @@ public static void removeWindowListener(WindowListener l) {
318301
*/
319302
public static void addActionListener(ActionListener l) {
320303
if (actionListener == null) {
321-
checkInstallPermission();
322304
awtListener.installListeners(EventID.ACTION);
323305
}
324306
actionListener = AWTEventMulticaster.add(actionListener, l);
@@ -351,7 +333,6 @@ public static void removeActionListener(ActionListener l) {
351333
*/
352334
public static void addAdjustmentListener(AdjustmentListener l) {
353335
if (adjustmentListener == null) {
354-
checkInstallPermission();
355336
awtListener.installListeners(EventID.ADJUSTMENT);
356337
}
357338
adjustmentListener = AWTEventMulticaster.add(adjustmentListener, l);
@@ -383,7 +364,6 @@ public static void removeAdjustmentListener(AdjustmentListener l) {
383364
*/
384365
public static void addItemListener(ItemListener l) {
385366
if (itemListener == null) {
386-
checkInstallPermission();
387367
awtListener.installListeners(EventID.ITEM);
388368
}
389369
itemListener = AWTEventMulticaster.add(itemListener, l);
@@ -415,7 +395,6 @@ public static void removeItemListener(ItemListener l) {
415395
*/
416396
public static void addTextListener(TextListener l) {
417397
if (textListener == null) {
418-
checkInstallPermission();
419398
awtListener.installListeners(EventID.TEXT);
420399
}
421400
textListener = AWTEventMulticaster.add(textListener, l);
@@ -668,8 +647,6 @@ protected void installListeners(Component c, int eventID) {
668647
}
669648
} catch (NoSuchMethodException e) {
670649
// System.out.println("Exception: " + e.toString());
671-
} catch (SecurityException e) {
672-
System.out.println("Exception: " + e.toString());
673650
}
674651
break;
675652

@@ -714,8 +691,6 @@ protected void installListeners(Component c, int eventID) {
714691
}
715692
} catch (NoSuchMethodException e) {
716693
// System.out.println("Exception: " + e.toString());
717-
} catch (SecurityException e) {
718-
System.out.println("Exception: " + e.toString());
719694
}
720695
// [PK] CheckboxMenuItem isn't a component but it does
721696
// implement Interface ItemSelectable!!
@@ -755,8 +730,6 @@ protected void installListeners(Component c, int eventID) {
755730
}
756731
} catch (NoSuchMethodException e) {
757732
// System.out.println("Exception: " + e.toString());
758-
} catch (SecurityException e) {
759-
System.out.println("Exception: " + e.toString());
760733
}
761734
break;
762735

@@ -776,8 +749,6 @@ protected void installListeners(Component c, int eventID) {
776749
}
777750
} catch (NoSuchMethodException e) {
778751
// System.out.println("Exception: " + e.toString());
779-
} catch (SecurityException e) {
780-
System.out.println("Exception: " + e.toString());
781752
}
782753
break;
783754

@@ -881,8 +852,6 @@ protected void removeListeners(Component c, int eventID) {
881852
}
882853
} catch (NoSuchMethodException e) {
883854
// System.out.println("Exception: " + e.toString());
884-
} catch (SecurityException e) {
885-
System.out.println("Exception: " + e.toString());
886855
}
887856
break;
888857

@@ -921,8 +890,6 @@ protected void removeListeners(Component c, int eventID) {
921890
}
922891
} catch (NoSuchMethodException e) {
923892
// System.out.println("Exception: " + e.toString());
924-
} catch (SecurityException e) {
925-
System.out.println("Exception: " + e.toString());
926893
}
927894
// [PK] CheckboxMenuItem isn't a component but it does
928895
// implement Interface ItemSelectable!!
@@ -955,8 +922,6 @@ protected void removeListeners(Component c, int eventID) {
955922
}
956923
} catch (NoSuchMethodException e) {
957924
// System.out.println("Exception: " + e.toString());
958-
} catch (SecurityException e) {
959-
System.out.println("Exception: " + e.toString());
960925
}
961926
break;
962927

@@ -973,8 +938,6 @@ protected void removeListeners(Component c, int eventID) {
973938
}
974939
} catch (NoSuchMethodException e) {
975940
// System.out.println("Exception: " + e.toString());
976-
} catch (SecurityException e) {
977-
System.out.println("Exception: " + e.toString());
978941
}
979942
break;
980943

‎src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventQueueMonitor.java

+8-18
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
import java.awt.*;
3030
import java.awt.event.*;
3131
import javax.accessibility.*;
32-
import java.security.AccessController;
33-
import java.security.PrivilegedAction;
3432

3533
/**
3634
* The {@code EventQueueMonitor} class provides key core functionality for Assistive
@@ -142,24 +140,16 @@ static void queueComponentEvent(ComponentEvent e) {
142140
/**
143141
* Tell the {@code EventQueueMonitor} to start listening for events.
144142
*/
145-
@SuppressWarnings("removal")
146143
public static void maybeInitialize() {
147144
if (cedt == null) {
148-
java.security.AccessController.doPrivileged(
149-
new java.security.PrivilegedAction<Void>() {
150-
public Void run() {
151-
try {
152-
long eventMask = AWTEvent.WINDOW_EVENT_MASK |
153-
AWTEvent.FOCUS_EVENT_MASK |
154-
AWTEvent.MOUSE_MOTION_EVENT_MASK;
155-
156-
Toolkit.getDefaultToolkit().addAWTEventListener(new EventQueueMonitor(), eventMask);
157-
} catch (Exception e) {
158-
}
159-
return null;
160-
}
161-
}
162-
);
145+
try {
146+
long eventMask = AWTEvent.WINDOW_EVENT_MASK |
147+
AWTEvent.FOCUS_EVENT_MASK |
148+
AWTEvent.MOUSE_MOTION_EVENT_MASK;
149+
150+
Toolkit.getDefaultToolkit().addAWTEventListener(new EventQueueMonitor(), eventMask);
151+
} catch (Exception e) {
152+
}
163153
}
164154
}
165155

‎src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java

-89
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,6 @@ protected void installListeners(Component c, int eventID) {
976976
}
977977
} catch (NoSuchMethodException e) {
978978
// System.out.println("Exception: " + e.toString());
979-
} catch (SecurityException e) {
980-
System.out.println("Exception: " + e.toString());
981979
}
982980
break;
983981

@@ -1001,8 +999,6 @@ protected void installListeners(Component c, int eventID) {
1001999
}
10021000
} catch (NoSuchMethodException e) {
10031001
// System.out.println("Exception: " + e.toString());
1004-
} catch (SecurityException e) {
1005-
System.out.println("Exception: " + e.toString());
10061002
}
10071003

10081004
// Look for components which support CellEditor listeners
@@ -1023,8 +1019,6 @@ protected void installListeners(Component c, int eventID) {
10231019
}
10241020
} catch (NoSuchMethodException e) {
10251021
// System.out.println("Exception: " + e.toString());
1026-
} catch (SecurityException e) {
1027-
System.out.println("Exception: " + e.toString());
10281022
}
10291023
break;
10301024

@@ -1050,8 +1044,6 @@ protected void installListeners(Component c, int eventID) {
10501044
}
10511045
} catch (NoSuchMethodException e) {
10521046
// System.out.println("Exception: " + e.toString());
1053-
} catch (SecurityException e) {
1054-
System.out.println("Exception: " + e.toString());
10551047
}
10561048

10571049
// Look for components which support the getModel method
@@ -1078,10 +1070,7 @@ protected void installListeners(Component c, int eventID) {
10781070
}
10791071
} catch (NoSuchMethodException e) {
10801072
// System.out.println("Exception: " + e.toString());
1081-
} catch (SecurityException e) {
1082-
System.out.println("Exception: " + e.toString());
10831073
}
1084-
10851074
break;
10861075

10871076
case EventID.COLUMNMODEL:
@@ -1101,8 +1090,6 @@ protected void installListeners(Component c, int eventID) {
11011090
}
11021091
} catch (NoSuchMethodException e) {
11031092
// System.out.println("Exception: " + e.toString());
1104-
} catch (SecurityException e) {
1105-
System.out.println("Exception: " + e.toString());
11061093
}
11071094
break;
11081095

@@ -1126,8 +1113,6 @@ protected void installListeners(Component c, int eventID) {
11261113
}
11271114
} catch (NoSuchMethodException e) {
11281115
// System.out.println("Exception: " + e.toString());
1129-
} catch (SecurityException e) {
1130-
System.out.println("Exception: " + e.toString());
11311116
}
11321117

11331118
// Look for components which support Document listeners
@@ -1148,8 +1133,6 @@ protected void installListeners(Component c, int eventID) {
11481133
}
11491134
} catch (NoSuchMethodException e) {
11501135
// System.out.println("Exception: " + e.toString());
1151-
} catch (SecurityException e) {
1152-
System.out.println("Exception: " + e.toString());
11531136
}
11541137
// Add the monitor as a PropertyChangeListener for document
11551138
// change events from text components.
@@ -1174,8 +1157,6 @@ protected void installListeners(Component c, int eventID) {
11741157
}
11751158
} catch (NoSuchMethodException e) {
11761159
// System.out.println("Exception: " + e.toString());
1177-
} catch (SecurityException e) {
1178-
System.out.println("Exception: " + e.toString());
11791160
}
11801161
}
11811162
break;
@@ -1210,8 +1191,6 @@ protected void installListeners(Component c, int eventID) {
12101191
}
12111192
} catch (NoSuchMethodException e) {
12121193
// System.out.println("Exception: " + e.toString());
1213-
} catch (SecurityException e) {
1214-
System.out.println("Exception: " + e.toString());
12151194
}
12161195
break;
12171196

@@ -1234,8 +1213,6 @@ protected void installListeners(Component c, int eventID) {
12341213
}
12351214
} catch (NoSuchMethodException e) {
12361215
// System.out.println("Exception: " + e.toString());
1237-
} catch (SecurityException e) {
1238-
System.out.println("Exception: " + e.toString());
12391216
}
12401217

12411218
// Look for selection models which support ListSelectionListeners
@@ -1257,8 +1234,6 @@ protected void installListeners(Component c, int eventID) {
12571234
}
12581235
} catch (NoSuchMethodException e) {
12591236
// System.out.println("Exception: " + e.toString());
1260-
} catch (SecurityException e) {
1261-
System.out.println("Exception: " + e.toString());
12621237
}
12631238
break;
12641239

@@ -1278,8 +1253,6 @@ protected void installListeners(Component c, int eventID) {
12781253
}
12791254
} catch (NoSuchMethodException e) {
12801255
// System.out.println("Exception: " + e.toString());
1281-
} catch (SecurityException e) {
1282-
System.out.println("Exception: " + e.toString());
12831256
}
12841257
break;
12851258

@@ -1302,8 +1275,6 @@ protected void installListeners(Component c, int eventID) {
13021275
}
13031276
} catch (NoSuchMethodException e) {
13041277
// System.out.println("Exception: " + e.toString());
1305-
} catch (SecurityException e) {
1306-
System.out.println("Exception: " + e.toString());
13071278
}
13081279

13091280
// Look for components which support getPopupMenu
@@ -1329,8 +1300,6 @@ protected void installListeners(Component c, int eventID) {
13291300
}
13301301
} catch (NoSuchMethodException e) {
13311302
// System.out.println("Exception: " + e.toString());
1332-
} catch (SecurityException e) {
1333-
System.out.println("Exception: " + e.toString());
13341303
}
13351304
break;
13361305

@@ -1350,8 +1319,6 @@ protected void installListeners(Component c, int eventID) {
13501319
}
13511320
} catch (NoSuchMethodException e) {
13521321
// System.out.println("Exception: " + e.toString());
1353-
} catch (SecurityException e) {
1354-
System.out.println("Exception: " + e.toString());
13551322
}
13561323
break;
13571324

@@ -1371,8 +1338,6 @@ protected void installListeners(Component c, int eventID) {
13711338
}
13721339
} catch (NoSuchMethodException e) {
13731340
// System.out.println("Exception: " + e.toString());
1374-
} catch (SecurityException e) {
1375-
System.out.println("Exception: " + e.toString());
13761341
}
13771342
break;
13781343

@@ -1396,8 +1361,6 @@ protected void installListeners(Component c, int eventID) {
13961361
}
13971362
} catch (NoSuchMethodException e) {
13981363
// System.out.println("Exception: " + e.toString());
1399-
} catch (SecurityException e) {
1400-
System.out.println("Exception: " + e.toString());
14011364
}
14021365

14031366
// Look for components which support UndoableEdit listeners
@@ -1418,8 +1381,6 @@ protected void installListeners(Component c, int eventID) {
14181381
}
14191382
} catch (NoSuchMethodException e) {
14201383
// System.out.println("Exception: " + e.toString());
1421-
} catch (SecurityException e) {
1422-
System.out.println("Exception: " + e.toString());
14231384
}
14241385
break;
14251386

@@ -1442,8 +1403,6 @@ protected void installListeners(Component c, int eventID) {
14421403
}
14431404
} catch (NoSuchMethodException e) {
14441405
// System.out.println("Exception: " + e.toString());
1445-
} catch (SecurityException e) {
1446-
System.out.println("Exception: " + e.toString());
14471406
}
14481407
break;
14491408

@@ -1466,8 +1425,6 @@ protected void installListeners(Component c, int eventID) {
14661425
}
14671426
} catch (NoSuchMethodException e) {
14681427
// System.out.println("Exception: " + e.toString());
1469-
} catch (SecurityException e) {
1470-
System.out.println("Exception: " + e.toString());
14711428
}
14721429

14731430
// Look for components which support the getSelectionModel method
@@ -1489,8 +1446,6 @@ protected void installListeners(Component c, int eventID) {
14891446
}
14901447
} catch (NoSuchMethodException e) {
14911448
// System.out.println("Exception: " + e.toString());
1492-
} catch (SecurityException e) {
1493-
System.out.println("Exception: " + e.toString());
14941449
}
14951450
break;
14961451

@@ -1622,8 +1577,6 @@ protected void removeListeners(Component c, int eventID) {
16221577
}
16231578
} catch (NoSuchMethodException e) {
16241579
// System.out.println("Exception: " + e.toString());
1625-
} catch (SecurityException e) {
1626-
System.out.println("Exception: " + e.toString());
16271580
}
16281581
break;
16291582

@@ -1646,8 +1599,6 @@ protected void removeListeners(Component c, int eventID) {
16461599
}
16471600
} catch (NoSuchMethodException e) {
16481601
// System.out.println("Exception: " + e.toString());
1649-
} catch (SecurityException e) {
1650-
System.out.println("Exception: " + e.toString());
16511602
}
16521603

16531604
// Look for components which support CellEditor listeners
@@ -1665,8 +1616,6 @@ protected void removeListeners(Component c, int eventID) {
16651616
}
16661617
} catch (NoSuchMethodException e) {
16671618
// System.out.println("Exception: " + e.toString());
1668-
} catch (SecurityException e) {
1669-
System.out.println("Exception: " + e.toString());
16701619
}
16711620
break;
16721621

@@ -1689,8 +1638,6 @@ protected void removeListeners(Component c, int eventID) {
16891638
}
16901639
} catch (NoSuchMethodException e) {
16911640
// System.out.println("Exception: " + e.toString());
1692-
} catch (SecurityException e) {
1693-
System.out.println("Exception: " + e.toString());
16941641
}
16951642

16961643
// Look for components which support the getModel method
@@ -1714,8 +1661,6 @@ protected void removeListeners(Component c, int eventID) {
17141661
}
17151662
} catch (NoSuchMethodException e) {
17161663
// System.out.println("Exception: " + e.toString());
1717-
} catch (SecurityException e) {
1718-
System.out.println("Exception: " + e.toString());
17191664
}
17201665
break;
17211666

@@ -1735,8 +1680,6 @@ protected void removeListeners(Component c, int eventID) {
17351680
}
17361681
} catch (NoSuchMethodException e) {
17371682
// System.out.println("Exception: " + e.toString());
1738-
} catch (SecurityException e) {
1739-
System.out.println("Exception: " + e.toString());
17401683
}
17411684
break;
17421685

@@ -1759,8 +1702,6 @@ protected void removeListeners(Component c, int eventID) {
17591702
}
17601703
} catch (NoSuchMethodException e) {
17611704
// System.out.println("Exception: " + e.toString());
1762-
} catch (SecurityException e) {
1763-
System.out.println("Exception: " + e.toString());
17641705
}
17651706

17661707
// Look for components which support Document listeners
@@ -1778,8 +1719,6 @@ protected void removeListeners(Component c, int eventID) {
17781719
}
17791720
} catch (NoSuchMethodException e) {
17801721
// System.out.println("Exception: " + e.toString());
1781-
} catch (SecurityException e) {
1782-
System.out.println("Exception: " + e.toString());
17831722
}
17841723
break;
17851724

@@ -1810,8 +1749,6 @@ protected void removeListeners(Component c, int eventID) {
18101749
}
18111750
} catch (NoSuchMethodException e) {
18121751
// System.out.println("Exception: " + e.toString());
1813-
} catch (SecurityException e) {
1814-
System.out.println("Exception: " + e.toString());
18151752
}
18161753
break;
18171754

@@ -1831,8 +1768,6 @@ protected void removeListeners(Component c, int eventID) {
18311768
}
18321769
} catch (NoSuchMethodException e) {
18331770
// System.out.println("Exception: " + e.toString());
1834-
} catch (SecurityException e) {
1835-
System.out.println("Exception: " + e.toString());
18361771
}
18371772

18381773
// Look for selection models which support
@@ -1853,8 +1788,6 @@ protected void removeListeners(Component c, int eventID) {
18531788
}
18541789
} catch (NoSuchMethodException e) {
18551790
// System.out.println("Exception: " + e.toString());
1856-
} catch (SecurityException e) {
1857-
System.out.println("Exception: " + e.toString());
18581791
}
18591792
break;
18601793

@@ -1871,8 +1804,6 @@ protected void removeListeners(Component c, int eventID) {
18711804
}
18721805
} catch (NoSuchMethodException e) {
18731806
// System.out.println("Exception: " + e.toString());
1874-
} catch (SecurityException e) {
1875-
System.out.println("Exception: " + e.toString());
18761807
}
18771808
break;
18781809

@@ -1892,8 +1823,6 @@ protected void removeListeners(Component c, int eventID) {
18921823
}
18931824
} catch (NoSuchMethodException e) {
18941825
// System.out.println("Exception: " + e.toString());
1895-
} catch (SecurityException e) {
1896-
System.out.println("Exception: " + e.toString());
18971826
}
18981827

18991828
// Look for components which support getPopupMenu
@@ -1916,8 +1845,6 @@ protected void removeListeners(Component c, int eventID) {
19161845
}
19171846
} catch (NoSuchMethodException e) {
19181847
// System.out.println("Exception: " + e.toString());
1919-
} catch (SecurityException e) {
1920-
System.out.println("Exception: " + e.toString());
19211848
}
19221849
break;
19231850

@@ -1934,8 +1861,6 @@ protected void removeListeners(Component c, int eventID) {
19341861
}
19351862
} catch (NoSuchMethodException e) {
19361863
// System.out.println("Exception: " + e.toString());
1937-
} catch (SecurityException e) {
1938-
System.out.println("Exception: " + e.toString());
19391864
}
19401865
break;
19411866

@@ -1952,8 +1877,6 @@ protected void removeListeners(Component c, int eventID) {
19521877
}
19531878
} catch (NoSuchMethodException e) {
19541879
// System.out.println("Exception: " + e.toString());
1955-
} catch (SecurityException e) {
1956-
System.out.println("Exception: " + e.toString());
19571880
}
19581881
break;
19591882

@@ -1976,8 +1899,6 @@ protected void removeListeners(Component c, int eventID) {
19761899
}
19771900
} catch (NoSuchMethodException e) {
19781901
// System.out.println("Exception: " + e.toString());
1979-
} catch (SecurityException e) {
1980-
System.out.println("Exception: " + e.toString());
19811902
}
19821903

19831904
// Look for components which support UndoableEdit listeners
@@ -1995,8 +1916,6 @@ protected void removeListeners(Component c, int eventID) {
19951916
}
19961917
} catch (NoSuchMethodException e) {
19971918
// System.out.println("Exception: " + e.toString());
1998-
} catch (SecurityException e) {
1999-
System.out.println("Exception: " + e.toString());
20001919
}
20011920
break;
20021921

@@ -2013,8 +1932,6 @@ protected void removeListeners(Component c, int eventID) {
20131932
}
20141933
} catch (NoSuchMethodException e) {
20151934
// System.out.println("Exception: " + e.toString());
2016-
} catch (SecurityException e) {
2017-
System.out.println("Exception: " + e.toString());
20181935
}
20191936
break;
20201937

@@ -2034,8 +1951,6 @@ protected void removeListeners(Component c, int eventID) {
20341951
}
20351952
} catch (NoSuchMethodException e) {
20361953
// System.out.println("Exception: " + e.toString());
2037-
} catch (SecurityException e) {
2038-
System.out.println("Exception: " + e.toString());
20391954
}
20401955

20411956
// Look for components which support the getSelectionModel
@@ -2056,8 +1971,6 @@ protected void removeListeners(Component c, int eventID) {
20561971
}
20571972
} catch (NoSuchMethodException e) {
20581973
// System.out.println("Exception: " + e.toString());
2059-
} catch (SecurityException e) {
2060-
System.out.println("Exception: " + e.toString());
20611974
}
20621975
break;
20631976

@@ -2512,8 +2425,6 @@ public void propertyChange(PropertyChangeEvent e) {
25122425
}
25132426
} catch (NoSuchMethodException e2) {
25142427
// System.out.println("Exception: " + e2.toString());
2515-
} catch (SecurityException e2) {
2516-
System.out.println("Exception: " + e2.toString());
25172428
}
25182429
}
25192430

‎src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java

+4-25
Original file line numberDiff line numberDiff line change
@@ -160,44 +160,23 @@ public final class AccessBridge {
160160
initStatic();
161161
}
162162

163-
@SuppressWarnings({"removal", "restricted"})
163+
@SuppressWarnings("restricted")
164164
private static void initStatic() {
165165
// Load the appropriate DLLs
166166
boolean is32on64 = false;
167167
if (System.getProperty("os.arch").equals("x86")) {
168168
// 32 bit JRE
169169
// Load jabsysinfo.dll so can determine Win bitness
170-
java.security.AccessController.doPrivileged(
171-
new java.security.PrivilegedAction<Void>() {
172-
public Void run() {
173-
System.loadLibrary("jabsysinfo");
174-
return null;
175-
}
176-
}, null, new java.lang.RuntimePermission("loadLibrary.jabsysinfo")
177-
);
170+
System.loadLibrary("jabsysinfo");
178171
if (isSysWow()) {
179172
// 32 bit JRE on 64 bit OS
180173
is32on64 = true;
181-
java.security.AccessController.doPrivileged(
182-
new java.security.PrivilegedAction<Void>() {
183-
public Void run() {
184-
System.loadLibrary("javaaccessbridge-32");
185-
return null;
186-
}
187-
}, null, new java.lang.RuntimePermission("loadLibrary.javaaccessbridge-32")
188-
);
174+
System.loadLibrary("javaaccessbridge-32");
189175
}
190176
}
191177
if (!is32on64) {
192178
// 32 bit JRE on 32 bit OS or 64 bit JRE on 64 bit OS
193-
java.security.AccessController.doPrivileged(
194-
new java.security.PrivilegedAction<Void>() {
195-
public Void run() {
196-
System.loadLibrary("javaaccessbridge");
197-
return null;
198-
}
199-
}, null, new java.lang.RuntimePermission("loadLibrary.javaaccessbridge")
200-
);
179+
System.loadLibrary("javaaccessbridge");
201180
}
202181
}
203182

0 commit comments

Comments
 (0)
Please sign in to comment.