Unverified Commit 3c379aaf authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

whitespace cleanup (#14458)

parent f5dea932
...@@ -544,7 +544,7 @@ Future<Null> _verifyGeneratedPluginRegistrants(String flutterRoot) async { ...@@ -544,7 +544,7 @@ Future<Null> _verifyGeneratedPluginRegistrants(String flutterRoot) async {
for (String package in packageToRegistrants.keys) { for (String package in packageToRegistrants.keys) {
final Map<File, String> fileToContent = <File, String>{}; final Map<File, String> fileToContent = <File, String>{};
for(File f in packageToRegistrants[package]) { for (File f in packageToRegistrants[package]) {
fileToContent[f] = f.readAsStringSync(); fileToContent[f] = f.readAsStringSync();
} }
await _runCommand(flutter, <String>['inject-plugins'], await _runCommand(flutter, <String>['inject-plugins'],
......
...@@ -23,7 +23,7 @@ Future<Null> main(List<String> rawArgs) async { ...@@ -23,7 +23,7 @@ Future<Null> main(List<String> rawArgs) async {
ArgResults args; ArgResults args;
try { try {
args = _argParser.parse(rawArgs); args = _argParser.parse(rawArgs);
} on FormatException catch(error) { } on FormatException catch (error) {
stderr.writeln('${error.message}\n'); stderr.writeln('${error.message}\n');
stderr.writeln('Usage:\n'); stderr.writeln('Usage:\n');
stderr.writeln(_argParser.usage); stderr.writeln(_argParser.usage);
......
...@@ -77,7 +77,7 @@ void main() { ...@@ -77,7 +77,7 @@ void main() {
return new TaskResult.failure('Gradle did not produce an apk file at the expected place'); return new TaskResult.failure('Gradle did not produce an apk file at the expected place');
return new TaskResult.success(null); return new TaskResult.success(null);
} catch(e) { } catch (e) {
return new TaskResult.failure(e.toString()); return new TaskResult.failure(e.toString());
} finally { } finally {
project.parent.deleteSync(recursive: true); project.parent.deleteSync(recursive: true);
......
...@@ -170,7 +170,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery { ...@@ -170,7 +170,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
// TODO(yjbanov): check battery level // TODO(yjbanov): check battery level
await device._getWakefulness(); await device._getWakefulness();
results['android-device-$deviceId'] = new HealthCheckResult.success(); results['android-device-$deviceId'] = new HealthCheckResult.success();
} catch(e, s) { } catch (e, s) {
results['android-device-$deviceId'] = new HealthCheckResult.error(e, s); results['android-device-$deviceId'] = new HealthCheckResult.error(e, s);
} }
} }
......
...@@ -476,7 +476,7 @@ String extractCloudAuthTokenArg(List<String> rawArgs) { ...@@ -476,7 +476,7 @@ String extractCloudAuthTokenArg(List<String> rawArgs) {
ArgResults args; ArgResults args;
try { try {
args = argParser.parse(rawArgs); args = argParser.parse(rawArgs);
} on FormatException catch(error) { } on FormatException catch (error) {
stderr.writeln('${error.message}\n'); stderr.writeln('${error.message}\n');
stderr.writeln('Usage:\n'); stderr.writeln('Usage:\n');
stderr.writeln(argParser.usage); stderr.writeln(argParser.usage);
......
...@@ -36,7 +36,7 @@ void main() { ...@@ -36,7 +36,7 @@ void main() {
test(testDescription, () { test(testDescription, () {
try { try {
loadTaskManifest(yaml); loadTaskManifest(yaml);
} on ManifestError catch(error) { } on ManifestError catch (error) {
expect(error.message, errorMessage); expect(error.message, errorMessage);
} }
}); });
......
...@@ -96,7 +96,7 @@ String generateTranslationBundles() { ...@@ -96,7 +96,7 @@ String generateTranslationBundles() {
final Map<String, List<String>> languageToLocales = <String, List<String>>{}; final Map<String, List<String>> languageToLocales = <String, List<String>>{};
final Set<String> allResourceIdentifiers = new Set<String>(); final Set<String> allResourceIdentifiers = new Set<String>();
for(String locale in localeToResources.keys.toList()..sort()) { for (String locale in localeToResources.keys.toList()..sort()) {
final List<String> codes = locale.split('_'); // [language, country] final List<String> codes = locale.split('_'); // [language, country]
assert(codes.length == 1 || codes.length == 2); assert(codes.length == 1 || codes.length == 2);
languageToLocales[codes[0]] ??= <String>[]; languageToLocales[codes[0]] ??= <String>[];
...@@ -142,7 +142,7 @@ class TranslationBundle { ...@@ -142,7 +142,7 @@ class TranslationBundle {
// @override String get scriptCategory => r'English-like'; // @override String get scriptCategory => r'English-like';
// ... // ...
// } // }
for(String language in languageToLocales.keys) { for (String language in languageToLocales.keys) {
final Map<String, String> resources = localeToResources[language]; final Map<String, String> resources = localeToResources[language];
output.writeln(''' output.writeln('''
...@@ -170,9 +170,9 @@ class _Bundle_$language extends TranslationBundle { ...@@ -170,9 +170,9 @@ class _Bundle_$language extends TranslationBundle {
// @override String get licensesPageTitle => r'Licences'; // @override String get licensesPageTitle => r'Licences';
// ... // ...
// } // }
for(String language in languageToLocales.keys) { for (String language in languageToLocales.keys) {
final Map<String, String> languageResources = localeToResources[language]; final Map<String, String> languageResources = localeToResources[language];
for(String localeName in languageToLocales[language]) { for (String localeName in languageToLocales[language]) {
if (localeName == language) if (localeName == language)
continue; continue;
final Map<String, String> localeResources = localeToResources[localeName]; final Map<String, String> localeResources = localeToResources[localeName];
...@@ -198,8 +198,8 @@ class _Bundle_$localeName extends TranslationBundle { ...@@ -198,8 +198,8 @@ class _Bundle_$localeName extends TranslationBundle {
output.writeln(''' output.writeln('''
TranslationBundle translationBundleForLocale(Locale locale) { TranslationBundle translationBundleForLocale(Locale locale) {
switch(locale.languageCode) {'''); switch (locale.languageCode) {''');
for(String language in languageToLocales.keys) { for (String language in languageToLocales.keys) {
if (languageToLocales[language].length == 1) { if (languageToLocales[language].length == 1) {
output.writeln(''' output.writeln('''
case \'$language\': case \'$language\':
...@@ -207,8 +207,8 @@ TranslationBundle translationBundleForLocale(Locale locale) { ...@@ -207,8 +207,8 @@ TranslationBundle translationBundleForLocale(Locale locale) {
} else { } else {
output.writeln(''' output.writeln('''
case \'$language\': { case \'$language\': {
switch(locale.toString()) {'''); switch (locale.toString()) {''');
for(String localeName in languageToLocales[language]) { for (String localeName in languageToLocales[language]) {
if (localeName == language) if (localeName == language)
continue; continue;
output.writeln(''' output.writeln('''
......
...@@ -29,9 +29,9 @@ class Stock { ...@@ -29,9 +29,9 @@ class Stock {
// FIXME: This class should only have static data, not lastSale, etc. // FIXME: This class should only have static data, not lastSale, etc.
// "Symbol","Name","LastSale","MarketCap","IPOyear","Sector","industry","Summary Quote", // "Symbol","Name","LastSale","MarketCap","IPOyear","Sector","industry","Summary Quote",
lastSale = 0.0; lastSale = 0.0;
try{ try {
lastSale = double.parse(fields[2]); lastSale = double.parse(fields[2]);
} catch(_) {} } catch (_) {}
symbol = fields[0]; symbol = fields[0];
name = fields[1]; name = fields[1];
marketCap = fields[4]; marketCap = fields[4];
......
...@@ -340,7 +340,7 @@ class WidgetInspectorService { ...@@ -340,7 +340,7 @@ class WidgetInspectorService {
List<_DiagnosticsPathNode> _getRenderObjectParentChain(RenderObject renderObject, String groupName) { List<_DiagnosticsPathNode> _getRenderObjectParentChain(RenderObject renderObject, String groupName) {
final List<RenderObject> chain = <RenderObject>[]; final List<RenderObject> chain = <RenderObject>[];
while(renderObject != null) { while (renderObject != null) {
chain.add(renderObject); chain.add(renderObject);
renderObject = renderObject.parent; renderObject = renderObject.parent;
} }
......
...@@ -66,11 +66,11 @@ void main() { ...@@ -66,11 +66,11 @@ void main() {
try { try {
await channel.invokeMethod('sayHello', 'hello'); await channel.invokeMethod('sayHello', 'hello');
fail('Exception expected'); fail('Exception expected');
} on PlatformException catch(e) { } on PlatformException catch (e) {
expect(e.code, equals('bad')); expect(e.code, equals('bad'));
expect(e.message, equals('Something happened')); expect(e.message, equals('Something happened'));
expect(e.details, equals(<String, dynamic>{'a': 42, 'b': 3.14})); expect(e.details, equals(<String, dynamic>{'a': 42, 'b': 3.14}));
} catch(e) { } catch (e) {
fail('PlatformException expected'); fail('PlatformException expected');
} }
}); });
...@@ -82,10 +82,10 @@ void main() { ...@@ -82,10 +82,10 @@ void main() {
try { try {
await channel.invokeMethod('sayHello', 'hello'); await channel.invokeMethod('sayHello', 'hello');
fail('Exception expected'); fail('Exception expected');
} on MissingPluginException catch(e) { } on MissingPluginException catch (e) {
expect(e.message, contains('sayHello')); expect(e.message, contains('sayHello'));
expect(e.message, contains('ch7')); expect(e.message, contains('ch7'));
} catch(e) { } catch (e) {
fail('MissingPluginException expected'); fail('MissingPluginException expected');
} }
}); });
...@@ -130,7 +130,7 @@ void main() { ...@@ -130,7 +130,7 @@ void main() {
try { try {
jsonMethod.decodeEnvelope(envelope); jsonMethod.decodeEnvelope(envelope);
fail('Exception expected'); fail('Exception expected');
} on PlatformException catch(e) { } on PlatformException catch (e) {
expect(e.code, equals('bad')); expect(e.code, equals('bad'));
expect(e.message, equals('sayHello failed')); expect(e.message, equals('sayHello failed'));
} catch (e) { } catch (e) {
...@@ -149,7 +149,7 @@ void main() { ...@@ -149,7 +149,7 @@ void main() {
try { try {
jsonMethod.decodeEnvelope(envelope); jsonMethod.decodeEnvelope(envelope);
fail('Exception expected'); fail('Exception expected');
} on PlatformException catch(e) { } on PlatformException catch (e) {
expect(e.code, equals('error')); expect(e.code, equals('error'));
expect(e.message, equals('Invalid argument(s): bad')); expect(e.message, equals('Invalid argument(s): bad'));
} catch (e) { } catch (e) {
......
...@@ -568,7 +568,7 @@ class FlutterDriver { ...@@ -568,7 +568,7 @@ class FlutterDriver {
'recordedStreams': _timelineStreamsToString(streams) 'recordedStreams': _timelineStreamsToString(streams)
}).timeout(timeout); }).timeout(timeout);
return null; return null;
} catch(error, stackTrace) { } catch (error, stackTrace) {
throw new DriverError( throw new DriverError(
'Failed to start tracing due to remote error', 'Failed to start tracing due to remote error',
error, error,
...@@ -584,7 +584,7 @@ class FlutterDriver { ...@@ -584,7 +584,7 @@ class FlutterDriver {
.sendRequest(_kSetVMTimelineFlagsMethod, <String, String>{'recordedStreams': '[]'}) .sendRequest(_kSetVMTimelineFlagsMethod, <String, String>{'recordedStreams': '[]'})
.timeout(timeout); .timeout(timeout);
return new Timeline.fromJson(await _peer.sendRequest(_kGetVMTimelineMethod)); return new Timeline.fromJson(await _peer.sendRequest(_kGetVMTimelineMethod));
} catch(error, stackTrace) { } catch (error, stackTrace) {
throw new DriverError( throw new DriverError(
'Failed to stop tracing due to remote error', 'Failed to stop tracing due to remote error',
error, error,
...@@ -626,7 +626,7 @@ class FlutterDriver { ...@@ -626,7 +626,7 @@ class FlutterDriver {
await _peer await _peer
.sendRequest(_kClearVMTimelineMethod, <String, String>{}) .sendRequest(_kClearVMTimelineMethod, <String, String>{})
.timeout(timeout); .timeout(timeout);
} catch(error, stackTrace) { } catch (error, stackTrace) {
throw new DriverError( throw new DriverError(
'Failed to clear event timeline due to remote error', 'Failed to clear event timeline due to remote error',
error, error,
...@@ -723,7 +723,7 @@ Future<VMServiceClientConnection> _waitAndConnect(String url) async { ...@@ -723,7 +723,7 @@ Future<VMServiceClientConnection> _waitAndConnect(String url) async {
new VMServiceClient(new IOWebSocketChannel(ws1).cast()), new VMServiceClient(new IOWebSocketChannel(ws1).cast()),
new rpc.Peer(new IOWebSocketChannel(ws2).cast())..listen() new rpc.Peer(new IOWebSocketChannel(ws2).cast())..listen()
); );
} catch(e) { } catch (e) {
await ws1?.close(); await ws1?.close();
await ws2?.close(); await ws2?.close();
......
...@@ -363,7 +363,7 @@ void main() { ...@@ -363,7 +363,7 @@ void main() {
try { try {
await driver.waitFor(find.byTooltip('foo'), timeout: const Duration(milliseconds: 100)); await driver.waitFor(find.byTooltip('foo'), timeout: const Duration(milliseconds: 100));
fail('expected an exception'); fail('expected an exception');
} catch(error) { } catch (error) {
expect(error is DriverError, isTrue); expect(error is DriverError, isTrue);
expect(error.message, 'Failed to fulfill WaitFor: Flutter application not responding'); expect(error.message, 'Failed to fulfill WaitFor: Flutter application not responding');
} }
...@@ -378,7 +378,7 @@ void main() { ...@@ -378,7 +378,7 @@ void main() {
try { try {
await driver.waitFor(find.byTooltip('foo')); await driver.waitFor(find.byTooltip('foo'));
fail('expected an exception'); fail('expected an exception');
} catch(error) { } catch (error) {
expect(error is DriverError, isTrue); expect(error is DriverError, isTrue);
expect(error.message, 'Error in Flutter application: {message: This is a failure}'); expect(error.message, 'Error in Flutter application: {message: This is a failure}');
} }
......
...@@ -1397,18 +1397,18 @@ class _Bundle_zh_TW extends TranslationBundle { ...@@ -1397,18 +1397,18 @@ class _Bundle_zh_TW extends TranslationBundle {
} }
TranslationBundle translationBundleForLocale(Locale locale) { TranslationBundle translationBundleForLocale(Locale locale) {
switch(locale.languageCode) { switch (locale.languageCode) {
case 'ar': case 'ar':
return const _Bundle_ar(); return const _Bundle_ar();
case 'de': { case 'de': {
switch(locale.toString()) { switch (locale.toString()) {
case 'de_CH': case 'de_CH':
return const _Bundle_de_CH(); return const _Bundle_de_CH();
} }
return const _Bundle_de(); return const _Bundle_de();
} }
case 'en': { case 'en': {
switch(locale.toString()) { switch (locale.toString()) {
case 'en_AU': case 'en_AU':
return const _Bundle_en_AU(); return const _Bundle_en_AU();
case 'en_CA': case 'en_CA':
...@@ -1427,7 +1427,7 @@ TranslationBundle translationBundleForLocale(Locale locale) { ...@@ -1427,7 +1427,7 @@ TranslationBundle translationBundleForLocale(Locale locale) {
return const _Bundle_en(); return const _Bundle_en();
} }
case 'es': { case 'es': {
switch(locale.toString()) { switch (locale.toString()) {
case 'es_419': case 'es_419':
return const _Bundle_es_419(); return const _Bundle_es_419();
case 'es_AR': case 'es_AR':
...@@ -1474,7 +1474,7 @@ TranslationBundle translationBundleForLocale(Locale locale) { ...@@ -1474,7 +1474,7 @@ TranslationBundle translationBundleForLocale(Locale locale) {
case 'fa': case 'fa':
return const _Bundle_fa(); return const _Bundle_fa();
case 'fr': { case 'fr': {
switch(locale.toString()) { switch (locale.toString()) {
case 'fr_CA': case 'fr_CA':
return const _Bundle_fr_CA(); return const _Bundle_fr_CA();
} }
...@@ -1497,7 +1497,7 @@ TranslationBundle translationBundleForLocale(Locale locale) { ...@@ -1497,7 +1497,7 @@ TranslationBundle translationBundleForLocale(Locale locale) {
case 'ps': case 'ps':
return const _Bundle_ps(); return const _Bundle_ps();
case 'pt': { case 'pt': {
switch(locale.toString()) { switch (locale.toString()) {
case 'pt_PT': case 'pt_PT':
return const _Bundle_pt_PT(); return const _Bundle_pt_PT();
} }
...@@ -1514,7 +1514,7 @@ TranslationBundle translationBundleForLocale(Locale locale) { ...@@ -1514,7 +1514,7 @@ TranslationBundle translationBundleForLocale(Locale locale) {
case 'ur': case 'ur':
return const _Bundle_ur(); return const _Bundle_ur();
case 'zh': { case 'zh': {
switch(locale.toString()) { switch (locale.toString()) {
case 'zh_HK': case 'zh_HK':
return const _Bundle_zh_HK(); return const _Bundle_zh_HK();
case 'zh_TW': case 'zh_TW':
......
...@@ -21,7 +21,7 @@ void main() { ...@@ -21,7 +21,7 @@ void main() {
TestFailure failure; TestFailure failure;
try { try {
expect(find.text('foo', skipOffstage: false), findsOneWidget); expect(find.text('foo', skipOffstage: false), findsOneWidget);
} catch(e) { } catch (e) {
failure = e; failure = e;
} }
...@@ -44,7 +44,7 @@ void main() { ...@@ -44,7 +44,7 @@ void main() {
TestFailure failure; TestFailure failure;
try { try {
expect(find.text('foo', skipOffstage: false), findsNothing); expect(find.text('foo', skipOffstage: false), findsNothing);
} catch(e) { } catch (e) {
failure = e; failure = e;
} }
...@@ -62,7 +62,7 @@ void main() { ...@@ -62,7 +62,7 @@ void main() {
TestFailure failure; TestFailure failure;
try { try {
expect(find.text('foo'), findsNothing); expect(find.text('foo'), findsNothing);
} catch(e) { } catch (e) {
failure = e; failure = e;
} }
...@@ -117,7 +117,7 @@ void main() { ...@@ -117,7 +117,7 @@ void main() {
TestFailure failure; TestFailure failure;
try { try {
expect(find.byElementPredicate((_) => false, description: customDescription), findsOneWidget); expect(find.byElementPredicate((_) => false, description: customDescription), findsOneWidget);
} catch(e) { } catch (e) {
failure = e; failure = e;
} }
...@@ -134,7 +134,7 @@ void main() { ...@@ -134,7 +134,7 @@ void main() {
TestFailure failure; TestFailure failure;
try { try {
expect(find.byWidgetPredicate((_) => false, description: customDescription), findsOneWidget); expect(find.byWidgetPredicate((_) => false, description: customDescription), findsOneWidget);
} catch(e) { } catch (e) {
failure = e; failure = e;
} }
......
...@@ -238,7 +238,7 @@ class UpdatePackagesCommand extends FlutterCommand { ...@@ -238,7 +238,7 @@ class UpdatePackagesCommand extends FlutterCommand {
final List<_DependencyLink> paths = <_DependencyLink>[]; final List<_DependencyLink> paths = <_DependencyLink>[];
traversalQueue.addFirst(new _DependencyLink(from: null, to: from)); traversalQueue.addFirst(new _DependencyLink(from: null, to: from));
while(traversalQueue.isNotEmpty) { while (traversalQueue.isNotEmpty) {
final _DependencyLink link = traversalQueue.removeLast(); final _DependencyLink link = traversalQueue.removeLast();
if (link.to == to) if (link.to == to)
paths.add(link); paths.add(link);
......
...@@ -65,7 +65,7 @@ List<Plugin> _findPlugins(String directory) { ...@@ -65,7 +65,7 @@ List<Plugin> _findPlugins(String directory) {
try { try {
final String packagesFile = fs.path.join(directory, PackageMap.globalPackagesPath); final String packagesFile = fs.path.join(directory, PackageMap.globalPackagesPath);
packages = new PackageMap(packagesFile).map; packages = new PackageMap(packagesFile).map;
} on FormatException catch(e) { } on FormatException catch (e) {
printTrace('Invalid .packages file: $e'); printTrace('Invalid .packages file: $e');
return plugins; return plugins;
} }
......
...@@ -1045,7 +1045,7 @@ class Isolate extends ServiceObjectOwner { ...@@ -1045,7 +1045,7 @@ class Isolate extends ServiceObjectOwner {
} }
final Map<String, dynamic> response = await invokeRpcRaw('_reloadSources', params: arguments); final Map<String, dynamic> response = await invokeRpcRaw('_reloadSources', params: arguments);
return response; return response;
} on rpc.RpcException catch(e) { } on rpc.RpcException catch (e) {
return new Future<Map<String, dynamic>>.error(<String, dynamic>{ return new Future<Map<String, dynamic>>.error(<String, dynamic>{
'code': e.code, 'code': e.code,
'message': e.message, 'message': e.message,
......
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