From 2d7376ea378b14548b1d417df285a0a5c84957ba Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Thu, 14 Dec 2023 02:38:22 -0800 Subject: [PATCH] Internal change PiperOrigin-RevId: 590871044 --- .../com/google/protobuf/util/Durations.java | 20 +++++------ .../com/google/protobuf/util/Timestamps.java | 36 +++++++++---------- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/java/util/src/main/java/com/google/protobuf/util/Durations.java b/java/util/src/main/java/com/google/protobuf/util/Durations.java index a73ab9f0aa38..05e0e217f4a5 100644 --- a/java/util/src/main/java/com/google/protobuf/util/Durations.java +++ b/java/util/src/main/java/com/google/protobuf/util/Durations.java @@ -426,13 +426,13 @@ public static long toNanos(Duration duration) { * Add two durations. * * - *

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}. - * - *

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}. * */ + @Deprecated // MOE:strip_line public static Duration add(Duration d1, Duration d2) { checkValid(d1); checkValid(d2); @@ -444,13 +444,13 @@ public static Duration add(Duration d1, Duration d2) { * Subtract a duration from another. * * - *

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}. - * - *

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}. * */ + @Deprecated // MOE:strip_line public static Duration subtract(Duration d1, Duration d2) { checkValid(d1); checkValid(d2); diff --git a/java/util/src/main/java/com/google/protobuf/util/Timestamps.java b/java/util/src/main/java/com/google/protobuf/util/Timestamps.java index 99daeb32603d..cdd8027d993d 100644 --- a/java/util/src/main/java/com/google/protobuf/util/Timestamps.java +++ b/java/util/src/main/java/com/google/protobuf/util/Timestamps.java @@ -431,13 +431,13 @@ public static long toNanos(Timestamp timestamp) { * Calculate the difference between two timestamps. * * - *

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}. - * - *

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}. * */ + @Deprecated // MOE:strip_line public static Duration between(Timestamp from, Timestamp to) { checkValid(from); checkValid(to); @@ -450,15 +450,14 @@ public static Duration between(Timestamp from, Timestamp to) { * Add a duration to a timestamp. * * - *

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}. - * - *

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}. * */ + @Deprecated // MOE:strip_line public static Timestamp add(Timestamp start, Duration length) { checkValid(start); Durations.checkValid(length); @@ -471,15 +470,14 @@ public static Timestamp add(Timestamp start, Duration length) { * Subtract a duration from a timestamp. * * - *

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}. - * - *

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}. * */ + @Deprecated // MOE:strip_line public static Timestamp subtract(Timestamp start, Duration length) { checkValid(start); Durations.checkValid(length);