From 8a7ae957ff77d1988e84ae94a591fe534cbc6b63 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Sat, 15 Dec 2018 08:32:20 -0800 Subject: [PATCH] Undeprecated BigInteger support, but document what it actually does. (#6903) --- .../flutter/plugin/common/StandardMessageCodec.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/shell/platform/android/io/flutter/plugin/common/StandardMessageCodec.java b/shell/platform/android/io/flutter/plugin/common/StandardMessageCodec.java index 63d63b2a2..c22ea07a9 100644 --- a/shell/platform/android/io/flutter/plugin/common/StandardMessageCodec.java +++ b/shell/platform/android/io/flutter/plugin/common/StandardMessageCodec.java @@ -30,6 +30,7 @@ import android.util.Log; *
  • null
  • *
  • Booleans
  • *
  • Bytes, Shorts, Integers, Longs
  • + *
  • BigIntegers (see below)
  • *
  • Floats, Doubles
  • *
  • Strings
  • *
  • byte[], int[], long[], double[]
  • @@ -53,11 +54,8 @@ import android.util.Log; *
  • Map: Map
  • * * - *

    Direct support for BigIntegers has been deprecated on 2018-01-09 to be made - * unavailable four weeks after this change is available on the Flutter alpha - * branch. BigIntegers were needed because the Dart 1.0 int type had no size - * limit. With Dart 2.0, the int type is a fixed-size, 64-bit signed integer. - * If you need to communicate larger integers, use String encoding instead.

    + *

    BigIntegers are represented in Dart as strings with the + * hexadecimal representation of the integer's value.

    * *

    To extend the codec, overwrite the writeValue and readValueOfType methods.

    */ @@ -96,7 +94,6 @@ public class StandardMessageCodec implements MessageCodec { private static final byte FALSE = 2; private static final byte INT = 3; private static final byte LONG = 4; - @Deprecated private static final byte BIGINT = 5; private static final byte DOUBLE = 6; private static final byte STRING = 7; @@ -237,7 +234,6 @@ public class StandardMessageCodec implements MessageCodec { writeAlignment(stream, 8); writeDouble(stream, ((Number) value).doubleValue()); } else if (value instanceof BigInteger) { - Log.w("Flutter", "Support for BigIntegers has been deprecated. Use String encoding instead."); stream.write(BIGINT); writeBytes(stream, ((BigInteger) value).toString(16).getBytes(UTF8)); @@ -367,7 +363,6 @@ public class StandardMessageCodec implements MessageCodec { result = buffer.getLong(); break; case BIGINT: { - Log.w("Flutter", "Support for BigIntegers has been deprecated. Use String encoding instead."); final byte[] hex = readBytes(buffer); result = new BigInteger(new String(hex, UTF8), 16); break; -- GitLab