-
Notifications
You must be signed in to change notification settings - Fork 81
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
Improve jvm version detection for java 9 #143
Conversation
8911d2f
to
ce7a55f
Compare
thanks its looking good. have planned on doing some cleanup (and drop some old Java/JRuby support) for next version 0.10 ... this would be a perfect fit to include. however I no concrete plans (yet) for this as I am a bit overloaded. hopefully you won't mind if Java 9 support isn't released right away... |
I saw some commits about dropping java 1.6 support, but could see some 1.6 specific code (jvm detection at the very least) that can probably be removed. If you could merge this PR, I'm happy to submit an additional PR to get rid of some more cruft. |
I don't mind you holding this PR for a few more days, but it's a blocker for us because it prevents us from using JRuby 9000 on java 9 by not being able to do even a basic When do you think you can release (no pressure :))? |
@@ -255,27 +255,27 @@ static void warn(final ThreadContext context, final IRubyObject msg) { | |||
public static String javaVersion(final String def) { | |||
final String javaVersionProperty = | |||
SafePropertyAccessor.getProperty("java.version", def); | |||
if ( javaVersionProperty == "0" ) return "1.7.0"; // Android | |||
if (javaVersionProperty.equals("0")) return "1.7.0"; // Android |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes it no longer null-safe (as it was before) - could you please swap the equals comparison, just in case
return atLeast ? gt <= 0 : gt == 0; | ||
} | ||
|
||
static boolean javaVersion9(final boolean atLeast) { | ||
final int gt = "9".compareTo( javaVersion("0").substring(0, 1) ); | ||
final int gt = new Version("9").compareTo(new Version(javaVersion("0.0"))); | ||
return atLeast ? gt <= 0 : gt == 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe also inner static class Version implements ...
here,
prefer not to have 'public' utils (internally) used in one place
Can we get a release out, so I can submit a PR to jruby to bump jruby-openssl? |
we're planning on managing that out but we would like to find out why we have these Java 9 mvn failures |
@kares I pushed mavengem wagon to https://oss.sonatype.org/content/repositories/snapshots/ use it by adding to Mavenfile:
this is build using jruby-9.1.14.0 with the SNAPSHOT of jruby-openssl you deployed yesterday. I did see this |
@mkristian perfect - thanks, let's give it a try and than I think we'll push a release into staging |
❤️ |
I started seeing this issue now with Java 10 (JRuby 9.1.16.0):
Has there been a release of |
Debugged this a bit more, filed a new issue - #157. |
No description provided.