Clean up the use of deprecated API in the analyzer_plugin package

Change-Id: If63afeea8042814fd87a109aa40a6ed14ea7ee59
Reviewed-on: https://dart-review.googlesource.com/51102
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Brian Wilkerson 2018-04-13 18:32:19 +00:00 committed by commit-bot@chromium.org
parent fbb60b786f
commit 86ba29265a

View file

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