Chris Gray wrote:
On Friday 12 May 2006 11:37, George Harley wrote:
Nathan Beyer wrote:
Note, the RI is NOT throwing ArrayIndexOutOfBoundsExceptions, it is just
letting them happen via invalid array look ups, but in these cases, the
specification is marked with an IndexOutOfBoundsException.
Hi Nathan,

If we consider the RI as a "black box" whose internals should be
completely hidden from us - a starting point that I think is important
to all participants of this project (and their legal representatives) -
then it does not matter *why* the RI is throwing the AIOOBE. It just does.

Right, and in general we cannot know exactly which exception type the RI will throw in any specific case - we have to start from the assumption that it follows the spec, and take note of any deviations or more specific behaviour that turns up. It's not possible to exhaustively test every exception case.

Hi Chris,

Absolutely agree with you that we should not be looking to exhaustively test every exception case. We have to work in a mode where we respond to each deviation as we become aware of them.


What will matter more to potential Harmony adopters ? Adherence to the
spec or ease of transition of their apps from the RI to Harmony ? In
this case we can satisfy the spec and enable runtime compatibility by
throwing the identical concrete exception type.

If the app is written to the spec there's no problem. But in real life it can happen that the developer doesn't look at the spec - during testing her code throws an AIOOBE, so she adds an exception handler for that case. In this case we make this (incorrect) app run by copying RI's behaviour (insofar as we can determine what this is). But if RI throws sun.util.FunnyIndexOutOfBoundsException and the programmer codes to this, we're hosed - the app has to fixed.

Chris

Indeed. We can only throw something with the same public/non-implementation-specific supertype and hope for the best.

Best regards,
George





---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to