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

Eric Milles reassigned GROOVY-10555:
------------------------------------

    Assignee: Eric Milles

> MetaClass.getProperites() returns package private fields
> --------------------------------------------------------
>
>                 Key: GROOVY-10555
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10555
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 4.0.1
>            Reporter: Lóránt Pintér
>            Assignee: Eric Milles
>            Priority: Major
>
> According to https://issues.apache.org/jira/browse/GROOVY-10449 public fields 
> should now be included in the result of `MetaClass.getProperites()`. However, 
> it seems that with Groovy 4.0.1 package private fields are also returned.
> *Steps to reproduce*
> Take this code:
> {code:groovy}
> println "Groovy ${GroovySystem.version}"
> GroovySystem.getMetaClassRegistry().getMetaClass(LinkedHashMap).properties.forEach
>  { prop ->
>     println "${prop.name} - ${prop.class.simpleName}"
> }
> {code}
>  
> With Groovy 3.0.10 it prints:
> {code:none}
> Groovy 3.0.10
> class - MetaBeanProperty
> empty - MetaBeanProperty
> {code}
>  
> With 4.0.1 it prints:
> {code:none}
> Groovy 4.0.1
> keySet - CachedField
> values - CachedField
> DEFAULT_INITIAL_CAPACITY - CachedField
> MAXIMUM_CAPACITY - CachedField
> DEFAULT_LOAD_FACTOR - CachedField
> TREEIFY_THRESHOLD - CachedField
> UNTREEIFY_THRESHOLD - CachedField
> MIN_TREEIFY_CAPACITY - CachedField
> table - CachedField
> entrySet - CachedField
> size - CachedField
> modCount - CachedField
> threshold - CachedField
> loadFactor - CachedField
> serialVersionUID - CachedField
> head - CachedField
> tail - CachedField
> accessOrder - CachedField
> class - MetaBeanProperty
> empty - MetaBeanProperty
> {code}
>  



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

Reply via email to