[kaffe] SPEC JVM98 Failure with current CVS Sources

Dalibor Topic robilad at yahoo.com
Sun Oct 6 14:17:08 PDT 2002

Hi Helmer,

--- Helmer Krämer <hkraemer at 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

More information about the kaffe mailing list