{"record":{"id":"d1ec411bb62ef038","repo":"quarkusio/quarkus","slug":"name-must-not-be-blank","errorCode":null,"errorMessage":"`\" + name + \"` must not be blank","messagePattern":"`\" \\+ name \\+ \"` must not be blank","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/Validation.java","lineNumber":78,"sourceCode":"        return array;\n    }\n\n    public static byte[] notNullOrEmpty(byte[] array, String name) {\n        if (array == null) {\n            throw new IllegalArgumentException(\"`\" + name + \"` must not be `null`\");\n        }\n        if (array.length == 0) {\n            throw new IllegalArgumentException(\"`\" + name + \"` must not be empty\");\n        }\n        return array;\n    }\n\n    public static String notNullOrBlank(String v, String name) {\n        if (v == null) {\n            throw new IllegalArgumentException(\"`\" + name + \"` must not be `null`\");\n        }\n        if (v.isBlank()) {\n            throw new IllegalArgumentException(\"`\" + name + \"` must not be blank\");\n        }\n        return v;\n    }\n\n    static <X> void notNullOrEmpty(Collection<X> col, String name) {\n        if (col == null) {\n            throw new IllegalArgumentException(\"`\" + name + \"` must not be `null`\");\n        }\n        if (col.size() == 0) {\n            throw new IllegalArgumentException(\"`\" + name + \"` must not be empty\");\n        }\n    }\n\n    static <K, V> void notNullOrEmpty(Map<K, V> map, String name) {\n        if (map == null) {\n            throw new IllegalArgumentException(\"`\" + name + \"` must not be `null`\");\n        }\n        if (map.size() == 0) {","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/Validation.java#L60-L96","documentation":"Validation utility precondition check: a String argument was non-null but blank (only whitespace, e.g. \"\" or \"   \"). The Quarkus Redis client rejects blank keys/field names because they almost always indicate a construction bug and are invalid Redis key semantics.","triggerScenarios":"Passing \"\" or whitespace strings as key, field, or member — commonly from String.trim() results, empty environment/config values, concatenations where a variable part is empty.","commonSituations":"Empty quarkus.redis.<name> key-prefix config property; empty tenant/segment variable in a composite key like prefix + ':' + tenant; HTTP request with missing parameter defaulting to empty string.","solutions":["Validate that the composed key is non-blank before calling Redis (fail fast in your own code with a clear message)","Give the config property a non-empty value or a sensible programmatic default","Trim/normalize inputs and reject blank ones at your API boundary"],"exampleFix":"// before\nString key = prefix + \":user:\" + userId; // prefix is \"\"\nredis.value().get(key);\n// after\nif (prefix == null || prefix.isBlank()) {\n    throw new IllegalStateException(\"Key prefix must be configured\");\n}\nString key = prefix + \":user:\" + userId;\nredis.value().get(key);","handlingStrategy":"validation","validationCode":"String normalized = key == null ? null : key.strip(); if (normalized == null || normalized.isEmpty()) { throw new IllegalArgumentException(\"key must not be blank\"); }","typeGuard":"boolean isNotBlank(String s) { return s != null && !s.isBlank(); }","tryCatchPattern":"try { redis.value().get(key); } catch (IllegalArgumentException e) { log.error(\"Blank Redis key: {}\", e.getMessage()); throw new InvalidCacheKeyException(e.getMessage(), e); }","preventionTips":["Strip and validate every variable part of composite keys","Fail fast when config values that form key parts are empty","Reject blank user input before it reaches cache logic"],"tags":["redis","quarkus","argument-validation","blank-string"],"backgroundTag":"blank-string-argument","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}