/** * 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); } }
/** * Format all the subdiagnostics attached to a given diagnostic. * * @param d diagnostic whose subdiagnostics are to be formatted * @param l locale object to be used for i18n * @return list of all string representations of the subdiagnostics */ protected List<String> formatSubdiagnostics(JCDiagnostic d, Locale l) { List<String> subdiagnostics = List.nil(); int maxDepth = config.getMultilineLimit(MultilineLimit.DEPTH); if (maxDepth == -1 || depth < maxDepth) { depth++; try { int maxCount = config.getMultilineLimit(MultilineLimit.LENGTH); int count = 0; for (JCDiagnostic d2 : d.getSubdiagnostics()) { if (maxCount == -1 || count < maxCount) { subdiagnostics = subdiagnostics.append(formatSubdiagnostic(d, d2, l)); count++; } else break; } } finally { depth--; } } return subdiagnostics; }
/** * Format all the subdiagnostics attached to a given diagnostic. * * @param d diagnostic whose subdiagnostics are to be formatted * @param l locale object to be used for i18n * @return list of all string representations of the subdiagnostics */ protected List<String> formatSubdiagnostics(JCDiagnostic d, Locale l) { List<String> subdiagnostics = List.nil(); int maxDepth = config.getMultilineLimit(MultilineLimit.DEPTH); if (maxDepth == -1 || depth < maxDepth) { depth++; try { int maxCount = config.getMultilineLimit(MultilineLimit.LENGTH); int count = 0; for (JCDiagnostic d2 : d.getSubdiagnostics()) { if (maxCount == -1 || count < maxCount) { subdiagnostics = subdiagnostics.append(formatSubdiagnostic(d, d2, l)); count++; } else break; } } finally { depth--; } } return subdiagnostics; }