You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GitHubHttpUrlConnectionClient uses forbidden behavior in JDK 16+ #1202
Describe the bug
Using GHReleaseUpdater#update and JDK 16.0.1, following exception is thrown:
Unable to make field private final sun.net.www.protocol.https.DelegateHttpsURLConnection sun.net.www.protocol.https.HttpsURLConnectionImpl.delegate accessible: module java.base does not "opens sun.net.www.protocol.https" to unnamed module @326e57ed
at org.kohsuke.github.GitHubHttpUrlConnectionClient$HttpURLConnectionResponseInfo.setRequestMethod(GitHubHttpUrlConnectionClient.java:176)
at org.kohsuke.github.GitHubHttpUrlConnectionClient$HttpURLConnectionResponseInfo.setupConnection(GitHubHttpUrlConnectionClient.java:119)
at org.kohsuke.github.GitHubHttpUrlConnectionClient.getResponseInfo(GitHubHttpUrlConnectionClient.java:56)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:387)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:355)
at org.kohsuke.github.Requester.fetch(Requester.java:76)
at org.kohsuke.github.GHReleaseUpdater.update(GHReleaseUpdater.java:116)
at Build_gradle$2$2.execute(build.gradle.kts:107)
To Reproduce
Steps to reproduce the behavior:
I used this small Kotlin snippet to execute the code, while using JDK 16:
val ghRelease = releaseBuilder.create()
ghRelease.update().name("new fancy name").update()
Expected behavior
The release should be updated.
Additional context
This happens in a GitHub Action environment using the adoptopenjdk:16-jdk container. I assume this is because of some JDK internals being harder to access and JDK 16 removing the functionality of making final fields non-final through reflection.
I'm surprised that the changes that would have fixed this were reverted with c197dc6. Any update on anything that will fix that or will we have to wait on an implementation of #1085?
changed the title [-]GitHubHttpUrlConnectionClient uses forbidden behavior in JDK 16[/-][+]GitHubHttpUrlConnectionClient uses forbidden behavior in JDK 16+[/+]on Sep 28, 2021
Activity
gsmet commentedon Jul 31, 2021
For now, you can use the OkHttp connector:
bitwiseman commentedon Aug 2, 2021
It is also possible to unblock to this on Java 16 with special settings.
See #754 and #1164.
Or some one can provide the resources needed to fix this. I'm more than happy to provide guidance.
[-]GitHubHttpUrlConnectionClient uses forbidden behavior in JDK 16[/-][+]GitHubHttpUrlConnectionClient uses forbidden behavior in JDK 16+[/+]