null-annotate lerp.dart, annotations.dart, channel_buffers.dart, hash_codes.dart (#18348)
diff --git a/lib/ui/annotations.dart b/lib/ui/annotations.dart
index 825c863..c9a41e7 100644
--- a/lib/ui/annotations.dart
+++ b/lib/ui/annotations.dart
@@ -39,7 +39,7 @@
/// }
/// }
/// ```
-const _KeepToString keepToString = _KeepToString();
+const _KeepToString/*!*/ keepToString = _KeepToString();
class _KeepToString {
const _KeepToString();
diff --git a/lib/ui/channel_buffers.dart b/lib/ui/channel_buffers.dart
index 4b8f805..dbffda3 100644
--- a/lib/ui/channel_buffers.dart
+++ b/lib/ui/channel_buffers.dart
@@ -130,7 +130,7 @@
}
/// Returns true on overflow.
- bool push(String channel, ByteData data, PlatformMessageResponseCallback callback) {
+ bool push(String/*!*/ channel, ByteData/*!*/ data, PlatformMessageResponseCallback/*!*/ callback) {
_RingBuffer<_StoredMessage> queue = _messages[channel];
if (queue == null) {
queue = _makeRingBuffer(kDefaultBufferSize);
@@ -182,7 +182,7 @@
///
/// This should be called once a channel is prepared to handle messages
/// (i.e. when a message handler is setup in the framework).
- Future<void> drain(String channel, DrainChannelCallback callback) async {
+ Future<void> drain(String/*!*/ channel, DrainChannelCallback/*!*/ callback) async {
while (!_isEmpty(channel)) {
final _StoredMessage message = _pop(channel);
await callback(message.data, message.callback);
@@ -204,7 +204,7 @@
/// Arity: 2
/// Format: `resize\r<channel name>\r<new size>`
/// Description: Allows you to set the size of a channel's buffer.
- void handleMessage(ByteData data) {
+ void handleMessage(ByteData/*!*/ data) {
final List<String> command = _getString(data).split('\r');
if (command.length == /*arity=*/2 + 1 && command[0] == 'resize') {
_resize(command[1], int.parse(command[2]));
@@ -220,4 +220,4 @@
///
/// See also:
/// * [BinaryMessenger] - The place where ChannelBuffers are typically read.
-final ChannelBuffers channelBuffers = ChannelBuffers();
+final ChannelBuffers/*!*/ channelBuffers = ChannelBuffers();
diff --git a/lib/ui/hash_codes.dart b/lib/ui/hash_codes.dart
index e5b8b67..3242727 100644
--- a/lib/ui/hash_codes.dart
+++ b/lib/ui/hash_codes.dart
@@ -40,14 +40,14 @@
/// ```dart
/// int hashCode => hashValues(foo, bar, hashList(quux), baz);
/// ```
-int hashValues(
- Object arg01, Object arg02, [ Object arg03 = _hashEnd,
- Object arg04 = _hashEnd, Object arg05 = _hashEnd, Object arg06 = _hashEnd,
- Object arg07 = _hashEnd, Object arg08 = _hashEnd, Object arg09 = _hashEnd,
- Object arg10 = _hashEnd, Object arg11 = _hashEnd, Object arg12 = _hashEnd,
- Object arg13 = _hashEnd, Object arg14 = _hashEnd, Object arg15 = _hashEnd,
- Object arg16 = _hashEnd, Object arg17 = _hashEnd, Object arg18 = _hashEnd,
- Object arg19 = _hashEnd, Object arg20 = _hashEnd ]) {
+int/*!*/ hashValues(
+ Object/*?*/ arg01, Object/*?*/ arg02, [ Object/*?*/ arg03 = _hashEnd,
+ Object/*?*/ arg04 = _hashEnd, Object/*?*/ arg05 = _hashEnd, Object/*?*/ arg06 = _hashEnd,
+ Object/*?*/ arg07 = _hashEnd, Object/*?*/ arg08 = _hashEnd, Object/*?*/ arg09 = _hashEnd,
+ Object/*?*/ arg10 = _hashEnd, Object/*?*/ arg11 = _hashEnd, Object/*?*/ arg12 = _hashEnd,
+ Object/*?*/ arg13 = _hashEnd, Object/*?*/ arg14 = _hashEnd, Object/*?*/ arg15 = _hashEnd,
+ Object/*?*/ arg16 = _hashEnd, Object/*?*/ arg17 = _hashEnd, Object/*?*/ arg18 = _hashEnd,
+ Object/*?*/ arg19 = _hashEnd, Object/*?*/ arg20 = _hashEnd ]) {
int result = 0;
result = _Jenkins.combine(result, arg01);
result = _Jenkins.combine(result, arg02);
@@ -112,7 +112,7 @@
/// Combine the [Object.hashCode] values of an arbitrary number of objects from
/// an [Iterable] into one value. This function will return the same value if
/// given null as if given an empty list.
-int hashList(Iterable<Object> arguments) {
+int/*!*/ hashList(Iterable<Object/*?*/>/*!*/ arguments) {
int result = 0;
if (arguments != null) {
for (Object argument in arguments)
diff --git a/lib/ui/lerp.dart b/lib/ui/lerp.dart
index 00cc3bd..d61c23d 100644
--- a/lib/ui/lerp.dart
+++ b/lib/ui/lerp.dart
@@ -6,7 +6,7 @@
part of dart.ui;
/// Linearly interpolate between two numbers.
-double lerpDouble(num a, num b, double t) {
+double/*!*/ lerpDouble(num/*?*/ a, num/*?*/ b, double/*!*/ t) {
if (a == null && b == null)
return null;
a ??= 0.0;
diff --git a/lib/web_ui/lib/src/ui/annotations.dart b/lib/web_ui/lib/src/ui/annotations.dart
index 10b9ef2..4af5f3b 100644
--- a/lib/web_ui/lib/src/ui/annotations.dart
+++ b/lib/web_ui/lib/src/ui/annotations.dart
@@ -39,7 +39,7 @@
/// }
/// }
/// ```
-const _KeepToString keepToString = _KeepToString();
+const _KeepToString/*!*/ keepToString = _KeepToString();
class _KeepToString {
const _KeepToString();
diff --git a/lib/web_ui/lib/src/ui/channel_buffers.dart b/lib/web_ui/lib/src/ui/channel_buffers.dart
index b762e96..d67a90e 100644
--- a/lib/web_ui/lib/src/ui/channel_buffers.dart
+++ b/lib/web_ui/lib/src/ui/channel_buffers.dart
@@ -130,7 +130,7 @@
}
/// Returns true on overflow.
- bool push(String channel, ByteData data, PlatformMessageResponseCallback callback) {
+ bool push(String/*!*/ channel, ByteData/*!*/ data, PlatformMessageResponseCallback/*!*/ callback) {
_RingBuffer<_StoredMessage> queue = _messages[channel];
if (queue == null) {
queue = _makeRingBuffer(kDefaultBufferSize);
@@ -182,7 +182,7 @@
///
/// This should be called once a channel is prepared to handle messages
/// (i.e. when a message handler is setup in the framework).
- Future<void> drain(String channel, DrainChannelCallback callback) async {
+ Future<void> drain(String/*!*/ channel, DrainChannelCallback/*!*/ callback) async {
while (!_isEmpty(channel)) {
final _StoredMessage message = _pop(channel);
await callback(message.data, message.callback);
@@ -204,7 +204,7 @@
/// Arity: 2
/// Format: `resize\r<channel name>\r<new size>`
/// Description: Allows you to set the size of a channel's buffer.
- void handleMessage(ByteData data) {
+ void handleMessage(ByteData/*!*/ data) {
final List<String> command = _getString(data).split('\r');
if (command.length == /*arity=*/2 + 1 && command[0] == 'resize') {
_resize(command[1], int.parse(command[2]));
@@ -220,4 +220,4 @@
///
/// See also:
/// * [BinaryMessenger] - The place where ChannelBuffers are typically read.
-final ChannelBuffers channelBuffers = ChannelBuffers();
+final ChannelBuffers/*!*/ channelBuffers = ChannelBuffers();
diff --git a/lib/web_ui/lib/src/ui/hash_codes.dart b/lib/web_ui/lib/src/ui/hash_codes.dart
index 70428a8..3eca5ce 100644
--- a/lib/web_ui/lib/src/ui/hash_codes.dart
+++ b/lib/web_ui/lib/src/ui/hash_codes.dart
@@ -42,14 +42,14 @@
/// ```dart
/// int hashCode => hashValues(foo, bar, hashList(quux), baz);
/// ```
-int hashValues(
- Object arg01, Object arg02, [ Object arg03 = _hashEnd,
- Object arg04 = _hashEnd, Object arg05 = _hashEnd, Object arg06 = _hashEnd,
- Object arg07 = _hashEnd, Object arg08 = _hashEnd, Object arg09 = _hashEnd,
- Object arg10 = _hashEnd, Object arg11 = _hashEnd, Object arg12 = _hashEnd,
- Object arg13 = _hashEnd, Object arg14 = _hashEnd, Object arg15 = _hashEnd,
- Object arg16 = _hashEnd, Object arg17 = _hashEnd, Object arg18 = _hashEnd,
- Object arg19 = _hashEnd, Object arg20 = _hashEnd ]) {
+int/*!*/ hashValues(
+ Object/*?*/ arg01, Object/*?*/ arg02, [ Object/*?*/ arg03 = _hashEnd,
+ Object/*?*/ arg04 = _hashEnd, Object/*?*/ arg05 = _hashEnd, Object/*?*/ arg06 = _hashEnd,
+ Object/*?*/ arg07 = _hashEnd, Object/*?*/ arg08 = _hashEnd, Object/*?*/ arg09 = _hashEnd,
+ Object/*?*/ arg10 = _hashEnd, Object/*?*/ arg11 = _hashEnd, Object/*?*/ arg12 = _hashEnd,
+ Object/*?*/ arg13 = _hashEnd, Object/*?*/ arg14 = _hashEnd, Object/*?*/ arg15 = _hashEnd,
+ Object/*?*/ arg16 = _hashEnd, Object/*?*/ arg17 = _hashEnd, Object/*?*/ arg18 = _hashEnd,
+ Object/*?*/ arg19 = _hashEnd, Object/*?*/ arg20 = _hashEnd ]) {
int result = 0;
result = _Jenkins.combine(result, arg01);
result = _Jenkins.combine(result, arg02);
@@ -114,7 +114,7 @@
/// Combine the [Object.hashCode] values of an arbitrary number of objects from
/// an [Iterable] into one value. This function will return the same value if
/// given null as if given an empty list.
-int hashList(Iterable<Object> arguments) {
+int/*!*/ hashList(Iterable<Object/*?*/>/*!*/ arguments) {
int result = 0;
if (arguments != null) {
for (Object argument in arguments)
diff --git a/lib/web_ui/lib/src/ui/lerp.dart b/lib/web_ui/lib/src/ui/lerp.dart
index 1f09fb9..8d062cf 100644
--- a/lib/web_ui/lib/src/ui/lerp.dart
+++ b/lib/web_ui/lib/src/ui/lerp.dart
@@ -6,7 +6,7 @@
part of ui;
/// Linearly interpolate between two numbers.
-double lerpDouble(num a, num b, double t) {
+double/*!*/ lerpDouble(num/*?*/ a, num/*?*/ b, double/*!*/ t) {
if (a == null && b == null) {
return null;
}