Discussion:
Collections of generic types
Christopher Oezbek
2009-01-05 17:03:12 UTC
Permalink
Hi Guys,
first a big thank you for the great PicoContainer that has simplyfied my
whole programming style a lot.

I am having a problem with Collections/Arrays that should contain objects of
generic types:

First I tried passing as an array:

public MyComponent(GenericType<?>[] preferenceUIs){...

which throws an IllegalArgumentException in
CollectionComponentParameter.getCollectionType():180, which might be because
such an Array is a GenericArrayType (getCollectionType does only check for
Class and ParametrizedType)

and as a Collection:

public MyComponent(List<GenericType<?>> preferenceUIs)

which throws an UnsatisfiableDependenciesException (same if replacing the ?
with Object)

Removing the type parameter List<GenericType> will make it work, but
requires casting.

Are there any known work-arounds?

Cheers,
Christopher
--
View this message in context: http://www.nabble.com/Collections-of-generic-types-tp21294886p21294886.html
Sent from the NanoContainer - PicoContainer - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Loading...