Re: Gap Buffer based AbstractStringBuilder implementation

2009-11-22 Thread Thomas Hawtin
Osvaldo Pinali Doederlein wrote: public String toStringShared() { // createShared() is a package-protected helper/ctor String ret = String.createShared(value, 0, count); // Reset value, so evil user can't abuse the buffer to change the String. value = EMPTY;

Re: Gap Buffer based AbstractStringBuilder implementation

2009-11-21 Thread Thomas Hawtin
Osvaldo Doederlein wrote: Looks like good stuff. And it remembers me from another old issue: patterns of code that demand data copying that could often be avoided. Every StringBuffer/StringBuilder is ultimately consumed by a toString() invocation to produce the result String, and in 99% of all

Re: Maybe i'm being naive about Threads.

2009-11-21 Thread Thomas Hawtin
Rémi Forax wrote: Le 21/11/2009 07:48, Paulo Levi a écrit : But i'm wondering why there isn't a global jvm system option for the new Thread(runnable).start() to perserve stack traces at least until the start method. You don't need the VM for that, something like that should work: public cla

Re: Proposal for improving performance of TreeMap and others

2008-01-07 Thread Thomas Hawtin
cowwoc wrote: I noticed that TreeMap (and maybe other classes) require a user to either pass in a Comparator or ensure that all keys must implement Comparable. The TreeMap code then uses a utility method whenever it needs to compare two keys: I'm not going to comment about performance, but ther