[cdi-dev] Ordering of AfterTypeDiscovery#getAlternatives() et al

Mark Struberg struberg at yahoo.de
Sat Dec 20 05:26:57 EST 2014


Hi!

If I have a 


@Priority(100)
public class MyAlternative implements Foo ..

and 


@Priority(101)
public class ABetterAlternative implements Foo ..


Then ABetterAlternative will finally be chosen. 

This ordering can be changed via AfterTypeDiscovery#getAlternatives().

But the spec only says "returns the ordered list of enabled alternatives for the application.."

But it does NOT define in which sorting this list is ordered ;)

In OWB we hat the 'most important' alternative come first. It seems in Weld it is the other way around.

I have no problem with changing this in OWB, but I would like to get this clarified in our JavaDocs and spec.

LieGrue,
strub


More information about the cdi-dev mailing list