Revision: 1116
Author: limpbizkit
Date: Mon Oct 12 09:17:34 2009
Log: tidy up multibindings doc to specify ordering
unsuppress a passing test
http://code.google.com/p/google-guice/source/detail?r=1116

Modified:
   
/trunk/extensions/multibindings/src/com/google/inject/multibindings/MapBinder.java
   
/trunk/extensions/multibindings/src/com/google/inject/multibindings/Multibinder.java
  /trunk/test/com/google/inject/AllTests.java

=======================================
---  
/trunk/extensions/multibindings/src/com/google/inject/multibindings/MapBinder.java
       
Mon Sep  7 10:40:48 2009
+++  
/trunk/extensions/multibindings/src/com/google/inject/multibindings/MapBinder.java
       
Mon Oct 12 09:17:34 2009
@@ -71,12 +71,18 @@
   *   public SnackMachine(Map<String, Provider<Snack>>  
snackProviders) { ... }
   * }</code></pre>
   *
- * <p>Creating mapbindings from different modules is supported. For  
example, it
- * is okay to have both {...@code CandyModule} and {...@code ChipsModule} both
+ * <p>Contributing mapbindings from different modules is supported. For  
example,
+ * it is okay to have both {...@code CandyModule} and {...@code ChipsModule} 
both
   * create their own {...@code MapBinder<String, Snack>}, and to each  
contribute
   * bindings to the snacks map. When that map is injected, it will contain
   * entries from both modules.
   *
+ * <p>The map's iteration order is consistent with the binding order. This  
is
+ * convenient when multiple elements are contributed by the same module  
because
+ * that module can order its bindings appropriately. Avoid relying on the
+ * iteration order of elements contributed by different modules, since  
there is
+ * no equivalent mechanism to order modules.
+ *
   * <p>Values are resolved at map injection time. If a value is bound to a
   * provider, that provider's get method will be called each time the map is
   * injected (unless the binding is also scoped, or a map of providers is  
injected).
=======================================
---  
/trunk/extensions/multibindings/src/com/google/inject/multibindings/Multibinder.java
     
Tue Jul  7 13:13:32 2009
+++  
/trunk/extensions/multibindings/src/com/google/inject/multibindings/Multibinder.java
     
Mon Oct 12 09:17:34 2009
@@ -65,11 +65,17 @@
   *   public SnackMachine(Set&lt;Snack&gt; snacks) { ... }
   * }</code></pre>
   *
- * <p>Create multibindings from different modules is supported. For  
example, it
- * is okay to have both {...@code CandyModule} and {...@code ChipsModule} to 
both
- * create their own {...@code Multibinder<Snack>}, and to each contribute  
bindings
- * to the set of snacks. When that set is injected, it will contain  
elements
- * from both modules.
+ * <p>Contributing multibindings from different modules is supported. For
+ * example, it is okay to have both {...@code CandyModule} and {...@code  
ChipsModule}
+ * to both create their own {...@code Multibinder<Snack>}, and to each  
contribute
+ * bindings to the set of snacks. When that set is injected, it will  
contain
+ * elements from both modules.
+ *
+ * <p>The set's iteration order is consistent with the binding order. This  
is
+ * convenient when multiple elements are contributed by the same module  
because
+ * that module can order its bindings appropriately. Avoid relying on the
+ * iteration order of elements contributed by different modules, since  
there is
+ * no equivalent mechanism to order modules.
   *
   * <p>Elements are resolved at set injection time. If an element is bound  
to a
   * provider, that provider's get method will be called each time the set is
=======================================
--- /trunk/test/com/google/inject/AllTests.java Mon Oct  5 14:54:38 2009
+++ /trunk/test/com/google/inject/AllTests.java Mon Oct 12 09:17:34 2009
@@ -51,7 +51,6 @@

    private static final Set<String> SUPPRESSED_TEST_NAMES = ImmutableSet.of(
        "testUnscopedProviderWorksOutsideOfRequestedScope(" +  
ScopesTest.class.getName() + ")",
-      "testNullScopedAsASingleton(" + ScopesTest.class.getName() + ")",
        "testCannotConvertUnannotatedBindings(" +  
TypeConversionTest.class.getName() + ")"
    );

@@ -152,7 +151,9 @@

        if (suppressedTestNames.contains(test.toString())) {
          continue;
-      } else if (test instanceof TestSuite) {
+      }
+
+      if (test instanceof TestSuite) {
          result.addTest(removeSuppressedTests((TestSuite) test,  
suppressedTestNames));
        } else {
          result.addTest(test);

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to