maidh91 / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

removeIf() broken for RandomAccess lists that don't support set() #377

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
 final ArrayList<Integer> crash = Lists.newArrayList(1, 2, 3, 4, 5); 
 Iterables.removeIf(Lists.transform(crash, intoDouble()), even()); 
 System.out.println(crash);

What is the expected output? What do you see instead?
 Expected result should be [1,3,5]
 Instead, this exception is reported:

java.lang.UnsupportedOperationException 
        at java.util.AbstractList.set(AbstractList.java:115) 
        at com.google.common.collect.Iterables.removeIfFromRandomAccessList(Iterables. java: 167) 
        at com.google.common.collect.Iterables.removeIf(Iterables.java:152) 
        ..... 

What version of the product are you using? On what operating system?
  guava r05

Please provide any additional information below.

this have already been discussed here:

http://groups.google.com/group/guava-discuss/browse_thread/thread/2d422600e7f873
67/1e6c6a7b41c87aac#1e6c6a7b41c87aac

Original issue reported on code.google.com by sylvain....@gmail.com on 12 Jul 2010 at 7:38

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 30 Jul 2010 at 3:51

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 30 Jul 2010 at 3:56

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 25 Aug 2010 at 9:34

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 14 Sep 2010 at 8:55

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 18 Jan 2011 at 8:35

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 27 Jan 2011 at 1:57

GoogleCodeExporter commented 9 years ago

Original comment by fry@google.com on 22 Mar 2011 at 7:06

GoogleCodeExporter commented 9 years ago

Original comment by fry@google.com on 23 Mar 2011 at 1:49

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 8 Apr 2011 at 2:06

GoogleCodeExporter commented 9 years ago

Original comment by fry@google.com on 14 Apr 2011 at 12:43

GoogleCodeExporter commented 9 years ago
fine :), TY 

Original comment by sylvain....@gmail.com on 15 Apr 2011 at 7:28

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:09