Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 590871044
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Dec 14, 2023
1 parent 543fbcd commit 2d7376e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 29 deletions.
20 changes: 10 additions & 10 deletions java/util/src/main/java/com/google/protobuf/util/Durations.java
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,13 @@ public static long toNanos(Duration duration) {
* Add two durations.
*
* <!-- MOE:begin_intracomment_strip -->
* <p>Do not use this method for new code. Instead, convert to {@link java.time.Duration} using
* {@link com.google.protobuf.util.JavaTimeConversions#toJavaDuration}, do the arithmetic there,
* and convert back using {@link com.google.protobuf.util.JavaTimeConversions#toProtoDuration}.
*
* <p>This method will be deprecated once most uses have been eliminated.
* @deprecated Do not use this method for new code. Instead, convert to {@link java.time.Duration}
* using {@link com.google.protobuf.util.JavaTimeConversions#toJavaDuration}, do the
* arithmetic there, and convert back using {@link
* com.google.protobuf.util.JavaTimeConversions#toProtoDuration}.
* <!-- MOE:end_intracomment_strip -->
*/
@Deprecated // MOE:strip_line
public static Duration add(Duration d1, Duration d2) {
checkValid(d1);
checkValid(d2);
Expand All @@ -444,13 +444,13 @@ public static Duration add(Duration d1, Duration d2) {
* Subtract a duration from another.
*
* <!-- MOE:begin_intracomment_strip -->
* <p>Do not use this method for new code. Instead, convert to {@link java.time.Duration} using
* {@link com.google.protobuf.util.JavaTimeConversions#toJavaDuration}, do the arithmetic there,
* and convert back using {@link com.google.protobuf.util.JavaTimeConversions#toProtoDuration}.
*
* <p>This method will be deprecated once most uses have been eliminated.
* @deprecated Do not use this method for new code. Instead, convert to {@link java.time.Duration}
* using {@link com.google.protobuf.util.JavaTimeConversions#toJavaDuration}, do the
* arithmetic there, and convert back using {@link
* com.google.protobuf.util.JavaTimeConversions#toProtoDuration}.
* <!-- MOE:end_intracomment_strip -->
*/
@Deprecated // MOE:strip_line
public static Duration subtract(Duration d1, Duration d2) {
checkValid(d1);
checkValid(d2);
Expand Down
36 changes: 17 additions & 19 deletions java/util/src/main/java/com/google/protobuf/util/Timestamps.java
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,13 @@ public static long toNanos(Timestamp timestamp) {
* Calculate the difference between two timestamps.
*
* <!-- MOE:begin_intracomment_strip -->
* <p>Do not use this method for new code. Instead, convert to {@link java.time.Instant} using
* {@link com.google.protobuf.util.JavaTimeConversions#toJavaInstant}, do the arithmetic there,
* and convert back using {@link com.google.protobuf.util.JavaTimeConversions#toProtoDuration}.
*
* <p>This method will be deprecated once most uses have been eliminated.
* @deprecated Do not use this method for new code. Instead, convert to {@link java.time.Instant}
* using {@link com.google.protobuf.util.JavaTimeConversions#toJavaInstant}, do the arithmetic
* there, and convert back using {@link
* com.google.protobuf.util.JavaTimeConversions#toProtoDuration}.
* <!-- MOE:end_intracomment_strip -->
*/
@Deprecated // MOE:strip_line
public static Duration between(Timestamp from, Timestamp to) {
checkValid(from);
checkValid(to);
Expand All @@ -450,15 +450,14 @@ public static Duration between(Timestamp from, Timestamp to) {
* Add a duration to a timestamp.
*
* <!-- MOE:begin_intracomment_strip -->
* <p>Do not use this method for new code. Instead, convert to {@link java.time.Instant} and
* {@link java.time.Duration} using {@link
* com.google.protobuf.util.JavaTimeConversions#toJavaInstant} and {@link
* com.google.protobuf.util.JavaTimeConversions#toJavaDuration}, do the arithmetic there, and
* convert back using {@link com.google.protobuf.util.JavaTimeConversions#toProtoTimestamp}.
*
* <p>This method will be deprecated once most uses have been eliminated.
* @deprecated Do not use this method for new code. Instead, convert to {@link java.time.Instant}
* and {@link java.time.Duration} using {@link
* com.google.protobuf.util.JavaTimeConversions#toJavaInstant} and {@link
* com.google.protobuf.util.JavaTimeConversions#toJavaDuration}, do the arithmetic there, and
* convert back using {@link com.google.protobuf.util.JavaTimeConversions#toProtoTimestamp}.
* <!-- MOE:end_intracomment_strip -->
*/
@Deprecated // MOE:strip_line
public static Timestamp add(Timestamp start, Duration length) {
checkValid(start);
Durations.checkValid(length);
Expand All @@ -471,15 +470,14 @@ public static Timestamp add(Timestamp start, Duration length) {
* Subtract a duration from a timestamp.
*
* <!-- MOE:begin_intracomment_strip -->
* <p>Do not use this method for new code. Instead, convert to {@link java.time.Instant} and
* {@link java.time.Duration} using {@link
* com.google.protobuf.util.JavaTimeConversions#toJavaInstant} and {@link
* com.google.protobuf.util.JavaTimeConversions#toJavaDuration}, do the arithmetic there, and
* convert back using {@link com.google.protobuf.util.JavaTimeConversions#toProtoTimestamp}.
*
* <p>This method will be deprecated once most uses have been eliminated.
* @deprecated Do not use this method for new code. Instead, convert to {@link java.time.Instant}
* and {@link java.time.Duration} using {@link
* com.google.protobuf.util.JavaTimeConversions#toJavaInstant} and {@link
* com.google.protobuf.util.JavaTimeConversions#toJavaDuration}, do the arithmetic there, and
* convert back using {@link com.google.protobuf.util.JavaTimeConversions#toProtoTimestamp}.
* <!-- MOE:end_intracomment_strip -->
*/
@Deprecated // MOE:strip_line
public static Timestamp subtract(Timestamp start, Duration length) {
checkValid(start);
Durations.checkValid(length);
Expand Down

0 comments on commit 2d7376e

Please sign in to comment.