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

[ji] support Java time APIs with Time/Date/DateTime #5183

Merged
merged 4 commits into from May 23, 2018

Conversation

kares
Copy link
Member

@kares kares commented May 22, 2018

e.g. Time.now.to_java(java.time.LocalDateTime) and friends with some consumable Java APIs

... backwards compatibility maintained -> time.to_java still gives a java.util.Date (by default)

@kares kares added this to the JRuby 9.2.0.0 milestone May 22, 2018
/**
* Return the nano-seconds of this time.
* @return nano seconds (only)
*/
public long getNanos() {
return (getTimeInMillis() % 1000) * 1_000_000 + getNSec();
public int getNanos() {
Copy link
Member

@headius headius May 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These signature changes are not against 9.1 public APIs are they?

Copy link
Member Author

@kares kares May 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java API uses int so for consistency
its a new method here (added and changed between commits in the PR)

Copy link
Member

@headius headius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes seem good and are not very invasive. If any of the signature changes affect public APIs from 9.1 we'll have to evaluate that impact.

@kares kares merged commit 397fdc8 into jruby:master May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants