[
https://issues.apache.org/jira/browse/GROOVY-11928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King resolved GROOVY-11928.
--------------------------------
Fix Version/s: 6.0.0-alpha-1
Resolution: Fixed
> Make MetaClassImpl.getProperties() respect @Internal
> ----------------------------------------------------
>
> Key: GROOVY-11928
> URL: https://issues.apache.org/jira/browse/GROOVY-11928
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
> Fix For: 6.0.0-alpha-1
>
>
> MetaClassImpl.getProperties() does not check for @Internal annotations on
> fields or getter/setter methods. This creates an inconsistency:
> * At compile time, BeanUtils.getAllProperties() already skips methods
> annotated with @Internal (since GROOVY-9081).
> * At runtime, MetaClassImpl.getProperties() does not check @Internal, so
> tools like JsonOutput.toJson(), println, and other
> property-introspection-based features expose internal properties.
> AST transforms that generate internal fields (often with $ in the name)
> currently rely on ad-hoc excludes logic or deemedInternalName() checks in
> each individual transform (@ToString, @EqualsAndHashCode, @Delegate, etc.).
> If getProperties() respected @Internal, these transforms could simply
> annotate generated fields/accessors with @Internal and the filtering would
> happen consistently everywhere — both at compile time and runtime.
> This supercedes GROOVY-11516 which looked for a simplistic solution for names
> containing "$" but never really solved all the cases.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)