You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
http://groups.google.com/group/google-guice/t/7813015f7a00f8a5 from Johannes Schneider <johannes@familieschneider.info>
Hi,
com.google.inject.Guice#createInjector has the following signature:
public static Injector createInjector(Iterable<Module> modules)
Shouldn't that be changed to
public static Injector createInjector(Iterable<? extends Module> modules)
I have a list of my modules as static reference (usefull for testing
purposes).
Collections.unmodifiableList( Arrays.asList( new ApplicationModule(),
new SecurityModule(), new ScannerModule(), new InvoiceModule() ) )
But this line returns a List of AbstractModules (or List<? extends
Module>)....
I have created a patch that fixes this problem. It also widens the generic
collections at some other locations.
The tests still run fine so I think there shouldn't be any problem
I think returning a collection without a "?" is only useful, if someone wants to add
anything to this collection.
So in my opinion "List<? extends Foo>" is better than "List<Foo>" as return type if
the list is read only.
But this is just my opinion - do whatever you prefer.
From robbie.vanbrabant on August 22, 2007 17:50:34
http://groups.google.com/group/google-guice/t/7813015f7a00f8a5 from Johannes Schneider <johannes
@
familieschneider.info>Hi,
com.google.inject.Guice#createInjector has the following signature:
public static Injector createInjector(Iterable<Module> modules)
Shouldn't that be changed to
public static Injector createInjector(Iterable<? extends Module> modules)
I have a list of my modules as static reference (usefull for testing
purposes).
Collections.unmodifiableList( Arrays.asList( new ApplicationModule(),
new SecurityModule(), new ScannerModule(), new InvoiceModule() ) )
But this line returns a List of AbstractModules (or List<? extends
Module>)....
Original issue: http://code.google.com/p/google-guice/issues/detail?id=143
The text was updated successfully, but these errors were encountered: