Mark Hale commented on Bug CAL-40

This is a problem for us too. The code above can be greatly improved to help matters. It can check the modifiers and type of the VariableElement to only include public static fields of the same type as the enclosing class. This should be good enough.

However, there is a further issue. The above code uses ve.getSimpleName().toString() (which is equivalent to name()) but everywhere else toString() is used. This creates an additional problem for us as we use an overrided toString() to provide custom bundle keys. I think the only solution to this is to run the processor in a post-compile phase so that it can directly instantiate the enums and call toString(). Some -A processor options to control behaviour would be nice.

At the moment we have managed to work-around these issues by having own our processor that swallows the annotations so that this processor is prevented from running.

Another suggestion is to maybe include the processor in a separate "tools" jar, so that it is easy to include/exclude the processor from running in a maven build.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira