| 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 b20716a4a5ee7188865e21218365450499d60aba..8e369aad746e50053c249e3447af002741e823fc 100644
|
| --- a/pkg/analyzer/lib/source/error_processor.dart
|
| +++ b/pkg/analyzer/lib/source/error_processor.dart
|
| @@ -54,20 +54,16 @@ class ErrorConfig {
|
| }
|
| }
|
|
|
| - ErrorSeverity _toSeverity(String severity) {
|
| - switch (severity) {
|
| - case 'error':
|
| - return ErrorSeverity.ERROR;
|
| - case 'info':
|
| - return ErrorSeverity.INFO;
|
| - case 'warning':
|
| - return ErrorSeverity.WARNING;
|
| - }
|
| - return null;
|
| - }
|
| -
|
| + 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.
|
|
|