harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko" <mloe...@gmail.com>
Subject Re: NullPointerException
Date Fri, 17 Mar 2006 09:11:30 GMT
Hi Karan,

Actually there is a number of conditions that affect final case-by-case made

1. The spec might say
    a) that SomeException (SE) is thrown in case of null arg
    b) that SE is thrown in case of "invalid" arg
    c) nothing about wrong args

2. The class and method under consideration might pass argument and control
to some user's or third-party class (like some handler or crypto algorithm) and
RI's NPE happens originally there. In this case we should study the
spec for that
class, implications of null arguments in that class and case-by-case decide.

I think being compatible with RI is by-default decision, and in
the majority of cases is the right decision to take.

BTW, explicit check of an arg for null would unnoticably slow down execution
in case of non-null argument but would siginificantly speed it up in
case of null.
Once again, decision is to be made case-by-case


View raw message