ceylon/ceylon-spec — comment on commit 821741e80fda185d5bfd2d9a00e3d858e4676d62
File:  line 0
By davidfestal:

In fact it just avoids storing an Antlr TokenStream by reference.
The problem in doing so was that TokenStream is a statefull class. And modification operations still can be applied on it.
This was clearly the cause of the annoying multi-threading issues in the editor.

Yes, there might be places where I've taken unnecessary precautions, but only the collection is duplicated (maybe not really because the stream itself is not necessarily kept as a reference), but the copied list still references the same CommonToken objects. So I'm not very much worried about memory. But maybe I'm wrong :)

As for the compiler, I'm not sure whether you need to do the change also : I've not looked precisely at how you use the TokenStream once stored.