Chris Uppal wrote:
> Raffi wrote:
>
> > It works fine with the SUN wireless toolkit as well as the IBM J9 VM,
> > but throws an application error on a Motorola V551 phone. If I replace
> > "names.length" with the actual count of the record stores, it works
> > fine.
>
> I know nothing about J2ME, but from what you say, either the JVM is so badly
> screwed that it doesn't know how long an array is -- which seems unlikely -- or
> the Motorola implementation has entries in the array which are not legal
> arguments to deleteRecordStore(). I'd try putting check for null into the loop
> and see what happens.
>
> -- chris
The deleteRecordStore() method is not the problem since when I enter
the array length manually in the code, the class works fine. It's when
it tries to get the array length from the method that it throws the
application error.
I've already tried your suggestion and on the emulator both
array.length and a do-while loop with a null check give the same result
for the array length. I have since re-written the class to use a
do-while loop which does work on all the platforms available for me.
The only problem with a do-while loop is for it to exit, an array out
of bounds exception is thrown. I've hacked around that by ignoring the
error (I know - not a good idea but it's the only solution right now).
If anybody else has a suggestion please post it.
Thanks,
Raffi
|