FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: introduce `java.time` methods and variables by diegomarquezp · Pull Request #2826 · googleapis/java-storage · GitHub

feat: introduce java.time methods and variables - #2826

Merged
sydney-munro merged 3 commits into
mainfrom
introduce-java-time
Dec 2, 2024
Merged

feat: introduce java.time methods and variables#2826
sydney-munro merged 3 commits into
mainfrom
introduce-java-time

Conversation

diegomarquezp commented Nov 21, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

This PR introduces java.time alternatives to existing org.threeten.bp.* methods, as well as switching internal variables (if any) to java.time

The main constraint is to keep the changes backwards compatible, so for each existing threeten method "method1(org.threeten.bp.Duration)" we will add an alternative with a Duration (or Timestamp when applicable) suffix: "method1Duration(java.time.Duration)".

For most cases, the implementation will be held in the java.time method and the old threeten method will just delegate the call to it. However, for the case of abstract classes, the implementation will be kept in the threeten method to avoid breaking changes (i.e. users that already overloaded the method in their user code).

product-auto-label Bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/java-storage API. labels Nov 21, 2024
diegomarquezp marked this pull request as ready for review November 21, 2024 22:51
diegomarquezp requested review from a team and lqiu96 November 21, 2024 22:51
Comment on lines +675 to +676
public java.time.Duration getTerminationAwaitDurationDuration() {
return java.time.Duration.ofMinutes(1);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't think we've seen this case before (or at least I don't recall). But if the method ends with Duration then we come across DurationDuration and I think that's even more confusing.

Maybe we want to keep this for consistency with all other SDK methods, but I'm thinking that naming scheme isn't ideal.

Perhaps getTerminationAwaitJavaTimeDuration()? Open to suggestions for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Cross linking googleapis/java-datastore#1671 (comment)

I like JavaTimeDuration as the suffix. Let's use it in datastore too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I agree with the point in googleapis/java-datastore#1671 (comment) saying that using DurationJavaTime keeps the prefixes consistent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

to confirm this with @sydney-munro and @JesseLovelace

diegomarquezp requested a review from lqiu96 November 22, 2024 19:12

lqiu96 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM once we settle JavaTimeDuration or DurationJavaTime

sydney-munro merged commit baf30ee into main Dec 2, 2024
sydney-munro deleted the introduce-java-time branch December 2, 2024 22:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/java-storage API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL