harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Harley <george.c.har...@googlemail.com>
Subject [classlib] Exception throwing compatibility
Date Wed, 10 May 2006 18:07:10 GMT

I would like to start a little discussion around JIRA issue 436 [1] 
which deals with exception throwing compatibility between Harmony and 
the RI. I feel it is important to reach a concrete agreement on this as 
so far all of the participants in the issue seem to disagree about the 
interpretation of the compatibility guidelines on our web site [2].

You can read the discussion for yourself on the JIRA page (it is only a 
handful of comments) but if you are pressed for time the essentials are 
this (IMHO - Nathan and Dmitry please feel free to fill in the gaps) :

* Currently the Harmony implementation of a few public methods in 
StringBuffer and StringBuilder throw different runtime exceptions from 
the RI under certain failure scenarios.

* Where the Javadoc mentions the exception type that ought to be thrown 
it mentions a type (j.l.IndexOutOfBoundsException) but the Harmony and 
RI implementations differ in that they are throwing different 
*sub-types* of j.l.IndexOutOfBoundsException. The RI tends to throw 
j.l.ArrayIndexOutOfBoundsException while Harmony tends to throw 

* Dmitry (who raised the issue) believes that we should change the 
Harmony code to throw the type named in the Javadoc/specification (i.e. 
the supertype j.l.IndexOutOfBoundsException).

* Nathan believes that the code already abides by the specification and 
that there is no need for any change in this area.

* Little old me thinks that there *is* a problem here but that the 
solution is to do as the RI does and throw exceptions with the very same 
runtime type as the RI. That's based on my interpretation of the 
exception-throwing compatibility guidelines [2], in particular the 
fragment "Harmony class library code should throw exceptions of the same 
type as the RI".

If I recall correctly we did agree to discuss such compatibility matters 
on a case-by-case basis. So, dear reader, what do you think is the 
correct course of action in this case ?

Best regards,

[1] http://issues.apache.org/jira/browse/HARMONY-436

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