RE: Java 5 planning

"Michael Kay" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <020201c87ed3$c2931f00$6401a8c0@turtle>
> Actually every occurrence of String as a parameter could be 
> changed to CharSequence allowing the user to pass String, 
> StringBuffer, and StringBuilder or even CharBuffer.

The downside is that (a) you can't assume that the supplied value is
immutable; if you need to retain it beyond the call you have to make a copy;
(b) there can be a lot of "instance of" testing to see what kind of
CharSequence you've been given, and (c) you can't compare different kinds of
CharSequence for equality.

Saxon uses CharSequence very extensively despite these drawbacks, but it's
not necessarily the right approach everywhere.

Michael Kay
http://www.saxonica.com/

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.