Revert "Clean up the use of deprecated API in the analyzer_plugin package"

This reverts commit 86ba29265a.

The replacement API (int.tryParse) has only just been introduced and
is not yet avaiable to internal Google users.  I plan to un-do the
commit in about a week once the internal SDK has been updated.

Change-Id: Ic9206231861400d42f4814e4a56bde57ba8705a5
Reviewed-on: https://dart-review.googlesource.com/52822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry 2018-04-26 18:48:43 +00:00 committed by commit-bot@chromium.org
parent f95df2a26b
commit 115850ca1d

View file

@ -277,11 +277,9 @@ abstract class JsonDecoder {
if (json is int) {
return json;
} else if (json is String) {
int value = int.tryParse(json);
if (value == null) {
return int.parse(json, onError: (String value) {
throw mismatch(jsonPath, 'int', json);
}
return value;
});
}
throw mismatch(jsonPath, 'int', json);
}