Eclipse compiler says attribute is undefined in case of array of enums field in the annotation

I'm using Spring Security 3.1.0.RC3 because the possibility to secure methods with enum privileges was introduced in 3.1. Here is my annotation: public @interface SecuredEnum { public PrivilegeEnum[] value(); } And here is how I use it: import static somepath1.PrivilegeEnum.SOME_PRIV1; public interface MyService extends BaseService { @SecuredEnum(SOME_PRIV1) void insertOrUpdateMyObject(MyObject myObject); } javac compiles this code correctly every time, but eclipse (Indigo SR1) compiler gives an error after Project -> Clean: The attribute value is undefined for the annotation type SecuredEnum and suggests a quick fix: Create attribute 'value()' So here is my workaround: I apply this fix, and comment out the array field in the annotation: public @interface SecuredEnum { // public PrivilegeEnum[] value(); public PrivilegeEnum value(); } After that eclipse compiles all classes correctly (except for those where @SecuredEnum takes two or more privileges). Next step is to uncomment the old array field and delete new field created by the quick fix. As a result, everything is compiled perfectly. So this is pretty annoying to do each time the project is cleaned. Another problem is that I can't reproduce this problem with a sample project, so maybe there is some crucial information that is missing from this question text. Whos bug is it and how is it possible to fix it? UPDATE: neither using explicit array in the annotation argument (i.e. adding { } brackets), nor defining the argument name ('value') explicitly nor using fully qualified enum value instead of static import helps
Other answers didn't help me. Only solution worked for me was switching back to eclipse indigo from eclipse juno. It solved the problem.

以上就是Eclipse compiler says attribute is undefined in case of array of enums field in the annotation的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏