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

Method writeReplace

core/src/com/google/inject/spi/Message.java:169–178  ·  view source on GitHub ↗

When serialized, we convert the error detail to a GenericErrorDetail with string sources. This hurts our formatting, but it guarantees that the receiving end will be able to read the message.

()

Source from the content-addressed store, hash-verified

167 * read the message.
168 */
169 private Object writeReplace() throws ObjectStreamException {
170 Object[] sourcesAsStrings = getSources().toArray();
171 for (int i = 0; i < sourcesAsStrings.length; i++) {
172 sourcesAsStrings[i] = Errors.convert(sourcesAsStrings[i]).toString();
173 }
174 return new Message(
175 errorId,
176 new GenericErrorDetail(
177 errorId, getMessage(), ImmutableList.copyOf(sourcesAsStrings), getCause()));
178 }
179
180 private static final long serialVersionUID = 0;
181}

Callers

nothing calls this directly

Calls 5

getSourcesMethod · 0.95
convertMethod · 0.95
getMessageMethod · 0.95
getCauseMethod · 0.95
toStringMethod · 0.65

Tested by

no test coverage detected