public String formatMessage(JCDiagnostic d, Locale l) { StringBuilder buf = new StringBuilder(); Collection<String> args = formatArguments(d, l); buf.append(localize(null, d.getCode(), args.toArray())); if (d.isMultiline() && getConfiguration().getVisible().contains(DiagnosticPart.SUBDIAGNOSTICS)) { List<String> subDiags = formatSubdiagnostics(d, null); if (subDiags.nonEmpty()) { String sep = ""; buf.append(",{"); for (String sub : formatSubdiagnostics(d, null)) { buf.append(sep); buf.append("("); buf.append(sub); buf.append(")"); sep = ","; } buf.append('}'); } } return buf.toString(); }
public String formatMessage(JCDiagnostic d, Locale l) { StringBuilder buf = new StringBuilder(); Collection<String> args = formatArguments(d, l); buf.append(localize(null, d.getCode(), args.toArray())); if (d.isMultiline() && getConfiguration().getVisible().contains(DiagnosticPart.SUBDIAGNOSTICS)) { List<String> subDiags = formatSubdiagnostics(d, null); if (subDiags.nonEmpty()) { String sep = ""; buf.append(",{"); for (String sub : formatSubdiagnostics(d, null)) { buf.append(sep); buf.append("("); buf.append(sub); buf.append(")"); sep = ","; } buf.append('}'); } } return buf.toString(); }
/** * Preprocess a given diagnostic by looking both into its arguments and into * its subdiagnostics (if any). This preprocessing is responsible for * generating info corresponding to features like where clauses, name * simplification, etc. * * @param diag the diagnostic to be preprocessed */ protected void preprocessDiagnostic(JCDiagnostic diag) { for (Object o : diag.getArgs()) { if (o != null) { preprocessArgument(o); } } if (diag.isMultiline()) { for (JCDiagnostic d : diag.getSubdiagnostics()) preprocessDiagnostic(d); } }
/** * Preprocess a given diagnostic by looking both into its arguments and into * its subdiagnostics (if any). This preprocessing is responsible for * generating info corresponding to features like where clauses, name * simplification, etc. * * @param diag the diagnostic to be preprocessed */ protected void preprocessDiagnostic(JCDiagnostic diag) { for (Object o : diag.getArgs()) { if (o != null) { preprocessArgument(o); } } if (diag.isMultiline()) { for (JCDiagnostic d : diag.getSubdiagnostics()) preprocessDiagnostic(d); } }
public String formatMessage(JCDiagnostic d, Locale l) { int currentIndentation = 0; StringBuilder buf = new StringBuilder(); Collection<String> args = formatArguments(d, l); String msg = localize(l, d.getCode(), args.toArray()); String[] lines = msg.split("\n"); if (getConfiguration().getVisible().contains(DiagnosticPart.SUMMARY)) { currentIndentation += getConfiguration().getIndentation(DiagnosticPart.SUMMARY); buf.append(indent(lines[0], currentIndentation)); //summary } if (lines.length > 1 && getConfiguration().getVisible().contains(DiagnosticPart.DETAILS)) { currentIndentation += getConfiguration().getIndentation(DiagnosticPart.DETAILS); for (int i = 1;i < lines.length; i++) { buf.append("\n" + indent(lines[i], currentIndentation)); } } if (d.isMultiline() && getConfiguration().getVisible().contains(DiagnosticPart.SUBDIAGNOSTICS)) { currentIndentation += getConfiguration().getIndentation(DiagnosticPart.SUBDIAGNOSTICS); for (String sub : formatSubdiagnostics(d, l)) { buf.append("\n" + indent(sub, currentIndentation)); } } return buf.toString(); }
public String formatMessage(JCDiagnostic d, Locale l) { int currentIndentation = 0; StringBuilder buf = new StringBuilder(); Collection<String> args = formatArguments(d, l); String msg = localize(l, d.getCode(), args.toArray()); String[] lines = msg.split("\n"); if (getConfiguration().getVisible().contains(DiagnosticPart.SUMMARY)) { currentIndentation += getConfiguration().getIndentation(DiagnosticPart.SUMMARY); buf.append(indent(lines[0], currentIndentation)); //summary } if (lines.length > 1 && getConfiguration().getVisible().contains(DiagnosticPart.DETAILS)) { currentIndentation += getConfiguration().getIndentation(DiagnosticPart.DETAILS); for (int i = 1;i < lines.length; i++) { buf.append("\n" + indent(lines[i], currentIndentation)); } } if (d.isMultiline() && getConfiguration().getVisible().contains(DiagnosticPart.SUBDIAGNOSTICS)) { currentIndentation += getConfiguration().getIndentation(DiagnosticPart.SUBDIAGNOSTICS); for (String sub : formatSubdiagnostics(d, l)) { buf.append("\n" + indent(sub, currentIndentation)); } } return buf.toString(); }