From 2261aaff7b9af5159bb451087b4b6d60d5799d9c Mon Sep 17 00:00:00 2001 From: Kevin Rushforth Date: Fri, 25 Oct 2024 08:44:00 -0700 Subject: [PATCH] WIP: 8342998: Remove all uses of AccessControlException Need to update once doPriv is removed --- .../src/main/java/com/sun/javafx/css/StyleManager.java | 2 ++ .../src/main/java/com/sun/webkit/network/HTTP2Loader.java | 3 --- .../src/main/java/com/sun/webkit/network/URLLoader.java | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/javafx.graphics/src/main/java/com/sun/javafx/css/StyleManager.java b/modules/javafx.graphics/src/main/java/com/sun/javafx/css/StyleManager.java index 66319085a77..5989ef6deaa 100644 --- a/modules/javafx.graphics/src/main/java/com/sun/javafx/css/StyleManager.java +++ b/modules/javafx.graphics/src/main/java/com/sun/javafx/css/StyleManager.java @@ -948,6 +948,8 @@ static byte[] calculateCheckSum(String fname) { @SuppressWarnings("removal") public static Stylesheet loadStylesheet(final String fname) { + // KCR: FIXME: Remove the try / catch -- the entire body of the catch + // is unreachable without a security manager try { return loadStylesheetUnPrivileged(fname); } catch (java.security.AccessControlException ace) { diff --git a/modules/javafx.web/src/main/java/com/sun/webkit/network/HTTP2Loader.java b/modules/javafx.web/src/main/java/com/sun/webkit/network/HTTP2Loader.java index 4e1bec56985..22caf9a2a9f 100644 --- a/modules/javafx.web/src/main/java/com/sun/webkit/network/HTTP2Loader.java +++ b/modules/javafx.web/src/main/java/com/sun/webkit/network/HTTP2Loader.java @@ -51,7 +51,6 @@ import java.net.http.HttpResponse; import java.net.http.HttpTimeoutException; import java.nio.ByteBuffer; -import java.security.AccessControlException; import java.security.AccessController; import java.security.PrivilegedAction; import java.time.Duration; @@ -576,8 +575,6 @@ private Void didFail(final Throwable th) { throw th; } catch (MalformedURLException ex) { errorCode = LoadListenerClient.MALFORMED_URL; - } catch (@SuppressWarnings("removal") AccessControlException ex) { - errorCode = LoadListenerClient.PERMISSION_DENIED; } catch (UnknownHostException ex) { errorCode = LoadListenerClient.UNKNOWN_HOST; } catch (NoRouteToHostException ex) { diff --git a/modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java b/modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java index d4ecb40a60a..e5ff29337ec 100644 --- a/modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java +++ b/modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java @@ -51,7 +51,6 @@ import java.net.URLDecoder; import java.net.UnknownHostException; import java.nio.ByteBuffer; -import java.security.AccessControlException; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.List; @@ -186,9 +185,6 @@ private void doRun() { } catch (MalformedURLException ex) { error = ex; errorCode = LoadListenerClient.MALFORMED_URL; - } catch (@SuppressWarnings("removal") AccessControlException ex) { - error = ex; - errorCode = LoadListenerClient.PERMISSION_DENIED; } catch (UnknownHostException ex) { error = ex; errorCode = LoadListenerClient.UNKNOWN_HOST;