JDK-8342441 : ☂ Remove all calls to doPrivileged
  • Type: Task
  • Component: javafx
  • Sub-Component: other
  • Affected Version: jfx24
  • Priority: P3
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2024-10-16
  • Updated: 2024-11-08
  • Resolved: 2024-11-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx24Resolved
Related Reports
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Relates :  
Description
This is an umbrella task to remove all AccessController.doPrivileged from all JavaFX code. Separate linked blocking bugs will be filed for each component area. 

There are 350 such calls in 168 files. See the attached list.

As part of this, the following classes should also be examined, and likely removed:

PrivilegedAction
PrivilegedExceptionAction
PrivilegedActionException

In most cases, these will naturally disappear as a result of removing the doPrivileged calls. In a few places we use the pattern of having a private class implement PrivilegedAction. For these cases, the easiest fix is likely to have the class to implement Callable instead, changing the `run` method of the class to `call`.

Here is a breakdown by module / component area listing the number of files in each. I will file 7 separate bugs as follows:

1. javafx.base : 20

2. controls, fxml, media, swing, swt : 21
   - javafx.controls : 6
   - javafx.fxml : 4
   - javafx.media : 4
   - javafx.swing : 5
   - javafx.swt : 2

3. javafx.graphics/com.sun.javafx.tk : 18

4. javafx.graphics/com.sun.ui.glass : 35

5. javafx.graphics/other : 51

6. javafx.web : 17

7. javafx.web/{ios,android} : 6
Comments
All blocking bugs are now fixed, so I am closing this umbrella task. The webkit ios code still has some doPrivileged calls, but that is being tracked separately.
08-11-2024

That might catch a few more things than you need. I just did a grep for "doPrivileged". See the attached file: do-priv.log
24-10-2024

Here is the command line I've used to check for things to remove (call from the root of your source/module): grep -lre AccessController -e PrivilegedAction . --exclude-dir build
23-10-2024