harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Gray <chris.g...@kiffer.be>
Subject Re: [classlib] Exception throwing compatibility
Date Fri, 12 May 2006 10:05:14 GMT
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.

> 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 Gray        /k/ Embedded Java Solutions      BE0503765045
Embedded & Mobile Java, OSGi    http://www.k-embedded-java.com/
chris.gray@kiffer.be                             +32 3 216 0369

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