You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Thibault Kruse (JIRA)" <ji...@apache.org> on 2015/09/01 21:51:45 UTC

[jira] [Updated] (GROOVY-7574) Range members should be final

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

Thibault Kruse updated GROOVY-7574:
-----------------------------------
    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

  was:
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.


> Range members should be final
> -----------------------------
>
>                 Key: GROOVY-7574
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7574
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-runtime
>            Reporter: Thibault Kruse
>            Priority: Minor
>
> 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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)