[
https://issues.apache.org/jira/browse/GROOVY-10438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-10438:
---------------------------------
Description:
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?*
was:
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 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?*
> DGM: getMetaPropertyValues and getProperties includes private entries
> ---------------------------------------------------------------------
>
> Key: GROOVY-10438
> URL: https://issues.apache.org/jira/browse/GROOVY-10438
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Priority: Major
>
> 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.1#820001)