Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7574

Range members should be final

Agile BoardAttach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.5.0-alpha-1
    • groovy-runtime
    • 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

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            paulk Paul King
            tkruse Thibault Kruse
            Votes:
            0 Vote for this issue
            Watchers:
            3 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment