Unverified Commit 0260642f authored by Hans Muller's avatar Hans Muller Committed by GitHub

Revert some uses of Number.tryParse() (#16546)

Revert some uses of Number.tryParse(), ignore deprecation warnings for Number.parse()
parent 2c183f23
......@@ -210,7 +210,8 @@ class AndroidDevice extends Device {
// Sample output: '22'
final String sdkVersion = await _getProperty('ro.build.version.sdk');
final int sdkVersionParsed = int.tryParse(sdkVersion);
// ignore: deprecated_member_use
final int sdkVersionParsed = int.parse(sdkVersion, onError: (String source) => null);
if (sdkVersionParsed == null) {
printError('Unexpected response from getprop: "$sdkVersion"');
return false;
......@@ -817,7 +818,8 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
final AndroidDevice device;
static int _extractPort(String portString) {
return int.tryParse(portString.trim());
// ignore: deprecated_member_use
return int.parse(portString.trim(), onError: (_) => null);
}
@override
......
......@@ -499,7 +499,8 @@ class GitTagVersion {
return const GitTagVersion.unknown();
}
final List<int> parsedParts = parts.take(4).map<int>(
(String value) => int.tryParse(value),
// ignore: deprecated_member_use
(String value) => int.parse(value, onError: (String value) => null),
).toList();
return new GitTagVersion(parsedParts[0], parsedParts[1], parsedParts[2], parsedParts[3], parts[4]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment