Exemple #1
0
 /**
  * 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);
 }
Exemple #2
0
 /* (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();
 }