Matěj Novotný thanks again, especially as it seems there might be something odd with my setup. I can confirm that I do see the getAlternatives list containing two classes at the end that have Integer.MIN_VALUE priority, and others earlier in the list with 100 and 200. I believe I've found the issue. It's the Integer.MIN_VALUE priorities on those two classes. Let me try to excuse myself by saying that those priorities are actually for JAX-RS (as the classes are Filters), and I'm using CXF-CDI so my classes are @Dependent but use @Priority for JAX-RS and aren't actually alternatives. The compareTo function in org.jboss.weld.bootstrap.enablement.Item uses return p1 - p2; as the return value, which hits an integer overflow when p2 == Integer.MIN_VALUE. I'm not clear on whether (large) negative priorities are legal in the CDI spec. They're certainly possible! Perhaps it could be considered a fix to change the compareTo method to avoid integer overflow with a few comparisons? |