summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Sauer <jsauer@google.com>2017-04-20 11:57:53 +0100
committerJoachim Sauer <jsauer@google.com>2017-04-25 20:18:37 +0100
commitf68824d25b14aaea71bc21d6723275c7dc854968 (patch)
tree4fc2fbf93460b37be27956b10b965fc5cf64fc30
parent22554ec6123f98b7b019176f36e6003bcf70f4c2 (diff)
downloadicu-f68824d25b14aaea71bc21d6723275c7dc854968.tar.gz
Deprecate internal Calendar methods.
These methods suffer from a potential integer overflow that can't be fixed without changing their signature as described at http://bugs.icu-project.org/trac/ticket/11632. Since they could be overridden, we need to deprecate them for at least one release before changing/removing them. Bug: 30300853 Test: m checkbuild && m offline-sdk-referenceonly-docs (cherry picked from commit b78e656948d274bcbb70a607551781005985c74c) Change-Id: I74104a9986293ff5ef5da263255e7740e5afa952
-rw-r--r--android_icu4j/src/main/java/android/icu/util/Calendar.java6
-rw-r--r--tools/srcgen/resources/replacements.txt29
2 files changed, 35 insertions, 0 deletions
diff --git a/android_icu4j/src/main/java/android/icu/util/Calendar.java b/android_icu4j/src/main/java/android/icu/util/Calendar.java
index 2d304411e..c06e360f9 100644
--- a/android_icu4j/src/main/java/android/icu/util/Calendar.java
+++ b/android_icu4j/src/main/java/android/icu/util/Calendar.java
@@ -5475,6 +5475,9 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* value from 0 to 23:59:59.999 inclusive, unless fields are out of
* range, in which case it can be an arbitrary value. This value
* reflects local zone wall time.
+ * @deprecated This method suffers from a potential integer overflow and may be removed or
+ * changed in a future release. See <a href="http://bugs.icu-project.org/trac/ticket/11632">
+ * ICU ticket #11632</a> for details.
*/
protected int computeMillisInDay() {
// Do the time portion of the conversion.
@@ -5520,6 +5523,9 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* @param millisInDay milliseconds of the time fields; may be out
* or range.
* @return total zone offset (raw + DST) for the given moment
+ * @deprecated This method suffers from a potential integer overflow and may be removed or
+ * changed in a future release. See <a href="http://bugs.icu-project.org/trac/ticket/11632">
+ * ICU ticket #11632</a> for details.
*/
protected int computeZoneOffset(long millis, int millisInDay) {
int[] offsets = new int[2];
diff --git a/tools/srcgen/resources/replacements.txt b/tools/srcgen/resources/replacements.txt
index 554948a6b..c623ab95a 100644
--- a/tools/srcgen/resources/replacements.txt
+++ b/tools/srcgen/resources/replacements.txt
@@ -361,3 +361,32 @@
* @stable ICU 2.8
*/
--
+
+# Deprecate method.
+--method:android.icu.util.Calendar#computeZoneOffset(long,int)
+/**
+ * This method can assume EXTENDED_YEAR has been set.
+ * @param millis milliseconds of the date fields (local midnight millis)
+ * @param millisInDay milliseconds of the time fields; may be out
+ * or range.
+ * @return total zone offset (raw + DST) for the given moment
+ * @stable ICU 2.0
+ * @deprecated This method suffers from a potential integer overflow and may be removed or
+ * changed in a future release. See <a href="http://bugs.icu-project.org/trac/ticket/11632">
+ * ICU ticket #11632</a> for details.
+ */
+--
+
+# Deprecate method.
+--method:android.icu.util.Calendar#computeMillisInDay()
+/**
+ * Compute the milliseconds in the day from the fields. This is a
+ * value from 0 to 23:59:59.999 inclusive, unless fields are out of
+ * range, in which case it can be an arbitrary value. This value
+ * reflects local zone wall time.
+ * @stable ICU 2.0
+ * @deprecated This method suffers from a potential integer overflow and may be removed or
+ * changed in a future release. See <a href="http://bugs.icu-project.org/trac/ticket/11632">
+ * ICU ticket #11632</a> for details.
+ */
+--