Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

Smack 4.1.0-Alpha4 and an issue with ProviderManager.addStreamFeatureProvider

$
0
0

It looks like Smack 4.1.0-Alpha4 has introduced generic types into the ProviderManager class.

 

Unfortunately the signature of the addStreamFeatureProvider now looks like this:

 

addStreamFeatureProvider(String elementName, String namespace, PacketExtensionProvider<PacketExtension> provider)

 

Which seems to require a parameter of type PacketExtensionProvider<PacketExtension> to be provided. Seeing as how PacketExtension is an interface, my code is now getting all kinds of compiler errors. Previously the following would work fine:

 

ProviderManager.addStreamFeatureProvider(ELEMENT, NAMESPACE, new StreamManagementStreamFeatureProvider());

 

But now it fails to compile.

 

It feels like the method should actually be:

addStreamFeatureProvider(String elementName, String namespace, PacketExtensionProvider<? extends PacketExtension> provider)

 

To allow for extension of PacketExtension and not just packet extension itself.

 

Or am I missing something?


Viewing all articles
Browse latest Browse all 10742

Trending Articles