<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Michael Kay wrote (2008-03-05 16:15):
<blockquote cite="mid:020201c87ed3$c2931f00$6401a8c0@turtle" type="cite">
<blockquote type="cite">
<pre wrap="">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.
</pre>
</blockquote>
<pre wrap=""><!---->
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.
</pre>
</blockquote>
<br>
Another downside is that the API will be less trivial for novice Java
programmers. (So there will probably be more traffic on this list...)<br>
<br>
/Mattias<br>
</body>
</html>