{"record":{"id":"5b627e30e6025506","repo":"flowable/flowable-engine","slug":"error-value-notype","errorCode":null,"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/ObjectValueExpression.java","lineNumber":50,"sourceCode":"\tprivate final TypeConverter converter;\n\tprivate final Object object;\n\tprivate final Class<?> type;\n\n\t/**\n\t * Wrap an object into a value expression.\n\t * @param converter type converter\n\t * @param object the object to wrap\n\t * @param type the expected type this object will be coerced in {@link #getValue(ELContext)}.\n\t */\n\tpublic ObjectValueExpression(TypeConverter converter, Object object, Class<?> type) {\n\t\tsuper();\n\n\t\tthis.converter = converter;\n\t\tthis.object = object;\n\t\tthis.type = type;\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\t/**\n\t * Two object value expressions are equal if and only if their wrapped objects are equal.\n\t */\n\t@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (obj != null && obj.getClass() == getClass()) {\n\t\t\tObjectValueExpression other = (ObjectValueExpression)obj;\n\t\t\tif (type != other.type) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn object == other.object || object != null && object.equals(other.object);\n\t\t}\n\t\treturn false;\n\t}\n","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/ObjectValueExpression.java#L32-L68","documentation":"ObjectValueExpression wraps a plain object plus the expected type for a deferred EL expression. The constructor throws a NullPointerException (with message 'error.value.notype') when the expected type parameter is null, because a wrapped object expression must declare the type it will coerce to.","triggerScenarios":"Calling new ObjectValueExpression(converter, object, type) with type == null.","commonSituations":"Frameworks integrating the EL implementation (e.g. custom ValueExpression factories, CDI/JSF-like integration) passing a null expected type obtained from an untyped API or an unset generic type.","solutions":["Pass a concrete Class object as the expected type, e.g. String.class or Object.class if the type is unknown.","If the expected type is computed, default it to Object.class when null before constructing.","Inspect the caller supplying the type (often a framework bridge) and fix where the type is lost."],"exampleFix":"// before\nnew ObjectValueExpression(converter, object, null)\n// after\nnew ObjectValueExpression(converter, object, expectedType != null ? expectedType : Object.class)","handlingStrategy":"validation","validationCode":"if (expectedType == null) {\n    throw new IllegalArgumentException(\"expected type required for ObjectValueExpression\");\n}\nnew ObjectValueExpression(converter, object, expectedType);","typeGuard":"boolean validObjectValueExpressionArgs(Object object, Class<?> type) {\n    return type != null;\n}","tryCatchPattern":"try {\n    new ObjectValueExpression(converter, object, type);\n} catch (NullPointerException e) {\n    // type was null; supply a default\n}","preventionTips":["Always pass a non-null Class as the expected type; default to Object.class when unknown.","Validate framework-bridge code that derives the type from generics/reflection.","Add an assert or precondition before constructing wrapped-object expressions."],"tags":["el","null-check","deferred-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"}