{"record":{"id":"9f18199086202e51","repo":"flowable/flowable-engine","slug":"cannot-parse-list-index-property","errorCode":null,"errorMessage":"Cannot parse list index: ${property}","messagePattern":"Cannot parse list index: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/ListELResolver.java","lineNumber":154,"sourceCode":"\t\t\tthrow new PropertyNotFoundException(new ArrayIndexOutOfBoundsException(idx).getMessage());\n\t\t}\n\t}\n\n\tprivate static int coerce(Object property) {\n\t\tif (property instanceof Number) {\n\t\t\treturn ((Number) property).intValue();\n\t\t}\n\t\tif (property instanceof Character) {\n\t\t\treturn (Character) property;\n\t\t}\n\t\tif (property instanceof Boolean) {\n\t\t\treturn (Boolean) property ? 1 : 0;\n\t\t}\n\t\tif (property instanceof String) {\n\t\t\ttry {\n\t\t\t\treturn Integer.parseInt((String) property);\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Cannot parse list index: \" + property, e);\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalArgumentException(\"Cannot coerce property to list index: \" + property);\n\t}\n}\n","sourceCodeStart":136,"sourceCodeEnd":160,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/ListELResolver.java#L136-L160","documentation":"ListELResolver.coerce converts a String property into a list index; if Integer.parseInt fails it throws IllegalArgumentException 'Cannot parse list index' — the property string is not a valid integer index.","triggerScenarios":"EL list access with a non-numeric string index, e.g. ${myList['abc']}, where the property is a String but not parseable as an Integer.","commonSituations":"Using Map-style string keys on a List; variable substitution producing non-numeric index strings; copy-paste of map access syntax into list access.","solutions":["Use a numeric index for List access: ${myList[0]}","If string keys are needed, use a Map instead of a List so MapELResolver handles it","Validate/convert the index variable to an integer before building the expression"],"exampleFix":"// before\n${myList['first']}\n// after\n${myList[0]}","handlingStrategy":"validation","validationCode":"int idx = -1;\nif (property instanceof Integer) idx = (Integer) property;\nelse if (property instanceof String) idx = Integer.parseInt((String) property); // throws early, not via EL\nif (idx < 0 || idx >= list.size()) throw new IndexOutOfBoundsException(\"index=\" + idx);","typeGuard":"Integer asIndex(Object property) {\n  if (property instanceof Integer) return (Integer) property;\n  if (property instanceof String s && s.matches(\"\\\\d+\")) return Integer.valueOf(s);\n  return null;\n}","tryCatchPattern":"try {\n  resolver.getValue(ctx, list, property);\n} catch (IllegalArgumentException e) {\n  logger.warn(\"Bad list index expression: {}\", e.getMessage());\n}","preventionTips":["Use numeric indices for lists; string keys belong in Maps","Sanitize index variables before interpolating into expressions","Add expression validation at process deployment time"],"tags":["el","list","index","type-conversion"],"backgroundTag":"invalid-argument-format","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}