github-api: Illegal Reflective Access Operation to field java.net.HttpURLConnection.method
Describe the bug I attempt to archive a repository using the following code:
GHRepository repo = this.org.getRepository("repo-name-here");
repo.archive();
When checking GitHub itself, the repository is in fact archived, however I receive a warning in the stderr stream consisting of the following:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.kohsuke.github.GitHubHttpUrlConnectionClient$HttpURLConnectionResponseInfo (file:/C:/Users/andrew/.m2/repository/org/kohsuke/github-api/1.108/github-api-1.108.jar) to field java.net.HttpURLConnection.method
WARNING: Please consider reporting this to the maintainers of org.kohsuke.github.GitHubHttpUrlConnectionClient$HttpURLConnectionResponseInfo
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
To Reproduce Steps to reproduce the behavior:
- Fetch a
GHRepository
that is not yet archived. - Call
archive()
on that repository.
Expected behavior I expect that there should not be any illegal reflective access exceptions.
Desktop (please complete the following information):
- OS: Windows 10
- Browser Firefox
- Version 74
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (10 by maintainers)
Commits related to this issue
- Replace reflection with X-HTTP-Method-Override Fixes #754 — committed to bitwiseman/github-api by bitwiseman 3 years ago
Thank you @bitwiseman 😄 ! I’ll give it a try tomorrow, it’s close to midnight where I am right now. Will report back as soon as I have something conclusive.
Thanks @bitwiseman! These are the relevant kotlin changes I was able to do based on your input:
additional dependency using kotlin dsl (build.gradle.kts)
some kt file
How about something like this: