Don't be so quick to blame HotSpot here!!  This fails with Karen's files on Sun
win32 1.2.2 both classic and HotSpot and also on IBM Win32 1.1.8.

Look at DeferredDocumentImpl.java.  When you call binarySearch from line 819,
you're supplying...

values[] = fIdElement = int[128]
start = 0
end = fIdCount (which is 128 at this point having been incremented on line 1015
after adding the last value to the array)

In the while loop in line 1377 you allow start to be less than or EQUAL TO end.
If the target is greater than the largest value in the array you will have a
condition where start=end=middle=128 and that's not a valid index in a array of
128 elements.

Either call binarySearch with fIdCount-1 or change start<=end to start<end.  I
don't use any of the deferred stuff so I'm reluctant to fix this myself.

george

-----Original Message-----
From: Mike Pogue [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 02, 2000 4:53 PM
To: [EMAIL PROTECTED]
Subject: Re: BUG java.lang.ArrayIndexOutOfBoundsException: 128


You should dump Hotspot.  It has problems running correct Java class
files, that
other VM's (Sun Classic JVM, IBM JVM, etc.) have no trouble running.

At least, that is our experience with Hotspot.

Mike

Karen Schuchardt wrote:
>
> This is in reference to a previous mail under the same subject.  Please
> refer to it for the full
> example.
>
> I am using the vanilla Java 1.2 version (not 1.2.x) and xerces 1.0.1
> under Solaris 2.6.
>
> Should I be upgrading to a newer version of java?
>
> Thanks,
> karen
>
>      Let me take a wild guess... You are using Java 1.2.2 with
>      HotSpot.
>      Am I right? A lot of people are reporting erroneous array
>      index
>      expections because HotSpot is buggy. If you are using HotSpot,
>
>      please turn it off and try again. If your problem persists,
>      we'll
>      take a look at it.
>
>      P.S. Always include the version of the parser in question, as
>      well
>           as information about your JDK level, OS platform, etc.
>
>      --
>      Andy Clark * IBM, JTC - Silicon Valley * [EMAIL PROTECTED]

Reply via email to