1 /* |
1 /* |
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
94 report(diags.error(source, pos, key, args)); |
94 report(diags.error(source, pos, key, args)); |
95 } |
95 } |
96 |
96 |
97 /** Report an error, unless another error was already reported at same |
97 /** Report an error, unless another error was already reported at same |
98 * source position. |
98 * source position. |
|
99 * @param flag A flag to set on the diagnostic |
|
100 * @param pos The source position at which to report the error. |
|
101 * @param key The key for the localized error message. |
|
102 * @param args Fields of the error message. |
|
103 */ |
|
104 public void error(DiagnosticFlag flag, DiagnosticPosition pos, String key, Object ... args) { |
|
105 JCDiagnostic d = diags.error(source, pos, key, args); |
|
106 d.setFlag(flag); |
|
107 report(d); |
|
108 } |
|
109 |
|
110 /** Report an error, unless another error was already reported at same |
|
111 * source position. |
99 * @param pos The source position at which to report the error. |
112 * @param pos The source position at which to report the error. |
100 * @param key The key for the localized error message. |
113 * @param key The key for the localized error message. |
101 * @param args Fields of the error message. |
114 * @param args Fields of the error message. |
102 */ |
115 */ |
103 public void error(int pos, String key, Object ... args) { |
116 public void error(int pos, String key, Object ... args) { |