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>)....
Regards,
Johannes Schneider
--
Johannes Schneider
Im Lindenwasen 15
72810 Gomaringen
Fon +49 7072 9229972
Fax +49 7072 509999
Mobil +49 178 1364488
joha...@familieschneider.info
http://www.johannes-schneider.info
You can fix this with:
Collections.unmodifiableList( Arrays.<Module>asList( new ... );
Yes, the syntax is very strange, as is almost everything at the
intersection of arrays and generics. :-/
-- Laura
Johannes Schneider
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "google-guice" group.
> To post to this group, send email to google...@googlegroups.com
> To unsubscribe from this group, send email to google-guice...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/google-guice?hl=en
> -~----------~----~----~----~------~----~------~--~---
Thanks for your suggestion. But I think it is still a "bug" and should
be changed.
Johannes Schneider
Laura Werner wrote:
>> Collections.unmodifiableList( Arrays.asList( new ApplicationModule(),
>> new SecurityModule(), new ScannerModule(), new InvoiceModule() ) )
>>
>> But this line returns a List of AbstractModules (or List<? extends
>> Module>)....
>
> You can fix this with:
>
> Collections.unmodifiableList( Arrays.<Module>asList( new ... );
>
> Yes, the syntax is very strange, as is almost everything at the
> intersection of arrays and generics. :-/
>
> -- Laura
>
>
>
Collections.unmodifiableList( Arrays.<Module>asList( new ... );
Yes, the syntax is very strange, as is almost everything at the
intersection of arrays and generics. :-/
I have created a patch that fixes this problem and the same problem at
two or three other locations.
Johannes Schneider
Robbie Vanbrabant wrote:
> I've quickly created the issue for you:
> http://code.google.com/p/google-guice/issues/detail?id=143
>
> On 8/22/07, *Johannes Schneider* <joha...@familieschneider.info
> <mailto:joha...@familieschneider.info>> wrote:
>
> Thanks for your suggestion. But I think it is still a "bug" and should
> be changed.
>
>
> Johannes Schneider
>
> Laura Werner wrote:
> >> Collections.unmodifiableList( Arrays.asList( new
> ApplicationModule(),
> >> new SecurityModule(), new ScannerModule(), new InvoiceModule() ) )
> >>
> >> But this line returns a List of AbstractModules (or List<? extends
> >> Module>)....
> >
> > You can fix this with:
> >
> > Collections.unmodifiableList( Arrays.<Module>asList( new ... );
> >
> > Yes, the syntax is very strange, as is almost everything at the
> > intersection of arrays and generics. :-/
> >
> > -- Laura
> >
> >
> >
> Fax +49 7072 509999
> Mobil +49 178 1364488
>
> joha...@familieschneider.info <mailto:joha...@familieschneider.info>
> http://www.johannes-schneider.info <http://www.johannes-schneider.info>
>
>
>
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "google-guice" group.
> To post to this group, send email to google...@googlegroups.com
> To unsubscribe from this group, send email to
> google-guice...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
--
Johannes Schneider
Im Lindenwasen 15
72810 Gomaringen
Fon +49 7072 9229972