RFR: 8300872: WebView's ColorChooser fails to initialize when running in security context

Jose Pereda jpereda at openjdk.org
Wed Mar 1 17:47:16 UTC 2023


On Wed, 1 Mar 2023 15:48:43 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> This PR removes an unnecessary check that was added as part of [JDK-8267551](https://bugs.openjdk.org/browse/JDK-8267551).
>> 
>> As commented in the [issue](https://bugs.openjdk.org/browse/JDK-8300872), there were no failing/passing tests before/after these lines were added, and there are no actual tests that get into the case.
>> 
>> The mentioned check caused, as a side effect, the JDK-8300872 issue, as running under a (deprecated) security manager fails with:
>> 
>> java.security.AccessControlException: access denied ("java.io.FilePermission" "jrt:/javafx.controls/com/sun/javafx/scene/control/skin/modena/pattern-transparent.png" "read")
>> ...
>> at javafx.graphics/javafx.scene.image.Image.validateUrl(Image.java:1127)
>> ...
>> 
>> when `File::exists` is evaluated over an image bundled in a jar.
>
> I confirm that this does allow an HTML color-picker to load (good), I note that the exception still occurs later on, but at a point where it is treated as a warning instead of an error.
> 
> 
> WARNING: Error loading image: jar:file:///.../build/sdk/lib/javafx.controls.jar!/com/sun/javafx/scene/control/skin/modena/pattern-transparent.png
> 
> 
> We have other known problems loading some built-in resources when using the security manager, such as [JDK-8177284](https://bugs.openjdk.org/browse/JDK-8177284). Since it is deprecated, we aren't likely to spend any time on them, so this PR might be a reasonable solution to the failure.
> 
> Can you provide a test case?
> 
> Also, I'd like @mstr2 to comment on the check that you propose to remove.

@kevinrushforth Do you mean a system test case with a custom policy file? I just noticed that `Util::createApplicationLaunchCommand` allows such case.

-------------

PR: https://git.openjdk.org/jfx/pull/1042


More information about the openjfx-dev mailing list