Henri Biestro created JEXL-472:
----------------------------------

             Summary: Add property access for Java record component accessors
                 Key: JEXL-472
                 URL: https://issues.apache.org/jira/browse/JEXL-472
             Project: Commons JEXL
          Issue Type: Improvement
    Affects Versions: 3.7.0
            Reporter: Henri Biestro
            Assignee: Henri Biestro
             Fix For: 3.7.1


Property access (`foo.bar`) never resolves to a record's generated `bar()` 
accessor — only to `getBar()`/`isBar()`, a public field, or duck-typed 
`get(Object)`. On a record `Point(int x, int y)`, `point.x` throws 
JexlException$Property: undefined property 'x'.

Add a RecordGetExecutor, tried right after PropertyGetExecutor/ 
BooleanGetExecutor, so an existing getFoo() override still wins. It 
matches the property to a record component, then resolves the accessor 
through the normal permission-checked Introspector. Detection uses 
reflection only (resolved once, cached) so the module still builds on 
Java 8, where it simply finds nothing.

Credit: initial patch by Aurélien Mino. ( 
[https://github.com/apache/commons-jexl/pull/415] )



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to