Announcement Announcement Module
Collapse
No announcement yet.
Mysterious behavior in looping over collection. Iteration count less than size Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mysterious behavior in looping over collection. Iteration count less than size

    Again i have a mysterious behavior in my application:
    Code:
    def users = v.user
    println "Class: "+users.getClass()
    println "Size: "+users.size()
    println "Users: "+users
    users.each{
    	println "User: " + it.login
    }
    Output:
    Class: class java.util.ArrayList
    Size: 4
    Users: [ittutorium.User : 1, ittutorium.User : 1, ittutorium.User : 1, ittutorium.User : 1]
    User: test
    There are four users in the list (four times the same) but the each only iterates over one. How could this be ?
Working...
X