/** * Write replace. * * @return the object * @throws ObjectStreamException the object stream exception */ private Object writeReplace() throws ObjectStreamException { Object[] sourcesAsStrings = sources.toArray(); for (int i = 0; i < sourcesAsStrings.length; i++) { sourcesAsStrings[i] = Errors.convert(sourcesAsStrings[i]).toString(); } return new Message(ImmutableList.copyOf(sourcesAsStrings), message, cause); }
/* (non-Javadoc) * @see cn.com.rebirth.search.commons.inject.spi.Element#getSource() */ public String getSource() { return sources.isEmpty() ? SourceProvider.UNKNOWN_SOURCE.toString() : Errors.convert(sources.get(sources.size() - 1)).toString(); }