Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: pkg/analyzer/lib/source/error_processor.dart

Issue 1808123005: First batch of changes to make analyzer package strong mode error free (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/source/error_processor.dart
diff --git a/pkg/analyzer/lib/source/error_processor.dart b/pkg/analyzer/lib/source/error_processor.dart
index d9049cb70820f86952f555d5d9415853b59f7c9e..ddd0679d13506747423091eb868a30303fd8814d 100644
--- a/pkg/analyzer/lib/source/error_processor.dart
+++ b/pkg/analyzer/lib/source/error_processor.dart
@@ -10,6 +10,13 @@ import 'package:analyzer/src/generated/utilities_general.dart';
import 'package:analyzer/src/task/options.dart';
import 'package:yaml/yaml.dart';
+/// String identifiers mapped to associated severities.
+const Map<String, ErrorSeverity> severityMap = const {
+ 'error': ErrorSeverity.ERROR,
+ 'info': ErrorSeverity.INFO,
+ 'warning': ErrorSeverity.WARNING
+};
+
/// Error processor configuration derived from analysis (or embedder) options.
class ErrorConfig {
/// The processors in this config.
@@ -57,13 +64,6 @@ class ErrorConfig {
ErrorSeverity _toSeverity(String severity) => severityMap[severity];
}
-/// String identifiers mapped to associated severities.
-const Map<String, ErrorSeverity> severityMap = const {
- 'error': ErrorSeverity.ERROR,
- 'info': ErrorSeverity.INFO,
- 'warning': ErrorSeverity.WARNING
-};
-
/// Process errors by filtering or changing associated [ErrorSeverity].
class ErrorProcessor {
/// The code name of the associated error.
@@ -96,14 +96,14 @@ class ErrorProcessor {
// Let the user configure how specific errors are processed.
List<ErrorProcessor> processors =
- context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS);
+ context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS)
+ as List<ErrorProcessor>;
// Give strong mode a chance to upgrade it.
if (context.analysisOptions.strongMode) {
processors = processors.toList();
processors.add(_StrongModeTypeErrorProcessor.instance);
}
-
return processors.firstWhere((ErrorProcessor p) => p.appliesTo(error),
orElse: () => null);
}

Powered by Google App Engine
This is Rietveld 408576698