Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
The implementations of Range groovy.lang.ObjectRange and groovy.lang.IntRange have private members that are not final. This means that they can be modified via Groovy. However, if modified both implementations can easily be brought into inconsistent state, as they were implemented in Java under the assumption that private members cannot change.
I suggest making the members final, such that instances of the range classes become immutable.
EDIT: See https://github.com/apache/incubator-groovy/pull/109