What is the reason for prohibiting throwing a sub-class?

Every existing try... catch construction will work

Do we really want to convert all tests like
try {
   do something
   fail();
} catch (SomeException e) {
   //expected
}
to something like
try {
   do something
   fail();
} catch (SomeException e) {
   assertEquals(SomeException.class, e.getClass());
}

Thanks,
Mikhail

2006/5/11, Geir Magnusson Jr <[EMAIL PROTECTED]>:


George Harley wrote:

>
> * 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".

+1


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



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