Java API - index out of bounds error on simple call

Discussion created by SamahSohrab607228 on Mar 23, 2018
Latest reply on Mar 24, 2018 by SamahSohrab607228
I'm having a strange issue with the Java API calling to get JobHeaders. 
Here is my code
OpenObject openObject = new OpenObject(new UC4ObjectName(jobName), true, true)
UC4Object uc4_object = openObject.getUC4Object()

connectionService.sendRequestAndWait(new CloseObject(uc4_object))

and here is my stack trace
java.lang.IndexOutOfBoundsException: Index: 12, Size: 4
        at java.util.ArrayList.rangeCheck(
        at java.util.ArrayList.get(
        at com.uc4.api.objects.WorkflowTasks.getTask(
        at com.uc4.api.objects.WorkflowTasks.<init>(
        at com.uc4.api.objects.JobPlan.loadContent(
        at com.uc4.api.objects.UC4Object.load(
        at com.uc4.communication.requests.OpenObject.handleContent(
        at com.uc4.communication.requests.XMLRequest.handleResponse(
        at com.uc4.communication.Connection.sendRequestAndWait(

This function works for hundreds/thousands of other jobs/workflows, but this workflow is giving this error. The header tab is valid when you open it via the client, and the workflow is running without issue.