harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Liang <richard.lian...@gmail.com>
Subject Re: [classlib][summary] Exception throwing compatibility
Date Wed, 09 Aug 2006 09:45:19 GMT


Alex Blewitt wrote:
> I think that as long as the spec says throws java.x.Y, and we throw a
> java.x.Y (or an o.a.h subclass of java.x.Y) then that meets the spec.
>
Yes. That really complies with the spec. But for Harmony, Complying with 
spec is not enough. What we are aiming is that user applications would 
not be broken if they transfer from RI to Harmony. IMHO, we shall try 
our best to *comply* with RI. Please correct me if I'm wrong. Thanks a lot.

> I think the wording could be clearer though; for example, the 'public
> superclass' is almost certainly meant to be 'an exception in the
> standard Java class libraries'. For a start,
> sun.io.MalformedInputException might actually be a subclass of
> sun.io.GeneralInputException, which has the ACC_PUBLIC bit set (even
> though it's not a defined class in the Java spec).
>
Yes, this description is really confusing. (That's why I post it on wiki 
page for comments ;-) )

And....
> Perhaps "If the exception thrown is a direct instance of an exception
> from the Java libraries, we will throw the same exception; if it is an
> instance of an exception not in the Java libraries then we will throw
> an equivalent o.a.h exception or a parent exception in the Java
> libraries". It's possible that there's an exception class which is
> abstract that we must create a subclass for, though off the top of my
> head I can't think of an abstract exception class in the Java
> libraries ...
Your suggestion sounds better. Thanks a lot, Alex

Best regards,
Richard
>
> Alex.
>
> On 09/08/06, Andrew Zhang <zhanghuangzhu@gmail.com> wrote:
>> "But there are some cases that RI throws an implementation specific
>> exception, we shall throw its public superclass. e.g., If RI throws
>> sun.io.MalformedInputException, we shall throw
>> java.io.CharConversionException. "
>>
>> I think it's OK to throw Harmony-implement subclass of the public 
>> superclass
>> for some cases? Do you think so?
>
> ---------------------------------------------------------------------
> 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
>
>

-- 
Richard Liang
China Software Development Lab, IBM 



---------------------------------------------------------------------
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


Mime
View raw message