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

Assignment Operator returns not always the right values

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.5.2
    • Fix Version/s: 1.5.3
    • Component/s: None
    • Labels:
      None

      Description

      The test case at the bottom runs with 1.5.0 and 1.5.1 and fails with 1.5.2.

      The failing test with 1.5.2 is testAssignmentWithMap

      class AssignmentTest extends GroovyTestCase {
          final String SOME_METHOD_VALUE = 'someMethodValue'
          final String TEST_NAME = 'someName'
      
          String s
      
          Map names
      
          void setUp() {
              names = [:]
          }
          
          void testAssignmentWithString() {
              assertEquals(SOME_METHOD_VALUE, someMethod())
          }
      
          void testAssignmentWithMap() {
              assertEquals(TEST_NAME, addName(TEST_NAME))
          }
      
          String someMethod() {
              s = SOME_METHOD_VALUE
          }
      
          String addName(String name) {
              names[name] = name
          }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              ait Alex Tkachman
              Reporter:
              hans_d Hans Dockter
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: