{"record":{"id":"52abeb68da61c1c8","repo":"flowable/flowable-engine","slug":"error-method-notypes","errorCode":"error.method.notypes","errorMessage":"error.method.notypes","messagePattern":"error\\.method\\.notypes","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/TreeMethodExpression.java","lineNumber":95,"sourceCode":"\n\t\tthis.builder = store.getBuilder();\n\t\tthis.bindings = tree.bind(functions, variables, converter);\n\t\tthis.expr = expr;\n\t\tthis.type = returnType;\n\t\tthis.types = paramTypes;\n\t\tthis.node = tree.getRoot();\n\t\tthis.deferred = tree.isDeferred();\n\n\t\tif (node.isLiteralText()) {\n\t\t\tif (returnType == void.class || returnType == Void.class) {\n\t\t\t\tthrow new ELException(LocalMessages.get(\"error.method.literal.void\", expr));\n\t\t\t}\n\t\t} else if (!node.isMethodInvocation()) {\n\t\t\tif (!node.isLeftValue()) {\n\t\t\t\tthrow new ELException(LocalMessages.get(\"error.method.invalid\", expr));\n\t\t\t}\n\t\t\tif (paramTypes == null) {\n\t\t\t\tthrow new NullPointerException(LocalMessages.get(\"error.method.notypes\")); // EL specification requires NPE\n\t\t\t}\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  /**\n   * Evaluates the expression and answers information about the method\n   * @param context used to resolve properties (<code>base.property</code> and <code>base[property]</code>)\n   * @return method information or <code>null</code> for literal expressions\n   * @throws ELException if evaluation fails (e.g. suitable method not found)\n   */\n\t@Override","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/TreeMethodExpression.java#L77-L113","documentation":"Per the EL specification, constructing a TreeMethodExpression with a non-literal, non-method-invocation left-value expression requires an explicit parameter types array. When paramTypes is null in that case, the constructor throws a NullPointerException with message 'error.method.notypes'.","triggerScenarios":"new TreeMethodExpression(..., expr, null, returnType) where expr is an l-value (e.g. '#{bean.property}') rather than a method invocation.","commonSituations":"Binding an l-value expression as a method expression (e.g. property getter used as an action) without declaring paramTypes; API misuse where the caller assumed paramTypes is optional.","solutions":["Provide a paramTypes array, e.g. new Class<?>[0] for a no-arg invocation.","Use a genuine method-invocation expression ('#{bean.method()}') so paramTypes is not required.","If a value was intended, switch to TreeValueExpression."],"exampleFix":"// before\nnew TreeMethodExpression(store, ctx, fns, vars, \"#{bean.prop}\", null, Object.class)\n// after\nnew TreeMethodExpression(store, ctx, fns, vars, \"#{bean.prop}\", new Class<?>[0], Object.class)","handlingStrategy":"validation","validationCode":"if (paramTypes == null && !expr.contains(\"(\")) {\n    paramTypes = new Class<?>[0]; // l-value method expression requires explicit param types\n}","typeGuard":"boolean requiresParamTypes(String expr, Class<?>[] paramTypes) {\n    return paramTypes == null && expr.startsWith(\"#{\") && !expr.contains(\"(\");\n}","tryCatchPattern":"try {\n    TreeMethodExpression m = new TreeMethodExpression(store, ctx, fns, vars, expr, paramTypes, returnType);\n} catch (NullPointerException e) {\n    // paramTypes was null for an l-value expression; supply new Class<?>[0]\n}","preventionTips":["Always supply paramTypes when constructing TreeMethodExpression from l-value expressions.","Use new Class<?>[0] for parameterless invocations.","Prefer explicit method-invocation expressions where paramTypes are unnecessary."],"tags":["el","method-expression","null-check","flowable"],"backgroundTag":"missing-required-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"}