You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2023/07/25 22:54:00 UTC

[jira] [Resolved] (GROOVY-10438) DGM: getMetaPropertyValues and getProperties includes private entries

     [ https://issues.apache.org/jira/browse/GROOVY-10438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles resolved GROOVY-10438.
----------------------------------
    Fix Version/s: 5.0.0-alpha-1
       Resolution: Fixed

https://github.com/apache/groovy/commit/dce378e1e242f551eb697a30f6aca5a9f6188e26

> DGM: getMetaPropertyValues and getProperties includes private entries
> ---------------------------------------------------------------------
>
>                 Key: GROOVY-10438
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10438
>             Project: Groovy
>          Issue Type: Question
>            Reporter: Eric Milles
>            Priority: Major
>             Fix For: 5.0.0-alpha-1
>
>
> Consider the following:
> {code:groovy}
> class C {
>   private getX() {}
>   protected getY() {}
>   @groovy.transform.PackageScope getZ() {}
> }
> C.metaClass.properties.each {
>   println it.name + ': ' + org.codehaus.groovy.ast.AstToTextHelper.getModifiersText(it.modifiers)
> }
> {code}
> The metaClass properties includes all visibilities.  And the example could probably be extended to show static stuff as well.
> {code}
> class: public final native
> z: <package-private>
> y: protected
> x: private
> {code}
> These properties are used (unfiltered) to generate the results for DefaultGroovyMethods getMetaPropertyValues and getProperties.  GROOVY-5169 and GROOVY-7682 are partially caused by this.
> *Should the extension methods return private properties?*



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