You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2014/09/19 11:46:34 UTC

[jira] [Updated] (FELIX-4648) SlingAnnotationProcessor.processSlingFilter cannot deal with multiple scopes

     [ https://issues.apache.org/jira/browse/FELIX-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konrad Windszus updated FELIX-4648:
-----------------------------------
    Description: 
If an annotation like this is used:

{code}
@SlingFilter(generateComponent = false, generateService = true, order = -700, scope = { SlingFilterScope.REQUEST, SlingFilterScope.ERROR })
{code}

the generated XML will contain only the first scope (i.e. request)
{code}
....
        <service servicefactory="false">
            <provide interface="javax.servlet.Filter"/>
        </service>
        <property name="service.ranking" type="Integer" value="-700"/>
        <property name="sling.filter.scope" value="REQUEST"/>
{code}

The problem is https://github.com/apache/felix/blob/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SlingAnnotationProcessor.java#L191. That can only deal with single values.
Rather it should use the helper method {{generateStringPropertyDescriptor}}, like it is done for all the multivalue fields of the annotation {{@SlingServlet}}.

  was:
If an annotation like this is used:

{code}
@SlingFilter(generateComponent = false, generateService = true, order = -700, scope = { SlingFilterScope.REQUEST, SlingFilterScope.ERROR })
{code}

the generated XML will contain only the first scope (i.e. request)
{code}
....
        <service servicefactory="false">
            <provide interface="javax.servlet.Filter"/>
        </service>
        <property name="service.ranking" type="Integer" value="-700"/>
        <property name="sling.filter.scope" value="REQUEST"/>
{code}

The problem is https://github.com/apache/felix/blob/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SlingAnnotationProcessor.java#L191.
Rather it should use the helper method {{generateStringPropertyDescriptor}}, like it is done for all the multivalue fields of the annotation {{@SlingServlet}}.


> SlingAnnotationProcessor.processSlingFilter cannot deal with multiple scopes
> ----------------------------------------------------------------------------
>
>                 Key: FELIX-4648
>                 URL: https://issues.apache.org/jira/browse/FELIX-4648
>             Project: Felix
>          Issue Type: Bug
>          Components: SCR Tooling
>    Affects Versions: scr annotations 1.9.8
>            Reporter: Konrad Windszus
>
> If an annotation like this is used:
> {code}
> @SlingFilter(generateComponent = false, generateService = true, order = -700, scope = { SlingFilterScope.REQUEST, SlingFilterScope.ERROR })
> {code}
> the generated XML will contain only the first scope (i.e. request)
> {code}
> ....
>         <service servicefactory="false">
>             <provide interface="javax.servlet.Filter"/>
>         </service>
>         <property name="service.ranking" type="Integer" value="-700"/>
>         <property name="sling.filter.scope" value="REQUEST"/>
> {code}
> The problem is https://github.com/apache/felix/blob/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SlingAnnotationProcessor.java#L191. That can only deal with single values.
> Rather it should use the helper method {{generateStringPropertyDescriptor}}, like it is done for all the multivalue fields of the annotation {{@SlingServlet}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)