ceylon/ceylon-sdk — pull request #192 by crawley (2014-01-22 14:37:44+00:00)
Title: Fix for issue #161 - implement mutable CharacterBuffer API

This changeset turns CharacterBuffer into an abstract class, and makes the existing (immutable string-backed) class into an implementation class. Then it adds a second (mutable) implementation class that uses a Java CharBuffer, and a new factory function.

This is a non-backwards-compatible change, but that's unavoidable if we want ByteBuffer and CharacterBuffer to be consistent.

There's one more thing I haven't done ... but I think we should do. The 'newCharacterBufferWithData' function should really be changed to create a mutable buffer. The function that creates an immutable buffer should be called something else; e.g. 'newCharacterBufferForString' ... or something like that.

(I could add that to this pull request, or do it in a followup pull request ...)

(You may also notice a striking similarity between the new CharacterBufferImpl class and ByteBufferImpl ... and the corresponding tests :-) )