harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Blewitt" <alex.blew...@gmail.com>
Subject Re: Re: [classlib] compatibility of toString
Date Fri, 07 Jul 2006 15:52:12 GMT
On 06/07/06, Geir Magnusson Jr <geir@pobox.com> wrote:
> Alex Blewitt wrote:
> > IMNSHO I don't think we should by default copy the toString()
> > behaviour from the RI, unless mandated by the spec in JavaDoc.
> Ok.  Good rant, and I agree with it, but I still don't see a reason here
> why we shouldn't, other than to .... teach people a lesson?

If people are relying on one implementation that's undocumented
behaviour, then it's bad code. It may well fail on any other system
(inc. embedded systems, or other OS, or even between different

But the real reason is one of defense; how can you say that you've
implemented a clean-room version of the code from the spec, when all
the toString() results are identical with a proprietary implementation
that you have no way of knowing what the result should be, except by
running the propetary version to find out? Obviously, some cases it
will be obvious (e.g. we can guess what a java.net.URL looks like) but
in most cases it won't be (e.g. java.net.URLConnection).

I say that we follow the spec, and if the spec doesn't list an
explicit format, we use our own. If it is amazingly obvious (e.g. a
Point may be printed (1,2)) and it happens to correspond with the Sun
RI, then great, but we shouldn't be striving to be the same in all


Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message