[
https://issues.apache.org/jira/browse/GROOVY-9631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Sun updated GROOVY-9631:
-------------------------------
Description:
*BACKGROUND*
Groovy home-made data structures are lack of maintainence for a long time, so
it's better to replace them with mature and continuous improving data structure
from JDK
*SCOPE*
# Deprecate redundant {{AbstractConcurrentMapBase}},
{{AbstractConcurrentMap}}, {{ManagedConcurrentMap}}, and their related inner
classes, e.g. {{Entry}}
# Replace {{ManagedConcurrentMap}} with {{ManagedIdentityConcurrentMap}},
which is base on {{ConcurrentHashMap}}
# Deprecate {{ComplexKeyHashMap}}, {{SingleKeyHashMap}} and
{{TripleKeyHashMap}}. Note: {{TripleKeyHashMap}} is only used by never called
method
# Polish {{Index}} and {{MethodIndex}} in the class {{MetaClassImpl}}, they
derive from {{SingleKeyHashMap}}
*BENEFITS*
# Better maintainence and readability
# Keep the original order of properties declared, it's important for
serializing object to Json/Xml
{code:java}
class Person {
String name
int age
String gender
}
def person = new Person(name: 'Alice', age: 1, gender: 'F')
for (def prop : person.properties) {
println prop
}
{code}
*3.0.4's output*
{code:java}
gender=F
class=class Person
age=1
name=Alice
{code}
*pr1306's output*
{code:java}
name=Alice
age=1
gender=F
class=class Person
{code}
See [https://github.com/apache/groovy/pull/1306]
was:
*BACKGROUND*
Groovy home-made data structures are lack of maintainence for a long time, so
it's better to replace them with mature and continuous improving data structure
from JDK
*SCOPE*
# Deprecate redundant {{AbstractConcurrentMapBase}},
{{AbstractConcurrentMap}}, {{ManagedConcurrentMap}}, and their related inner
classes, e.g. {{Entry}}
# Replace {{ManagedConcurrentMap}} with {{ManagedIdentityConcurrentMap}},
which is base on {{ConcurrentHashMap}}
# Deprecate {{ComplexKeyHashMap}}, {{SingleKeyHashMap}} and
{{TripleKeyHashMap}}. Note: {{TripleKeyHashMap}} is only used by never called
method
# Polish {{Index}} and {{MethodIndex}} in the class {{MetaClassImpl}}, they
derive from {{SingleKeyHashMap}}
*BENEFITS*
# Better maintainence and readability
# Keep the original order of properties declared, it's important for
serializing object to Json/Xml
{code:java}
class Person {
String name
int age
String gender
}
def person = new Person(name: 'Alice', age: 1, gender: 'F')
for (def prop : person.properties) {
println prop
}
{code}
*master's output*
{code:java}
gender=F
class=class Person
age=1
name=Alice
{code}
*pr1306's output*
{code:java}
name=Alice
age=1
gender=F
class=class Person
{code}
See [https://github.com/apache/groovy/pull/1306]
> Replace legacy data structure with Java collection
> --------------------------------------------------
>
> Key: GROOVY-9631
> URL: https://issues.apache.org/jira/browse/GROOVY-9631
> Project: Groovy
> Issue Type: Improvement
> Reporter: Daniel Sun
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 4.0.0-alpha-1
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> *BACKGROUND*
> Groovy home-made data structures are lack of maintainence for a long time,
> so it's better to replace them with mature and continuous improving data
> structure from JDK
> *SCOPE*
> # Deprecate redundant {{AbstractConcurrentMapBase}},
> {{AbstractConcurrentMap}}, {{ManagedConcurrentMap}}, and their related inner
> classes, e.g. {{Entry}}
> # Replace {{ManagedConcurrentMap}} with {{ManagedIdentityConcurrentMap}},
> which is base on {{ConcurrentHashMap}}
> # Deprecate {{ComplexKeyHashMap}}, {{SingleKeyHashMap}} and
> {{TripleKeyHashMap}}. Note: {{TripleKeyHashMap}} is only used by never called
> method
> # Polish {{Index}} and {{MethodIndex}} in the class {{MetaClassImpl}}, they
> derive from {{SingleKeyHashMap}}
> *BENEFITS*
> # Better maintainence and readability
> # Keep the original order of properties declared, it's important for
> serializing object to Json/Xml
> {code:java}
> class Person {
> String name
> int age
> String gender
> }
> def person = new Person(name: 'Alice', age: 1, gender: 'F')
> for (def prop : person.properties) {
> println prop
> }
> {code}
> *3.0.4's output*
> {code:java}
> gender=F
> class=class Person
> age=1
> name=Alice
> {code}
> *pr1306's output*
> {code:java}
> name=Alice
> age=1
> gender=F
> class=class Person
> {code}
> See [https://github.com/apache/groovy/pull/1306]
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)