× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Does anyone have any idea why I might be getting the following strange
behavior from JTopen's com.ibm.as400.access.ObjectList?

1. Successfully create an ObjectList and add the Extended Attribute as a
value to retrieve:

ObjectList objectList = new ObjectList(this.as400, "MYLIBRARY",
ObjectList.ALL, "*PGM");

objectList.addObjectAttributeToRetrieve(ObjectDescription.EXTENDED_ATTRIBUT
E);

2. Do this:

ObjectDescription[] ods = objectList.getObjects(-1, 0);

retrieves all objects in the list as specified,

3. But if do this with the exact same ObjectList:
ObjectDescription[] ods = objectList.getObjects(1, 1); // get
the next one
element

then this throws:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at
com.ibm.as400.access.ObjectList.getObjects(ObjectList.java:950)
...

I have Googled ArrayIndexOutOfBounds AND ObjectList and have not found
anything - suggesting I'm doing something crazy here!

However, the issue is something to do with the addObjectAttributeToRetrieve
method because if I comment that, the getObjects works just fine. Obviously
I can do a objectDescription.getValue() after reading from the ObjectList
but this involves another call out to the system (according to the
documentation).

Thanks in advance,

Chris Jewell
Korasoft Inc.
San Rafael, CA
mailto:jewellcj@xxxxxxxxxxxx
www.korasoft.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.