String index out of range: -1 error when to use Query.setCriteria

(Doc ID 2262593.1)

Last updated on MAY 05, 2017

Applies to:

Oracle Agile PLM Framework - Version and later
Information in this document applies to any platform.


On : version, Searches

When attempting to use IQuery to search Parts,
the following error occurs.

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(
at com.agile.apibean.objects.query.Query.compareAttributeNames(
at com.agile.apibean.objects.query.Query.getSearchableAttribute(
at com.agile.apibean.objects.query.Query.apply(
at com.agile.apibean.objects.query.Query.apply(
at com.agile.apibean.objects.query.Query.apply(
at com.agile.apibean.objects.query.Query.setCriteria(
at com.agile.apibean.objects.query.Query.setCriteria(
at com.agile.apibean.objects.QueryOperations.setCriteria(
at com.agile.apibean.APISessionBean.setCriteria(

The issue can be reproduced at will with the following steps:
1. Code with samples:
IAgileSession session = fac.createSession(map);
session.setDateFormats(new DateFormat[] {new SimpleDateFormat("MM/dd/yyyy")});
IQuery query = (IQuery)session.createObject(IQuery.OBJECT_TYPE, ItemConstants.CLASS_PARTS_CLASS);
"[Title Block.Part Type] in ('Part-EE Component') and " +
"[Change History.Rev] in ('1A') and " +
"[Change History.Rel Date] Equal to (%0)",new String[] {Query_STR});
ITable tabs = query.execute();
Iterator it = tabs.iterator();
while (it.hasNext()){
   IRow row = (IRow);

2. Run it

3. Will see code fails and error


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms