You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "James Shaw (JIRA)" <de...@myfaces.apache.org> on 2009/11/02 15:44:59 UTC

[jira] Commented: (TOBAGO-270) APT option values passed to the APT compiler are wrong: -Akey=value => -Akey=value=null

    [ https://issues.apache.org/jira/browse/TOBAGO-270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772525#action_12772525 ] 

James Shaw commented on TOBAGO-270:
-----------------------------------

This is a bug in APT: http://bugs.sun.com/view_bug.do?bug_id=6258929

> APT option values passed to the APT compiler are wrong: -Akey=value => -Akey=value=null
> ---------------------------------------------------------------------------------------
>
>                 Key: TOBAGO-270
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-270
>             Project: MyFaces Tobago
>          Issue Type: Bug
>          Components: Maven Apt Plugin
>    Affects Versions: 1.0.9
>            Reporter: Thierry Monney
>
> When APT options are specified, the plugin does not split the supplied options as quiet=true (as one would expect it). Instead, the annotation processor's environment gets an option of the type quiet=true=null, where quiet=true is the actual key and null is the actual value.
> For example, <A>-Aquiet=true</A> ends up as -Aquiet=true=null. The same happens whether -A is explicit or not.
> The workaround is to manually parse the key in the annotation processor, e.g.,
> String value = null;
> Set<String> keys = env.getOptions().keySet();
> for (String key : keys) {
>     if (key.startsWith(optionName)) {
>         int index = key.indexOf('=');
>         if (index > 0) {
>             value = key.substring(index + 1, key.length());
>         }
>         break;
>     }
> }
> I am not sure whether this is a bug in the Maven plugin, in Plexus command line lib or even in APT itself. Currently I haven't too much time to seriously dig into it, but I will try to narrow things down a little and give more precisions.

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