{"record":{"id":"fce5bbb1e43caa76","repo":"flowable/flowable-engine","slug":"unable-to-add-an-object-of-type-to-an-array-of","errorCode":null,"errorMessage":"Unable to add an object of type '' to an array of objects of type ''","messagePattern":"Unable to add an object of type '' to an array of objects of type ''","errorType":"exception","errorClass":"ClassCastException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/ArrayELResolver.java","lineNumber":221,"sourceCode":"\t */\n\t@Override\n\tpublic void setValue(ELContext context, Object base, Object property, Object value) {\n\t\tObjects.requireNonNull(context, \"context is null\");\n\n\t\tif (isResolvable(base)) {\n\t\t\tcontext.setPropertyResolved(base, property);\n\n\t\t\tif (LENGTH_PROPERTY_NAME.equals(property)) {\n\t\t\t\tthrow new PropertyNotWritableException(\"Property '\" + property + \"' is not writable on '\" + base.getClass().getName() + \"'\");\n\t\t\t}\n\n\t\t\tif (readOnly) {\n\t\t\t\tthrow new PropertyNotWritableException(\"resolver is read-only\");\n\t\t\t}\n\t\t\tint idx = coerce(property);\n\t\t\tcheckBounds(base, idx);\n\t\t\tif (value != null && !Util.isAssignableFrom(value.getClass(), base.getClass().getComponentType())) {\n\t\t\t\tthrow new ClassCastException(\n\t\t\t\t\t\t\"Unable to add an object of type '\" + value.getClass().getName() + \"' to an array of objects of type '\" + base.getClass()\n\t\t\t\t\t\t\t\t.getComponentType().getName() + \"'\");\n\t\t\t}\n\t\t\tArray.set(base, idx, value);\n\t\t}\n\t}\n\n\t/**\n\t * If the base object is a Java language array, returns whether a call to {@link #setValue} will always fail.\n\t *\n\t * <p>\n\t * If the base is a Java language array, the <code>propertyResolved</code> property of the <code>ELContext</code> object\n\t * must be set to <code>true</code> by this resolver, before returning. If this property is not <code>true</code> after\n\t * this method is called, the caller should ignore the return value.\n\t * </p>\n\t *\n\t * <p>\n\t * If this resolver was constructed in read-only mode or the property is the case sensitive string {@code length},","sourceCodeStart":203,"sourceCodeEnd":239,"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#L203-L239","documentation":"Type guard in ArrayELResolver.setValue: the value being assigned to an array slot is not assignment-compatible with the array's component type (or cannot be coerced), so storing it would corrupt the array.","triggerScenarios":"Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/ArrayELResolver.java:221 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Assign a value of the array's component type (or a coercible one)","Widen the array type or convert the value explicitly before assignment"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}