groovy
  1. groovy
  2. GROOVY-4699

Observable List misbehaves when using retainAll with closure

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.7.5
    • Fix Version/s: 1.8.2, 1.9-beta-3, 1.7.11
    • Component/s: groovy-jdk
    • Labels:
      None
    • Environment:
      Eclipse Plugin, Windows 7
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      List liste = new ObservableList<String>()

      liste.add "test"
      liste.add "test2"

      List andereListe = new LinkedList<String>()

      liste.retainAll

      { elem -> andereListe.contains(elem) }

      assert liste.isEmpty()
      ____________________________________________

      This results in:
      ____________________________________________
      Exception in thread "main" Assertion failed:

      assert liste.isEmpty()

       
      false
      [test]
      ____________________________________________

      If the ObservableList is changed to LinkedList, the testcase works.

        Activity

          People

          • Assignee:
            Paul King
            Reporter:
            Simon Harrer
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: