core/src/com/google/inject/internal/Messages.java
static Message mergeSources(List<Object> sources, Message message) {
    List<Object> messageSources = message.getSources();
    // It is possible that the end of getSources() and the beginning of message.getSources() are
    // equivalent, in this case we should drop the repeated source when joining the lists.  The
    // most likely scenario where this would happen is when a scoped binding throws an exception,
    // due to the fact that InternalFactoryToProviderAdapter applies the binding source when
    // merging errors.
    if (!sources.isEmpty()
        && !messageSources.isEmpty()
        && Objects.equal(messageSources.get(0), sources.get(sources.size() - 1))) {
      messageSources = messageSources.subList(1, messageSources.size());
    }
    return new Message(
        ImmutableList.builder().addAll(sources).addAll(messageSources).build(),
        message.getMessage(),
        message.getCause());
  }
static Message mergeSources(List<Object> sources, Message message) {
    List<Object> messageSources = message.getSources();
    // It is possible that the end of getSources() and the beginning of message.getSources() are
    // equivalent, in this case we should drop the repeated source when joining the lists.  The
    // most likely scenario where this would happen is when a scoped binding throws an exception,
    // due to the fact that InternalFactoryToProviderAdapter applies the binding source when
    // merging errors.
    if (!sources.isEmpty()
        && !messageSources.isEmpty()
        && Objects.equal(messageSources.get(0), sources.get(sources.size() - 1))) {
      messageSources = messageSources.subList(1, messageSources.size());
    }
    return new Message(
        ImmutableList.builder().addAll(sources).addAll(messageSources).build(),
        message.getMessage(),
        message.getCause());
  }
static Message mergeSources ( List < Object > sources , Message message ) { List < Object > messageSources = message . getSources ( ) ; // It is possible that the end of getSources() and the beginning of message.getSources() are // equivalent, in this case we should drop the repeated source when joining the lists.  The // most likely scenario where this would happen is when a scoped binding throws an exception, // due to the fact that InternalFactoryToProviderAdapter applies the binding source when // merging errors. if ( ! sources . isEmpty ( ) && ! messageSources . isEmpty ( ) && Objects . equal ( messageSources . get ( 0 ) , sources . get ( sources . size ( ) - 1 ) ) ) { messageSources = messageSources . subList ( 1 , messageSources . size ( ) ) ; } return new Message ( ImmutableList . builder ( ) . addAll ( sources ) . addAll ( messageSources ) . build ( ) , message . getMessage ( ) , message . getCause ( ) ) ; }
Prepends the list of sources to the given {@link Message}
Prepends the list of sources to the given {