OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012, the Dart project authors. | 2 * Copyright (c) 2012, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express |
11 * or implied. See the License for the specific language governing permissions a nd limitations under | 11 * or implied. See the License for the specific language governing permissions a nd limitations under |
12 * the License. | 12 * the License. |
13 */ | 13 */ |
14 package com.google.dart.engine.error; | 14 package com.google.dart.engine.error; |
15 | 15 |
16 /** | 16 /** |
17 * Instances of the enumeration {@code ErrorSeverity} represent the severity of an {@link ErrorCode} | 17 * Instances of the enumeration {@code ErrorSeverity} represent the severity of an {@link ErrorCode} |
18 * . | 18 * . |
19 * | 19 * |
20 * @coverage dart.engine.error | 20 * @coverage dart.engine.error |
21 */ | 21 */ |
22 public enum ErrorSeverity { | 22 public enum ErrorSeverity { |
23 /** | 23 /** |
24 * The severity representing a non-error. This is never used for any error cod e, but is useful for | 24 * The severity representing a non-error. This is never used for any error cod e, but is useful for |
25 * clients. | 25 * clients. |
26 */ | 26 */ |
27 NONE(" ", "none"), | 27 NONE(" ", "none"), |
28 | 28 |
29 /** | 29 /** |
30 * The severity representing a suggestion. Suggestions are not specified in th e Dart language | |
31 * specification, but provide information about best practices. | |
32 */ | |
33 SUGGESTION("s", "suggestion"), | |
Brian Wilkerson
2013/05/31 15:28:58
nit: For consistency, "\"s\"" --> "\"S\""
danrubel
2013/05/31 19:43:45
Done.
| |
34 | |
35 /** | |
30 * The severity representing a warning. Warnings can become errors if the {@co de -Werror} command | 36 * The severity representing a warning. Warnings can become errors if the {@co de -Werror} command |
31 * line flag is specified. | 37 * line flag is specified. |
32 */ | 38 */ |
33 WARNING("W", "warning"), | 39 WARNING("W", "warning"), |
34 | 40 |
35 /** | 41 /** |
36 * The severity representing an error. | 42 * The severity representing an error. |
37 */ | 43 */ |
38 ERROR("E", "error"); | 44 ERROR("E", "error"); |
39 | 45 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 /** | 85 /** |
80 * Return the severity constant that represents the greatest severity. | 86 * Return the severity constant that represents the greatest severity. |
81 * | 87 * |
82 * @param severity the severity being compared against | 88 * @param severity the severity being compared against |
83 * @return the most sever of this or the given severity | 89 * @return the most sever of this or the given severity |
84 */ | 90 */ |
85 public ErrorSeverity max(ErrorSeverity severity) { | 91 public ErrorSeverity max(ErrorSeverity severity) { |
86 return this.ordinal() >= severity.ordinal() ? this : severity; | 92 return this.ordinal() >= severity.ordinal() ? this : severity; |
87 } | 93 } |
88 } | 94 } |
OLD | NEW |