core/src/com/google/inject/internal/AbstractBindingProcessor.java
private boolean isOkayDuplicate(BindingImpl<?> original, BindingImpl<?> binding, State state) {
    if (original instanceof ExposedBindingImpl) {
      ExposedBindingImpl exposed = (ExposedBindingImpl) original;
      InjectorImpl exposedFrom = (InjectorImpl) exposed.getPrivateElements().getInjector();
      return (exposedFrom == binding.getInjector());
    } else {
      original = (BindingImpl<?>) state.getExplicitBindingsThisLevel().get(binding.getKey());
      // If no original at this level, the original was on a parent, and we don't
      // allow deduplication between parents & children.
      if (original == null) {
        return false;
      } else {
        return original.equals(binding);
      }
    }
  }
private boolean isOkayDuplicate(BindingImpl<?> original, BindingImpl<?> binding, State state) {
    if (original instanceof ExposedBindingImpl) {
      ExposedBindingImpl exposed = (ExposedBindingImpl) original;
      InjectorImpl exposedFrom = (InjectorImpl) exposed.getPrivateElements().getInjector();
      return (exposedFrom == binding.getInjector());
    } else {
      original = (BindingImpl<?>) state.getExplicitBindingsThisLevel().get(binding.getKey());
      // If no original at this level, the original was on a parent, and we don't
      // allow deduplication between parents & children.
      if (original == null) {
        return false;
      } else {
        return original.equals(binding);
      }
    }
  }
private boolean isOkayDuplicate ( BindingImpl < ? > original , BindingImpl < ? > binding , State state ) { if ( original instanceof ExposedBindingImpl ) { ExposedBindingImpl exposed = ( ExposedBindingImpl ) original ; InjectorImpl exposedFrom = ( InjectorImpl ) exposed . getPrivateElements ( ) . getInjector ( ) ; return ( exposedFrom == binding . getInjector ( ) ) ; } else { original = ( BindingImpl < ? > ) state . getExplicitBindingsThisLevel ( ) . get ( binding . getKey ( ) ) ; // If no original at this level, the original was on a parent, and we don't // allow deduplication between parents & children. if ( original == null ) { return false ; } else { return original . equals ( binding ) ; } } }
We tolerate duplicate bindings if one exposes the other or if the two bindings are considered
duplicates (see {@link Bindings#areDuplicates(BindingImpl, BindingImpl)}.

@param original the binding in the parent injector (candidate for an exposing binding)
@param binding the binding to check (candidate for the exposed binding)
We tolerate duplicate bindings if one exposes the other or if the two bindings are considered duplicates ( see { @link Bindings#areDuplicates ( BindingImpl BindingImpl ) } .