JListWrapper.++ modifies the first list

27 views
Skip to first unread message

Nick H

unread,
Jul 20, 2012, 4:12:44 AM7/20/12
to scala...@googlegroups.com
Hello,

I just bumped into some odd behaviour and I wasn't sure if it was intended or if it looks like a bug. Most of the time I can ++ two collections and get back the concatenation of the two collections, without modifying the existing lists. This is true even when the collections are both mutable. Except with JListWrapper! If I am using collection.JavaConversions and do l1 ++ l2 with two java.util.Lists, it seems to do l1.addAll(l2) as a side effect, which was confusing until I worked out what was happening.

Code here:

I couldn't see anything in the docs for ++ that suggested it would ever modify the source lists, so do you reckon it's a bug?

Daniel Sobral

unread,
Jul 20, 2012, 9:14:40 AM7/20/12
to Nick H, scala...@googlegroups.com
Looks like a bug to me.

--
Daniel C. Sobral

I travel to the future all the time.
Reply all
Reply to author
Forward
0 new messages