/** * Print warning message, increment warning count. Part of DocErrorReporter. * * @param pos the position where the error occurs * @param msg message to print */ public void printWarning(SourcePosition pos, String msg) { if (diagListener != null) { report(DiagnosticType.WARNING, pos, msg); return; } if (nwarnings < MaxWarnings) { String prefix = (pos == null) ? programName : pos.toString(); warnWriter.println(prefix + ": " + getText("javadoc.warning") + " - " + msg); warnWriter.flush(); nwarnings++; } }
/** * Print error message, increment error count. Part of DocErrorReporter. * * @param pos the position where the error occurs * @param msg message to print */ public void printError(SourcePosition pos, String msg) { if (diagListener != null) { report(DiagnosticType.ERROR, pos, msg); return; } if (nerrors < MaxErrors) { String prefix = (pos == null) ? programName : pos.toString(); errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg); errWriter.flush(); prompt(); nerrors++; } }