Details
-
Question
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Consider the following:
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) }
The metaClass properties includes all visibilities. And the example could probably be extended to show static stuff as well.
class: public final native z: <package-private> y: protected x: private
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?
Attachments
Issue Links
- is related to
-
GROOVY-996 protected fields not visible in subclasses
- Closed
- relates to
-
GROOVY-7682 JsonBuilder or JsonOutput incompatible with JodaTime
- Closed
-
GROOVY-10550 DefaultGroovyMethods.getProperties includes constants
- Closed
-
GROOVY-10555 MetaClass.getProperites() returns package private fields
- Closed
-
GROOVY-5169 JsonOutput.toJson(object) is not returning expected results
- Closed
-
GROOVY-10931 Remove $getLookup method generation (Groovy 4+)
- Closed