{"record":{"id":"36c69b473c0ab3d5","repo":"flowable/flowable-engine","slug":"error-value-notype-36c69b","errorCode":"error.value.notype","errorMessage":"error.value.notype","messagePattern":"error\\.value\\.notype","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/TreeValueExpression.java","lineNumber":80,"sourceCode":"\t * @param functions the function mapper used to bind functions\n\t * @param variables the variable mapper used to bind variables\n\t * @param expr the expression string\n\t * @param type the expected type (may be <code>null</code>)\n\t */\n\tpublic TreeValueExpression(TreeStore store, FunctionMapper functions, VariableMapper variables, TypeConverter converter, String expr, Class<?> type) {\n\t\tsuper();\n\n\t\tTree tree = store.get(expr);\n\n\t\tthis.builder = store.getBuilder();\n\t\tthis.bindings = tree.bind(functions, variables, converter);\n\t\tthis.expr = expr;\n\t\tthis.type = type;\n\t\tthis.node = tree.getRoot();\n\t\tthis.deferred = tree.isDeferred();\n\t\t\n\t\tif (type == null) {\n\t\t\tthrow new NullPointerException(LocalMessages.get(\"error.value.notype\"));\n\t\t}\n\t}\n\n\tprivate String getStructuralId() {\n\t\tif (structure == null) {\n\t\t\tstructure = node.getStructuralId(bindings);\n\t\t}\n\t\treturn structure;\n\t}\n\t\n\t@Override\n\tpublic Class<?> getExpectedType() {\n\t\treturn type;\n\t}\n\n\t@Override\n\tpublic String getExpressionString() {\n\t\treturn expr;","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/TreeValueExpression.java#L62-L98","documentation":"TreeValueExpression must know the expected type the expression result will be coerced to. The constructor throws a NullPointerException (message 'error.value.notype') when the type parameter is null, as required by the EL specification.","triggerScenarios":"new TreeValueExpression(store, context, functions, variables, expr, null).","commonSituations":"Passing a null expected type from a generic helper method or when the target type is derived from reflection that failed; framework integrations that dropped the type information.","solutions":["Pass an explicit Class as the expected type, e.g. String.class or Object.class if coercion is unrestricted.","Default computed types to Object.class when unknown before constructing the expression.","Trace where the type comes from and fix the supplier that returned null."],"exampleFix":"// before\nnew TreeValueExpression(store, ctx, fns, vars, \"#{bean.name}\", null)\n// after\nnew TreeValueExpression(store, ctx, fns, vars, \"#{bean.name}\", String.class)","handlingStrategy":"validation","validationCode":"if (expectedType == null) {\n    throw new IllegalArgumentException(\"TreeValueExpression requires a non-null expected type\");\n}","typeGuard":"boolean validTypeArg(Class<?> type) { return type != null; }","tryCatchPattern":"try {\n    TreeValueExpression v = new TreeValueExpression(store, ctx, fns, vars, expr, type);\n} catch (NullPointerException e) {\n    // type was null; pass Object.class or the concrete expected type\n}","preventionTips":["Always pass a non-null expected type; Object.class is a safe default.","Check helper methods that resolve types via reflection and default nulls to Object.class.","Validate expression bindings configuration for missing type info."],"tags":["el","null-check","value-expression","flowable"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}