[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-dev
Subject:    [jira] [Commented] (WW-4479) Ognl can't access static field on enum
From:       "Jasper Rosenberg (JIRA)" <jira () apache ! org>
Date:       2015-03-19 22:55:40
Message-ID: JIRA.12783210.1426768230000.149659.1426805740929 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/WW-4479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14370284#comment-14370284 \
] 

Jasper Rosenberg commented on WW-4479:
--------------------------------------

Yes, that stackoverflow post describes the bug.  It's a relatively easy to fix in \
OgnlRuntime.getStaticField()  though.

> Ognl can't access static field on enum
> --------------------------------------
> 
> Key: WW-4479
> URL: https://issues.apache.org/jira/browse/WW-4479
> Project: Struts 2
> Issue Type: Bug
> Components: Expression Language
> Affects Versions: 2.3.20
> Reporter: Jasper Rosenberg
> Labels: ognl
> Fix For: 2.5
> 
> 
> You can use an ognl expression to access a static field or an enum field, but you \
> can't access a static field on an enum. @com.myco.MyEnum@MY_STATIC_FIELD
> blows up with:
> Caused by: java.lang.IllegalArgumentException: No enum constant \
> com.myco.MyEnum.MY_STATIC_FIELD OgnlRuntime.getStaticField() needs to check for \
> both enum field name and static field name for enums. This is particularly annoying \
> now with ognl static method invocation deprecated.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic