示例#1
0
文件: Log.java 项目: karianna/jdk8_tl
  /** 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();
  }
示例#2
0
 @DefinedBy(Api.COMPILER)
 public String getMessage(Locale locale) {
   return defaultFormatter.formatMessage(this, locale);
 }