[jsword-devel] jdk1.5

DM Smith jsword-devel@crosswire.org
Sat, 20 Mar 2004 09:51:56 -0500


I was trying to see how jdk1.5 rendered html styles and I was suprised by 24 
errors. Most of them were in using StringBuffer. In looking at it I can't 
believe that StringBuffer would change that much.

Specifically, StringBuffer in 1.4 implements Serializable and CharSequence 
but is derived from Object.
In 1.5 it implements the same, but is derived from AbstractStringBuilder, 
which is package protected.

The impact of it being package protected is that you can't do the following:
buf.append("xxx").append("yyy")
as the first method returns a AbstractStringBuilder and calling the second 
append results in a compile error.

If that were not bad enough, AbstractStringBuilder implements Appendable 
whose signature for append throws an IOException. This means that every use 
of append on a StringBuffer now needs to catch exceptions.

There is a third problem, which has already been reported in the bug parade, 
but it involves Appendable in the context of Writers.

I have reported both as a bugs to Sun.

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://clk.atdmt.com/AVE/go/onm00200415ave/direct/01/