[weld-issues] [JBoss JIRA] (WELD-2628) AfterTypeDiscovery added alternative gets ineffective priority
Title: Message Title Issue was automatically transitioned when Karl von Randow created pull request #1999 in GitHub Weld / WELD-2628 AfterTypeDiscovery added alternative gets ineffective priority Change By: Karl von Randow Status: Open Pull Request Sent Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2628) AfterTypeDiscovery added alternative gets ineffective priority
Title: Message Title Matěj Novotný updated an issue Weld / WELD-2628 AfterTypeDiscovery added alternative gets ineffective priority Change By: Matěj Novotný Fix Version/s: 3.1.5.Final Fix Version/s: 4.0.0.Alpha3 Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2628) AfterTypeDiscovery added alternative gets ineffective priority
Title: Message Title Matěj Novotný commented on WELD-2628 Re: AfterTypeDiscovery added alternative gets ineffective priority I believe I've found the issue. It's the Integer.MIN_VALUE priorities on those two classes. Haha, nice, you got me there. I certainly didn't expect that I think I never saw a negative priority usage within CDI in the first place, but the spec doesn't seem to forbid it so this is a bug we need to fix. Karl von Randow would you be interested in submitting a PR containing a fix + test or should I do it? Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2628) AfterTypeDiscovery added alternative gets ineffective priority
Title: Message Title Karl von Randow edited a comment on WELD-2628 Re: AfterTypeDiscovery added alternative gets ineffective priority [~manovotn] thanks again, especially as it seems there might be is 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? Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2628) AfterTypeDiscovery added alternative gets ineffective priority
Title: Message Title Karl von Randow commented on WELD-2628 Re: AfterTypeDiscovery added alternative gets ineffective priority 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? Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues