I have different opinion there.
This exception is quite rare in this function, isn't it? If so, we can
optimize common pass by removing explicit checks. It could be
performance beneficial.

There other point here, internal exception can be lazy exception or
even be optimized out. On DRLVM IMHO if using here arraycopy the
exception will be created with lazy stack, which should be much faster
then normal exception.

If we would had no arraycopy (native function) there, but some other
(pure java) function, it could be even possible for JIT to inline and
optimize out creation of internal exception.

In other words it is not so obvious from performance perspective to
have one solution or another. I would personaly prefer implicit check
here.
--
Ivan

2006/5/12, Mikhail Fursov <[EMAIL PROTECTED]>:
Note that this is not only "beautiful" but also performance oriented way ->
do not create extra rethrows if it's possible

On 5/12/06, Semukhina, Elena V <[EMAIL PROTECTED]> wrote:
>
> To have a "beautiful" fix, why don't you just write
>
>
>
> System.arraycopy(data, start, value, 0, count);
>
>
>
> without trying to catch any exception and rethrow another one?
> ArrayIndexOutOfBoundsException, if happened, would be thrown by
> System.arraycopy().
>
>
>
>


--
Mikhail Fursov




--
Ivan
Intel Middleware Products Division

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