[jira] Created: (FELIX-1725) SCR Annotations - Support "Add" Operator in annotation values

View: New views
9 Messages — Rating Filter:   Alert me  

[jira] Created: (FELIX-1725) SCR Annotations - Support "Add" Operator in annotation values

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SCR Annotations - Support "Add" Operator in annotation values
-------------------------------------------------------------

                 Key: FELIX-1725
                 URL: https://issues.apache.org/jira/browse/FELIX-1725
             Project: Felix
          Issue Type: Bug
          Components: Maven SCR Plugin
    Affects Versions: maven-scr-plugin-1.4.0
            Reporter: Stefan Seifert
             Fix For: maven-scr-plugin-1.4.1


in scr plugin 1.4.0 it is not possible to use a annotation expression like this:
contentType = "application/json;charset=" + CharEncoding.UTF_8

the attached patch solves this problem by supporting the qdox "AnnotationAdd" class.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1725) SCR Annotations - Support "Add" Operator in annotation values

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Stefan Seifert updated FELIX-1725:
----------------------------------

    Attachment: 091009_annotationadd_FELIX-1725.patch

> SCR Annotations - Support "Add" Operator in annotation values
> -------------------------------------------------------------
>
>                 Key: FELIX-1725
>                 URL: https://issues.apache.org/jira/browse/FELIX-1725
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.4.0
>            Reporter: Stefan Seifert
>             Fix For: maven-scr-plugin-1.4.1
>
>         Attachments: 091009_annotationadd_FELIX-1725.patch
>
>
> in scr plugin 1.4.0 it is not possible to use a annotation expression like this:
> contentType = "application/json;charset=" + CharEncoding.UTF_8
> the attached patch solves this problem by supporting the qdox "AnnotationAdd" class.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1725) SCR Annotations - Support "Add" Operator in annotation values

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/FELIX-1725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773137#action_12773137 ]

Carsten Ziegeler commented on FELIX-1725:
-----------------------------------------

What about checking for the super class com.thoughtworks.qdox.model.annotation.AnnotationBinaryOperator
instead? This should support several operations at once.

> SCR Annotations - Support "Add" Operator in annotation values
> -------------------------------------------------------------
>
>                 Key: FELIX-1725
>                 URL: https://issues.apache.org/jira/browse/FELIX-1725
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.4.0
>            Reporter: Stefan Seifert
>            Assignee: Carsten Ziegeler
>             Fix For: maven-scr-plugin-1.4.1
>
>         Attachments: 091009_annotationadd_FELIX-1725.patch
>
>
> in scr plugin 1.4.0 it is not possible to use a annotation expression like this:
> contentType = "application/json;charset=" + CharEncoding.UTF_8
> the attached patch solves this problem by supporting the qdox "AnnotationAdd" class.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (FELIX-1725) SCR Annotations - Support "Add" Operator in annotation values

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Carsten Ziegeler reassigned FELIX-1725:
---------------------------------------

    Assignee: Carsten Ziegeler

> SCR Annotations - Support "Add" Operator in annotation values
> -------------------------------------------------------------
>
>                 Key: FELIX-1725
>                 URL: https://issues.apache.org/jira/browse/FELIX-1725
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.4.0
>            Reporter: Stefan Seifert
>            Assignee: Carsten Ziegeler
>             Fix For: maven-scr-plugin-1.4.1
>
>         Attachments: 091009_annotationadd_FELIX-1725.patch
>
>
> in scr plugin 1.4.0 it is not possible to use a annotation expression like this:
> contentType = "application/json;charset=" + CharEncoding.UTF_8
> the attached patch solves this problem by supporting the qdox "AnnotationAdd" class.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1725) SCR Annotations - Support "Add" Operator in annotation values

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Stefan Seifert updated FELIX-1725:
----------------------------------

    Attachment: 091103_annotationadd_FELIX-1725.patch

> SCR Annotations - Support "Add" Operator in annotation values
> -------------------------------------------------------------
>
>                 Key: FELIX-1725
>                 URL: https://issues.apache.org/jira/browse/FELIX-1725
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.4.0
>            Reporter: Stefan Seifert
>            Assignee: Carsten Ziegeler
>             Fix For: maven-scr-plugin-1.4.1
>
>         Attachments: 091009_annotationadd_FELIX-1725.patch, 091103_annotationadd_FELIX-1725.patch
>
>
> in scr plugin 1.4.0 it is not possible to use a annotation expression like this:
> contentType = "application/json;charset=" + CharEncoding.UTF_8
> the attached patch solves this problem by supporting the qdox "AnnotationAdd" class.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1725) SCR Annotations - Support "Add" Operator in annotation values

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/FELIX-1725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773197#action_12773197 ]

Stefan Seifert commented on FELIX-1725:
---------------------------------------

unfortunately i dont't think so. the classes AnnotationAdd and AnnotationBinaryOperator does not seem to have knwoledge implemented how to _evaluate_ the left and right expression to a combined value. both "toString" and "getParameterValue" methods output the left and right part concatenated with a " + " (as string) in between - which is not what is expected.

after doing some research in the qdox codebase i found a class "EvaluatingVisitor" that is exactly what we needed. i integrated in into the scr plugin and it seems to work very well - it should evaluate all annotation epressions that can occur, not only the add operation.

it solved a problem with fields declaring integer constants i found recently but did not file a bug yet, too.
new patch attached: 091103_annotationadd_FELIX-1725.patch

> SCR Annotations - Support "Add" Operator in annotation values
> -------------------------------------------------------------
>
>                 Key: FELIX-1725
>                 URL: https://issues.apache.org/jira/browse/FELIX-1725
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.4.0
>            Reporter: Stefan Seifert
>            Assignee: Carsten Ziegeler
>             Fix For: maven-scr-plugin-1.4.1
>
>         Attachments: 091009_annotationadd_FELIX-1725.patch, 091103_annotationadd_FELIX-1725.patch
>
>
> in scr plugin 1.4.0 it is not possible to use a annotation expression like this:
> contentType = "application/json;charset=" + CharEncoding.UTF_8
> the attached patch solves this problem by supporting the qdox "AnnotationAdd" class.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1725) SCR Annotations - Support "Add" Operator in annotation values

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/FELIX-1725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773200#action_12773200 ]

Stefan Seifert commented on FELIX-1725:
---------------------------------------

p.s. the patch replaces the whole annotation value evaluation that was present before - i did some test on one of our biggest projects using SCR annotations with this version, and the resulting xml descriptor files where identically. so it does not seem to break existing behavior.

> SCR Annotations - Support "Add" Operator in annotation values
> -------------------------------------------------------------
>
>                 Key: FELIX-1725
>                 URL: https://issues.apache.org/jira/browse/FELIX-1725
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.4.0
>            Reporter: Stefan Seifert
>            Assignee: Carsten Ziegeler
>             Fix For: maven-scr-plugin-1.4.1
>
>         Attachments: 091009_annotationadd_FELIX-1725.patch, 091103_annotationadd_FELIX-1725.patch
>
>
> in scr plugin 1.4.0 it is not possible to use a annotation expression like this:
> contentType = "application/json;charset=" + CharEncoding.UTF_8
> the attached patch solves this problem by supporting the qdox "AnnotationAdd" class.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-1725) SCR Annotations - Support "Add" Operator in annotation values

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Carsten Ziegeler resolved FELIX-1725.
-------------------------------------

    Resolution: Fixed

Thanks Stefan for updating the patch - I tried it with my test cases and they run fine as well.
So I've applied your patch in revision 832582.

> SCR Annotations - Support "Add" Operator in annotation values
> -------------------------------------------------------------
>
>                 Key: FELIX-1725
>                 URL: https://issues.apache.org/jira/browse/FELIX-1725
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.4.0
>            Reporter: Stefan Seifert
>            Assignee: Carsten Ziegeler
>             Fix For: maven-scr-plugin-1.4.1
>
>         Attachments: 091009_annotationadd_FELIX-1725.patch, 091103_annotationadd_FELIX-1725.patch
>
>
> in scr plugin 1.4.0 it is not possible to use a annotation expression like this:
> contentType = "application/json;charset=" + CharEncoding.UTF_8
> the attached patch solves this problem by supporting the qdox "AnnotationAdd" class.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FELIX-1725) SCR Annotations - Support "Add" Operator in annotation values

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Stefan Seifert closed FELIX-1725.
---------------------------------


> SCR Annotations - Support "Add" Operator in annotation values
> -------------------------------------------------------------
>
>                 Key: FELIX-1725
>                 URL: https://issues.apache.org/jira/browse/FELIX-1725
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.4.0
>            Reporter: Stefan Seifert
>            Assignee: Carsten Ziegeler
>             Fix For: maven-scr-plugin-1.4.1
>
>         Attachments: 091009_annotationadd_FELIX-1725.patch, 091103_annotationadd_FELIX-1725.patch
>
>
> in scr plugin 1.4.0 it is not possible to use a annotation expression like this:
> contentType = "application/json;charset=" + CharEncoding.UTF_8
> the attached patch solves this problem by supporting the qdox "AnnotationAdd" class.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.