{"record":{"id":"f0f77e7d1d488c01","repo":"flowable/flowable-engine","slug":"keylike-is-null-f0f77e","errorCode":null,"errorMessage":"keyLike is null","messagePattern":"keyLike is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/ChannelDefinitionQueryImpl.java","lineNumber":182,"sourceCode":"            throw new FlowableIllegalArgumentException(\"parentDeploymentId is null\");\n        }\n        this.parentDeploymentId = parentDeploymentId;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl channelDefinitionKey(String key) {\n        if (key == null) {\n            throw new FlowableIllegalArgumentException(\"key is null\");\n        }\n        this.key = key;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl channelDefinitionKeyLike(String keyLike) {\n        if (keyLike == null) {\n            throw new FlowableIllegalArgumentException(\"keyLike is null\");\n        }\n        this.keyLike = keyLike;\n        return this;\n    }\n    \n    @Override\n    public ChannelDefinitionQuery channelDefinitionKeyLikeIgnoreCase(String keyLikeIgnoreCase) {\n        if (keyLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"keyLikeIgnoreCase is null\");\n        }\n        this.keyLikeIgnoreCase = keyLikeIgnoreCase;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl channelVersion(Integer version) {\n        checkVersion(version);\n        this.version = version;","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/ChannelDefinitionQueryImpl.java#L164-L200","documentation":"ChannelDefinitionQueryImpl.channelDefinitionKeyLike() throws FlowableIllegalArgumentException when the keyLike pattern is null. Like-clause filters need a SQL LIKE pattern string; null is rejected eagerly by the builder so a malformed query is never constructed.","triggerScenarios":"Calling channelDefinitionQuery().channelDefinitionKeyLike(null), e.g. a pattern variable built from user input or config that is null.","commonSituations":"Building dynamic searches where the pattern expression (e.g. \"myChannel%\") was never assigned; passing an optional CLI/config value straight through without a default.","solutions":["Pass a non-null LIKE pattern, e.g. channelDefinitionKeyLike(\"prefix%\")","Use an empty-guard: default the pattern to a sensible value like \"%\" only when a wildcard search is truly intended","Only call channelDefinitionKeyLike when the pattern is non-null; omit the filter otherwise","For exact matching use channelDefinitionKey(key) instead"],"exampleFix":"// before\nString pattern = getPatternFromConfig(); // may be null\nquery.channelDefinitionKeyLike(pattern);\n// after\nif (pattern != null) {\n    query.channelDefinitionKeyLike(pattern);\n}","handlingStrategy":"validation","validationCode":"if (keyLike == null) {\n    throw new IllegalArgumentException(\"keyLike pattern is required\");\n}\nquery.channelDefinitionKeyLike(keyLike);","typeGuard":"boolean hasLikePattern(String pattern) {\n    return pattern != null && !pattern.isBlank();\n}","tryCatchPattern":"try {\n    query.channelDefinitionKeyLike(pattern);\n} catch (FlowableIllegalArgumentException e) {\n    logger.warn(\"Invalid keyLike pattern: {}\", e.getMessage());\n}","preventionTips":["Build LIKE patterns with explicit defaults (e.g. prefix + \"%\")","Escape user-supplied % and _ characters before passing patterns","Omit the like filter when no pattern is available","Use exact channelDefinitionKey when the full key is known"],"tags":["flowable","null-argument","query-builder","validation"],"backgroundTag":"null-argument","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"}