84 |
84 |
85 public class ExitJavadoc extends Error { |
85 public class ExitJavadoc extends Error { |
86 private static final long serialVersionUID = 0; |
86 private static final long serialVersionUID = 0; |
87 } |
87 } |
88 |
88 |
89 private final String programName; |
89 final String programName; |
90 |
90 |
91 private ResourceBundle messageRB = null; |
91 private ResourceBundle messageRB = null; |
92 |
92 |
93 /** The default writer for diagnostics |
93 /** The default writer for diagnostics |
94 */ |
94 */ |
117 PrintWriter errWriter, |
117 PrintWriter errWriter, |
118 PrintWriter warnWriter, |
118 PrintWriter warnWriter, |
119 PrintWriter noticeWriter) { |
119 PrintWriter noticeWriter) { |
120 super(context, errWriter, warnWriter, noticeWriter); |
120 super(context, errWriter, warnWriter, noticeWriter); |
121 this.programName = programName; |
121 this.programName = programName; |
|
122 } |
|
123 |
|
124 @Override |
|
125 protected int getDefaultMaxErrors() { |
|
126 return Integer.MAX_VALUE; |
|
127 } |
|
128 |
|
129 @Override |
|
130 protected int getDefaultMaxWarnings() { |
|
131 return Integer.MAX_VALUE; |
122 } |
132 } |
123 |
133 |
124 /** |
134 /** |
125 * Reset resource bundle, eg. locale has changed. |
135 * Reset resource bundle, eg. locale has changed. |
126 */ |
136 */ |
229 * |
239 * |
230 * @param pos the position where the error occurs |
240 * @param pos the position where the error occurs |
231 * @param msg message to print |
241 * @param msg message to print |
232 */ |
242 */ |
233 public void printError(SourcePosition pos, String msg) { |
243 public void printError(SourcePosition pos, String msg) { |
234 String prefix = (pos == null) ? programName : pos.toString(); |
244 if (nerrors < MaxErrors) { |
235 errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg); |
245 String prefix = (pos == null) ? programName : pos.toString(); |
236 errWriter.flush(); |
246 errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg); |
237 prompt(); |
247 errWriter.flush(); |
238 nerrors++; |
248 prompt(); |
|
249 nerrors++; |
|
250 } |
239 } |
251 } |
240 |
252 |
241 /** |
253 /** |
242 * Print warning message, increment warning count. |
254 * Print warning message, increment warning count. |
243 * Part of DocErrorReporter. |
255 * Part of DocErrorReporter. |
254 * |
266 * |
255 * @param pos the position where the error occurs |
267 * @param pos the position where the error occurs |
256 * @param msg message to print |
268 * @param msg message to print |
257 */ |
269 */ |
258 public void printWarning(SourcePosition pos, String msg) { |
270 public void printWarning(SourcePosition pos, String msg) { |
259 String prefix = (pos == null) ? programName : pos.toString(); |
271 if (nwarnings < MaxWarnings) { |
260 warnWriter.println(prefix + ": " + getText("javadoc.warning") +" - " + msg); |
272 String prefix = (pos == null) ? programName : pos.toString(); |
261 warnWriter.flush(); |
273 warnWriter.println(prefix + ": " + getText("javadoc.warning") +" - " + msg); |
262 nwarnings++; |
274 warnWriter.flush(); |
|
275 nwarnings++; |
|
276 } |
263 } |
277 } |
264 |
278 |
265 /** |
279 /** |
266 * Print a message. |
280 * Print a message. |
267 * Part of DocErrorReporter. |
281 * Part of DocErrorReporter. |