[
https://issues.apache.org/jira/browse/GROOVY-11928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18074735#comment-18074735
]
ASF GitHub Bot commented on GROOVY-11928:
-----------------------------------------
paulk-asert merged PR #2467:
URL: https://github.com/apache/groovy/pull/2467
> 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
>
> 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)