Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Information Provided
-
4.0.1
-
None
-
None
-
None
Description
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:
println "Groovy ${GroovySystem.version}" GroovySystem.getMetaClassRegistry().getMetaClass(LinkedHashMap).properties.forEach { prop -> println "${prop.name} - ${prop.class.simpleName}" }
With Groovy 3.0.10 it prints:
Groovy 3.0.10 class - MetaBeanProperty empty - MetaBeanProperty
With 4.0.1 it prints:
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
Attachments
Issue Links
- is related to
-
GROOVY-10438 DGM: getMetaPropertyValues and getProperties includes private entries
- Closed
- relates to
-
GROOVY-10550 DefaultGroovyMethods.getProperties includes constants
- Closed