Skip to content

Commit 66ba0cf

Browse files
srawlinsCommit Queue
authored andcommitted
vm_service: Make SocketProfile.sockets non-late.
We only need to adjust a private constructor to make it non-late [1] [2]. [1]: https://dart.dev/effective-dart/usage#dont-use-late-when-a-constructor-initializer-list-will-do [2]: https://dart.dev/effective-dart/design#avoid-public-late-final-fields-without-initializers Change-Id: Ia063718104027a1cec147ca94d7ce34a661f5efd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435000 Reviewed-by: Ben Konyi <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
1 parent b112bb9 commit 66ba0cf

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pkg/vm_service/lib/src/dart_io_extensions.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,18 +270,18 @@ class SocketProfile extends Response {
270270
String get type => 'SocketProfile';
271271

272272
/// List of socket statistics.
273-
late final List<SocketStatistic> sockets;
273+
final List<SocketStatistic> sockets;
274274

275275
SocketProfile({required this.sockets});
276276

277-
SocketProfile._fromJson(Map<String, dynamic> json) {
278-
// TODO(bkonyi): make this part of the vm_service.dart library so we can
279-
// call super._fromJson.
280-
sockets = List<SocketStatistic>.from(
281-
createServiceObject(json['sockets'], const ['SocketStatistic'])
282-
as List? ??
283-
[]);
284-
}
277+
SocketProfile._fromJson(Map<String, dynamic> json)
278+
:
279+
// TODO(bkonyi): make this part of the vm_service.dart library so we can
280+
// call super._fromJson.
281+
sockets = List<SocketStatistic>.from(
282+
createServiceObject(json['sockets'], const ['SocketStatistic'])
283+
as List? ??
284+
[]);
285285
}
286286

287287
/// A [Response] containing the enabled state of a service extension.

0 commit comments

Comments
 (0)