Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On JDK 9 call java.net.Authenticator.getDefault #26

Merged
merged 6 commits into from Oct 24, 2017

Conversation

@dwijnand
Copy link
Member

commented Oct 13, 2017

JDK 9 complains when java.lang.reflect.Field#setAccessible is called. So on
JDK 9 to get the default Authenticator on JDK you can just call
Authenticator.getDefault(). However ivy targets JDK 6..

So on JDK < 9 we do what we've always done, and on JDK 9+ we use java
reflection to call Authenticator.getDefault(), which is public and doesn't
require setAccessible(true).

Required for sbt/launcher#38

dwijnand added 2 commits Oct 13, 2017
On JDK 9 call java.net.Authenticator.getDefault
JDK 9 complains when java.lang.reflect.Field#setAccessible is called.
So on JDK 9 to get the default Authenticator on JDK you can just call
Authenticator.getDefault(). However ivy targets JDK 6..

So on JDK < 9 we do what we've always done, and on JDK 9+ we use java
reflection to call Authenticator.getDefault(), which is public and
doesn't require setAccessible(true).

Required for sbt/launcher#38
@eed3si9n
Copy link
Member

left a comment

eed3si9n added 3 commits Oct 16, 2017

@dwijnand dwijnand force-pushed the dwijnand:reflect-on-jdk9 branch from 54eae97 to e106f1f Oct 18, 2017

@eed3si9n
Copy link
Member

left a comment

LGTM pending Travis

@eed3si9n eed3si9n merged commit 1b57d3b into sbt:2.3.x-sbt Oct 24, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
eed3si9n added a commit to eed3si9n/librarymanagement that referenced this pull request Oct 24, 2017
Bump Ivy to 2.3.0-sbt-1b57d3bbc08ecf671169fd548918da18c91f77be
Ref sbt/ivy#26
Ref sbt/launcher#38

JDK 9 complains when java.lang.reflect.Field#setAccessible is called. So on
JDK 9 to get the default Authenticator on JDK you can just call
Authenticator.getDefault(). However ivy targets JDK 6..

So on JDK < 9 we do what we've always done, and on JDK 9+ we use java
reflection to call Authenticator.getDefault(), which is public and doesn't
require setAccessible(true).

@dwijnand dwijnand deleted the dwijnand:reflect-on-jdk9 branch Oct 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.