[kaffe] SPEC JVM98 Failure with current CVS Sources
Dalibor Topic
robilad@yahoo.com
Sun, 6 Oct 2002 14:17:08 -0700 (PDT)
Hi Helmer,
--- Helmer Krämer <hkraemer@freenet.de> wrote:
> I guess the problem is that System.arraycopy
> doesn't verify that dst and src are both !=
> null before figuring out how to copy the array.
>
> According to the api spec, System.arraycopy is
> supposed to throw a NullPointerException when
> either src or dst are null, so something like
> the attached patch should make kaffe pass the
> test.
Your patch adds an explicit null pointer check. Here
is an implicit version: rewrite the throw statement as
throw new ArrayStoreEception("not arrays. source type
: " + src.getClass().getName() + " destination type :
" + dst.getClass().getName();
and remove the "else {" and "}" bits around it.
this patch improves the exception message, and
implicitly throws a null poiter exception when src or
dst is null. I believe that the implicit version is
faster in most cases. What do you think?
best regards,
dalibor topic
__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com