Skip to content

Commit 5ba91fc

Browse files
authored
Don't use internal class (#362)
Use `CookieHandler.getDefault()` instead of the `com.sun.webkit.network.CookieManager` internal class. `CookieHandler.getDefault()` returns an instance of `com.sun.webkit.network.CookieManager` so this change results in the same behavior. This change fixes this error at runtime: ``` Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessError: class com.okta.tools.authentication.CookieManager (in unnamed module @0x1ce24091) cannot access class com.sun.webkit.network.CookieManager (in module javafx.web) because module javafx.web does not export com.sun.webkit.network to unnamed module @0x1ce24091 ```
1 parent 8ef254f commit 5ba91fc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/com/okta/tools/authentication/CookieManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
* Adaptor for {@link com.sun.webkit.network.CookieManager} that stores cookies
2828
*/
2929
public final class CookieManager extends CookieHandler {
30-
// internal class use is intentional: we need RFC6265 cookies which this OpenJFX class handles
31-
private final CookieHandler cookieHandler = new com.sun.webkit.network.CookieManager();
30+
private final CookieHandler cookieHandler = CookieHandler.getDefault();
3231
private final CookieHelper cookieHelper;
3332

3433
public CookieManager(CookieHelper cookieHelper) {

0 commit comments

Comments
 (0)