KEMBAR78
feat: introduce `java.time` variables and methods by diegomarquezp · Pull Request #1935 · googleapis/java-firestore · GitHub
Skip to content

Conversation

@diegomarquezp
Copy link
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 product-auto-label bot added size: m Pull request size is medium. api: firestore Issues related to the googleapis/java-firestore API. labels Nov 19, 2024
@diegomarquezp diegomarquezp marked this pull request as ready for review November 19, 2024 23:06
@diegomarquezp diegomarquezp requested review from a team as code owners November 19, 2024 23:06
@diegomarquezp diegomarquezp requested a review from lqiu96 November 19, 2024 23:06
// expressed as fractional
// seconds.
String durationString(org.threeten.bp.Duration duration) {
String durationStringDuration(java.time.Duration duration) {
Copy link
Member

Choose a reason for hiding this comment

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

This is package-private. I think we can straight replace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Overload removed

@diegomarquezp diegomarquezp requested a review from lqiu96 November 20, 2024 21:35
Comment on lines +511 to +513
@Override
public java.time.Duration getTotalRequestTimeoutDuration() {
return firestoreOptions.getRetrySettings().getTotalTimeoutDuration();
Copy link
Member

Choose a reason for hiding this comment

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

nit: Would be nice to get javadocs from firestore for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ehsannas for visibility - the superclass does not have javadocs on this method

Copy link
Member

@lqiu96 lqiu96 left a comment

Choose a reason for hiding this comment

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

LGTM. Firestore team for final review

@diegomarquezp diegomarquezp merged commit 6c94910 into main Nov 21, 2024
24 checks passed
@diegomarquezp diegomarquezp deleted the introduce-java-time branch November 21, 2024 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants