Groovy
  1. Groovy
  2. GROOVY-2556

Assignment Operator returns not always the right values

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker 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
          }
      }
      

        Activity

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development