/** Write out a diagnostic. */ protected void writeDiagnostic(JCDiagnostic diag) { if (diagListener != null) { diagListener.report(diag); return; } PrintWriter writer = getWriterForDiagnosticType(diag.getType()); printRawLines(writer, diagFormatter.format(diag, messages.getCurrentLocale())); if (promptOnError) { switch (diag.getType()) { case ERROR: case WARNING: prompt(); } } if (dumpOnError) new RuntimeException().printStackTrace(writer); writer.flush(); }
@DefinedBy(Api.COMPILER) public String getMessage(Locale locale) { return defaultFormatter.formatMessage(this, locale); }