{"record":{"id":"0be1a9f7e9e2c423","repo":"flowable/flowable-engine","slug":"keylikeignorecase-is-null","errorCode":null,"errorMessage":"keyLikeIgnoreCase is null","messagePattern":"keyLikeIgnoreCase 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":191,"sourceCode":"            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;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl channelVersionGreaterThan(Integer channelVersion) {\n        checkVersion(channelVersion);\n        this.versionGt = channelVersion;\n        return this;\n    }","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/ChannelDefinitionQueryImpl.java#L173-L209","documentation":"ChannelDefinitionQuery.channelDefinitionKeyLikeIgnoreCase() throws FlowableIllegalArgumentException when the case-insensitive LIKE pattern is null. The builder validates the argument up front; a null pattern cannot form a valid case-insensitive LIKE filter, so the query construction fails immediately.","triggerScenarios":"Calling channelDefinitionQuery().channelDefinitionKeyLikeIgnoreCase(null), typically with a pattern read from nullable user input, a search box value, or configuration.","commonSituations":"Implementing case-insensitive channel search where the search term was never set; frameworks injecting null when the request parameter is absent.","solutions":["Pass a non-null pattern string (wildcards % and _ are honored by the underlying LIKE)","Guard the call: only invoke channelDefinitionKeyLikeIgnoreCase when the term is non-null","Omit the filter entirely when there is no search term instead of passing null","Normalize an empty search input to a wildcard or drop the filter before building the query"],"exampleFix":"// before\nquery.channelDefinitionKeyLikeIgnoreCase(searchTerm); // searchTerm may be null\n// after\nif (searchTerm != null && !searchTerm.isEmpty()) {\n    query.channelDefinitionKeyLikeIgnoreCase(\"%\" + searchTerm.toLowerCase() + \"%\");\n}","handlingStrategy":"validation","validationCode":"if (keyLikeIgnoreCase == null || keyLikeIgnoreCase.isEmpty()) {\n    throw new IllegalArgumentException(\"search term is required\");\n}\nquery.channelDefinitionKeyLikeIgnoreCase(\"%\" + keyLikeIgnoreCase + \"%\");","typeGuard":"boolean hasSearchTerm(String term) {\n    return term != null && !term.isBlank();\n}","tryCatchPattern":"try {\n    query.channelDefinitionKeyLikeIgnoreCase(term);\n} catch (FlowableIllegalArgumentException e) {\n    logger.warn(\"Invalid case-insensitive key pattern: {}\", e.getMessage());\n}","preventionTips":["Default absent search input to 'no filter' rather than null","Normalize search terms (trim/lowercase) before wrapping in wildcards","Validate request parameters upstream so nulls never reach the query builder","Drop the filter instead of calling it with null when the term is optional"],"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"}