GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: introduce `java.time` methods and variables by diegomarquezp · Pull Request #2826 · googleapis/java-storage

This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Conversation

@diegomarquezp

@diegomarquezp diegomarquezp commented Nov 21, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@diegomarquezp
feat: introduce java.time methods and variables
0ee3577
@product-auto-label 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
diegomarquezp marked this pull request as ready for review November 21, 2024 22:51
@diegomarquezp
diegomarquezp requested review from a team and lqiu96 November 21, 2024 22:51
lqiu96
lqiu96 reviewed Nov 21, 2024
View reviewed changes
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageOptions.java Outdated
Comment on lines +675 to +676
public java.time.Duration getTerminationAwaitDurationDuration() {
return java.time.Duration.ofMinutes(1);

@lqiu96 lqiu96 Nov 21, 2024

Copy link
Copy Markdown
Member

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.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@diegomarquezp diegomarquezp Nov 22, 2024

Copy link
Copy Markdown
Contributor Author

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.

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@diegomarquezp diegomarquezp Nov 25, 2024

Copy link
Copy Markdown
Contributor Author

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@diegomarquezp diegomarquezp Nov 27, 2024

Copy link
Copy Markdown
Contributor Author

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.

to confirm this with @sydney-munro and @JesseLovelace

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@diegomarquezp diegomarquezp mentioned this pull request Nov 22, 2024
feat: introduce java.time methods and variables googleapis/java-datastore#1671
Merged
@diegomarquezp
improve DurationDuration method name
26838b7
@diegomarquezp
diegomarquezp requested a review from lqiu96 November 22, 2024 19:12
@diegomarquezp
adjust naming
ff19389
lqiu96
lqiu96 approved these changes Nov 26, 2024
View reviewed changes

@lqiu96 lqiu96 left a comment

Copy link
Copy Markdown
Member

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.

LGTM once we settle JavaTimeDuration or DurationJavaTime

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
sydney-munro
sydney-munro approved these changes Dec 2, 2024
View reviewed changes
@sydney-munro
sydney-munro merged commit baf30ee into main Dec 2, 2024
@sydney-munro
sydney-munro deleted the introduce-java-time branch December 2, 2024 22:03
@release-please release-please Bot mentioned this pull request Dec 2, 2024
chore(main): release 2.46.0 #2832
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@lqiu96 lqiu96 lqiu96 approved these changes
@sydney-munro sydney-munro sydney-munro approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@diegomarquezp @lqiu96 @sydney-munro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.