Immutable collections gone with M10?


#1

I upgraded my project to Kotlin M10 and got a compilation error about 'listBuilder()' method not found. Then I noticed that ImmutableArrayListBuilder<T> class was removed from stdlib - latest API docs do not contain it and github search doesn't find this class too.

I cannot find any information about this change, can you help?
Or maybe something gone wrong with my setup somehow?


#2

Indeed, ImmutableArrayListBuilder was removed for a couple of reasons, of which most important is that it was complete garbage :) Seriously, I'm sorry that I didn't go through the deprecate-delete loop, I somehow thought it was internal type not exposed to public, likely because the public type was somewhere in the middle of the source file.

However, it was not worth using it in the first place. If you really need persistent data structures, I believe you can easily find robust collection library for Java, e.g. http://www.functionaljava.org/
In an emergency case you can recover ImmutableArrayListBuilder from the git history and copy it to your own project.

Sorry for inconvenience, my bad.


#3

Oh, it's nothing critical.

Just wanted to clarify.
I wanted to quickly-use something like Guava’s ImmutableList, so I found ImmutableArrayList in Kotlin.
Not a big deal, I will use ArrayList for now (it will do), thanks for clearing things out.