{"record":{"id":"18d88720b2261135","repo":"flowable/flowable-engine","slug":"propertynotfoundexception","errorCode":null,"errorMessage":"PropertyNotFoundException","messagePattern":"PropertyNotFoundException","errorType":"exception","errorClass":"PropertyNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/ArrayELResolver.java","lineNumber":306,"sourceCode":"\t@Override\n\tpublic Class<?> getCommonPropertyType(ELContext context, Object base) {\n\t\treturn isResolvable(base) ? Integer.class : null;\n\t}\n\n\t/**\n\t * Test whether the given base should be resolved by this ELResolver.\n\t * \n\t * @param base\n\t *            The bean to analyze.\n\t * @return base != null && base.getClass().isArray()\n\t */\n\tprivate final boolean isResolvable(Object base) {\n\t\treturn base != null && base.getClass().isArray();\n\t}\n\n\tprivate static void checkBounds(Object base, int idx) {\n\t\tif (idx < 0 || idx >= Array.getLength(base)) {\n\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 array index: \" + property, e);","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/ArrayELResolver.java#L288-L324","documentation":"ArrayELResolver.checkBounds throws PropertyNotFoundException when an EL expression indexes into an array with an out-of-range index (negative or >= array length). This is the EL resolver's way of surfacing an ArrayIndexOutOfBoundsException as a standard EL exception during getType, setValue, or isReadOnly resolution.","triggerScenarios":"Evaluating an EL expression like ${myArray[5]} where myArray has fewer than 6 elements, or a negative index such as ${myArray[-1]}, or a coerced String index like 'idx' that resolves outside 0..length-1.","commonSituations":"Expressions referencing array positions computed from loop counters or list sizes in process/BPMN expressions; off-by-one indexing; arrays shrunk by refactoring while templates still reference old fixed indexes.","solutions":["Log/inspect the array length at evaluation time and fix the expression's index to be within 0..length-1.","Guard the expression with a bounds check, e.g. ${myArray.length > 5 ? myArray[5] : ''}, or use a List instead of an array (ListELResolver returns null for out-of-range instead of throwing).","If the index comes from a variable, validate/clamp it before evaluation."],"exampleFix":"// before\nString first = (String) engine.eval(\"${items[0]}\", itemsIsEmptyContext);\n// after\nString expr = items.length > 0 ? \"${items[0]}\" : \"${null}\"; // or guard in the EL expression itself","handlingStrategy":"validation","validationCode":"if (idx < 0 || idx >= arr.length) throw new IllegalArgumentException(\"index \" + idx + \" out of bounds for array of length \" + arr.length);","typeGuard":null,"tryCatchPattern":"try { value = resolver.getValue(ctx, base, idx); } catch (PropertyNotFoundException e) { /* fallback to default */ }","preventionTips":["Bounds-check indexes before building EL expressions","Prefer List over array when indexes may be dynamic (ListELResolver tolerates out-of-range)","Guard with ${arr.length > n ? arr[n] : fallback}"],"tags":["el","array","index-out-of-bounds","expression-language"],"backgroundTag":"index-out-of-bounds","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}