Skip to content

Commit

Permalink
Don't use internal class (oktadev#362)
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
candrews committed Jun 7, 2021
1 parent 8ef254f commit 5ba91fc
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
* Adaptor for {@link com.sun.webkit.network.CookieManager} that stores cookies
*/
public final class CookieManager extends CookieHandler {
// internal class use is intentional: we need RFC6265 cookies which this OpenJFX class handles
private final CookieHandler cookieHandler = new com.sun.webkit.network.CookieManager();
private final CookieHandler cookieHandler = CookieHandler.getDefault();
private final CookieHelper cookieHelper;

public CookieManager(CookieHelper cookieHelper) {
Expand Down

0 comments on commit 5ba91fc

Please sign in to comment.