MCPcopy Create free account
hub / github.com/google/guice / format

Method format

core/src/com/google/inject/spi/ErrorDetail.java:61–71  ·  view source on GitHub ↗

Formats this error along with other errors that are mergeable with this error. mergeableErrors is a list that contains all other errors that are reported in the same exception that are considered to be mergable with this error base on result of calling #isMergeable. The list will

(int index, List<ErrorDetail<?>> mergeableErrors, Formatter formatter)

Source from the content-addressed store, hash-verified

59 * @param formatter for printing the error message
60 */
61 public final void format(int index, List<ErrorDetail<?>> mergeableErrors, Formatter formatter) {
62 String id = getErrorIdentifier().map(s -> "[" + Messages.redBold(s) + "]: ").orElse("");
63 formatter.format("%s) %s%s\n", index, id, getMessage());
64 formatDetail(mergeableErrors, formatter);
65 // TODO(b/151482394): Output potiential fixes for the error
66 Optional<String> learnMoreLink = getLearnMoreLink();
67 if (learnMoreLink.isPresent()) {
68 formatter.format("\n%s\n", Messages.bold("Learn more:"));
69 formatter.format(" %s\n", Messages.underline(learnMoreLink.get()));
70 }
71 }
72
73 /**
74 * Formats the detail of this error message along with other errors that are mergeable with this

Callers 2

getViolationMessageMethod · 0.45

Calls 9

getErrorIdentifierMethod · 0.95
redBoldMethod · 0.95
getMessageMethod · 0.95
formatDetailMethod · 0.95
getLearnMoreLinkMethod · 0.95
boldMethod · 0.95
underlineMethod · 0.95
mapMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected