-
Notifications
You must be signed in to change notification settings - Fork 624
Make server timestamp methods static, rename ServerTimestamps #1222
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
Make server timestamp methods static, rename ServerTimestamps #1222
Conversation
Codecov Report
Continue to review full report at Codecov.
|
Another alternative would be to fold these into the |
switch (serverTimestampBehavior) { | ||
case PREVIOUS: | ||
return value.getPreviousValue() == null ? null : convertValue(value.getPreviousValue()); | ||
Value previousValue = getPreviousValue(serverTimestampValue); | ||
if (previousValue == null) return null; |
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.
The Java style guide suggests to use braces even for one line statements: https://engdoc.corp.google.com/eng/doc/devguide/java/style/index.md?cl=head#s4.1-braces
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.
Fixed. It's lame that Java and C++ don't align on this point.
return !timestampsInSnapshots | ||
? value.getLocalWriteTime().toDate() | ||
: value.getLocalWriteTime(); | ||
return convertTimestamp(getLocalWriteTime(serverTimestampValue)); |
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.
:) Much better.
No description provided.