Re: 2 Questions on StringBuffer

2010-03-17 Thread Martin Buchholz
On Wed, Mar 17, 2010 at 14:24, Ulf Zibis wrote: > Am 17.03.2010 20:12, schrieb Martin Buchholz: >> >> On Wed, Mar 17, 2010 at 10:02, Ulf Zibis  wrote: >> >>> >>> Additionally I think, there's a bug in javadoc of those methods. >>> Actually they throw StringIndexOutOfBoundsException. >>> >> >> Why

Re: 2 Questions on StringBuffer

2010-03-17 Thread Ulf Zibis
Am 17.03.2010 20:12, schrieb Martin Buchholz: On Wed, Mar 17, 2010 at 10:02, Ulf Zibis wrote: Additionally I think, there's a bug in javadoc of those methods. Actually they throw StringIndexOutOfBoundsException. Why would that be a bug? I think, javadoc should indicate StringI

Re: 2 Questions on StringBuffer

2010-03-17 Thread Martin Buchholz
On Wed, Mar 17, 2010 at 10:02, Ulf Zibis wrote: > Am 17.03.2010 18:41, schrieb Martin Buchholz: >> >> On Wed, Mar 17, 2010 at 08:29, Ulf Zibis  wrote: >> >>> >>> Why there are 2 methods which do not use the super method, where I can't >>> see >>> any difference? : >>> >>>    public synchronized ch

Re: 2 Questions on StringBuffer

2010-03-17 Thread Ulf Zibis
Am 17.03.2010 18:41, schrieb Martin Buchholz: On Wed, Mar 17, 2010 at 08:29, Ulf Zibis wrote: Why there are 2 methods which do not use the super method, where I can't see any difference? : public synchronized char charAt(int index) public synchronized void setCharAt(int index, char

Re: 2 Questions on StringBuffer

2010-03-17 Thread Martin Buchholz
On Wed, Mar 17, 2010 at 08:29, Ulf Zibis wrote: > Why there are 2 methods which do not use the super method, where I can't see > any difference? : > >    public synchronized char charAt(int index) >    public synchronized void setCharAt(int index, char ch) You're correct that these methods could

Re: 2 Questions on StringBuffer

2010-03-17 Thread Ulf Zibis
Am 17.03.2010 17:36, schrieb Rémi Forax: Le 17/03/2010 17:29, Ulf Zibis a écrit : Why there are 2 methods which do not use the super method, where I can't see any difference? : public synchronized char charAt(int index) public synchronized void setCharAt(int index, char ch) Wouldn't e

Re: 2 Questions on StringBuffer

2010-03-17 Thread Rémi Forax
Le 17/03/2010 17:29, Ulf Zibis a écrit : Why there are 2 methods which do not use the super method, where I can't see any difference? : public synchronized char charAt(int index) public synchronized void setCharAt(int index, char ch) Wouldn't ensureCapacity better coded as follows? :

2 Questions on StringBuffer

2010-03-17 Thread Ulf Zibis
Why there are 2 methods which do not use the super method, where I can't see any difference? : public synchronized char charAt(int index) public synchronized void setCharAt(int index, char ch) Wouldn't ensureCapacity better coded as follows? : public void ensureCapacity(int minimumC