[ 
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.

Reply via email to