[jboss-jira] [JBoss JIRA] (WFLY-5258) Unexpected behavior of negative priorities in container filters

Stuart Douglas (JIRA) issues at jboss.org
Thu Sep 3 22:56:00 EDT 2015


     [ https://issues.jboss.org/browse/WFLY-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stuart Douglas updated WFLY-5258:
---------------------------------
    Component/s: REST
                     (was: Web (Undertow))


> Unexpected behavior of negative priorities in container filters
> ---------------------------------------------------------------
>
>                 Key: WFLY-5258
>                 URL: https://issues.jboss.org/browse/WFLY-5258
>             Project: WildFly
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 9.0.1.Final
>         Environment: Windows/Linux
>            Reporter: Andreas Redmer
>            Assignee: Stuart Douglas
>            Priority: Minor
>
> Annotation a class that implements ContainerRequestFilter with @Priority(Integer.MIN_VALUE) works as expected. The filter is executed first. For ContainerResponseFilter it is executed in random order.
> Priority values should generally be non-negative, with negative values reserved for special meanings such as "undefined" or "not specified". A specification that defines use of the Priority annotation may define the range of allowed priorities and any priority values with special meaning.
> In this case the behaviour for negative Priorities is inconsistent between the 2 container filters. The correct way to work around this is to annotate:
> @Priority(0)
> Even though: many internet tutorials suggest:
> @Priority(Integer.MIN_VALUE)
> The implemntation oif logging filter in Glassfish does that too: https://github.com/jersey/jersey/blob/master/core-common/src/main/java/org/glassfish/jersey/filter/LoggingFilter.java



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list