harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess" <mark.hind...@googlemail.com>
Subject matching reference implementation exception behaviour
Date Fri, 24 Mar 2006 17:00:24 GMT
As you might have noticed, if you are reading the JIRA messages on the
commits list, I've been looking at the error case behaviour of
constructors.  (In fact, I've written a Perl script to generate a
program to creates several thousand test cases from the constructor
specification in a japi file.  I'll probably extend it to test other
static methods when I have a spare minute.)

I'm wondering how far we should try to match the behaviour of the
reference implementation.  For instance, I've been submitting fixes
for a number of cases of incorrect exceptions being thrown and I think
they are worth fixing, but then I came across this one:

  j.io.RandomAccessFile((j.l.String)null,""): # i.e. null filename, empty mode

the RI throws j.l.IllegalArgumentException because it checks the mode
first but we throw a NullPointerException because we check the file
first.

Does it matter?  Should we be matching behaviour?

Regards,
 Mark.

--
Mark Hindess <mark.hindess@googlemail.com>
IBM Java Technology Centre, UK.

Mime
View raw message