{"record":{"id":"df65b5436654eb8e","repo":"quarkusio/quarkus","slug":"unsupported-type-x","errorCode":null,"errorMessage":"Unsupported type: \" + x","messagePattern":"Unsupported type: \" \\+ x","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/RedisCommand.java","lineNumber":45,"sourceCode":"        if (x instanceof String) {\n            this.request.arg(x.toString());\n        } else if (x instanceof Double) {\n            this.request.arg((double) x);\n        } else if (x instanceof Long) {\n            this.request.arg((long) x);\n        } else if (x instanceof Integer) {\n            this.request.arg((int) x);\n        } else if (x instanceof Boolean) {\n            this.request.arg((boolean) x);\n        } else if (x instanceof byte[]) {\n            this.request.arg(Buffer.buffer((byte[]) x));\n        } else if (x instanceof RedisCommandExtraArguments) {\n            putArgs((RedisCommandExtraArguments) x);\n        } else if (x instanceof List) {\n            //noinspection rawtypes\n            putAll((List) x);\n        } else {\n            throw new UnsupportedOperationException(\"Unsupported type: \" + x);\n        }\n        return this;\n    }\n\n    public RedisCommand putAll(List<?> args) {\n        for (Object arg : args) {\n            put(arg);\n        }\n        return this;\n    }\n\n    public RedisCommand putAll(String[] args) {\n        for (Object arg : args) {\n            put(arg);\n        }\n        return this;\n    }\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/RedisCommand.java#L27-L63","documentation":"RedisCommand.put(Object) accepts only String, RedisCommandExtraArguments, or List arguments when building a Redis command. Any other type is rejected with UnsupportedOperationException at command-construction time, before anything is sent to the server.","triggerScenarios":"Passing an unsupported argument type (e.g. raw Integer, Map, custom object) to methods like _ftSugAdd, _bfmadd, _bfmexists, _bfinsert, _cmsIncrBy, or _cmsQuery through extra arguments.","commonSituations":"Passing numeric values unboxed instead of String.valueOf(...); passing a Map of options instead of a RedisCommandExtraArguments implementation; upgrading Quarkus and passing previously-tolerated types.","solutions":["Convert primitive/other arguments to String before passing","Implement RedisCommandExtraArguments for structured options","Pass a List of string args for multi-value arguments"],"exampleFix":"// before\ncommand._ftSugAdd(key, value, 1); // int passed directly\n// after\ncommand._ftSugAdd(key, value, String.valueOf(score));","handlingStrategy":"validation","validationCode":"if (!(x instanceof String || x instanceof RedisCommandExtraArguments || x instanceof List)) {\n    throw new IllegalArgumentException(\"arg must be String, RedisCommandExtraArguments or List: \" + x.getClass());\n}","typeGuard":"static boolean isSupportedArg(Object x) {\n    return x instanceof String || x instanceof RedisCommandExtraArguments || x instanceof List;\n}","tryCatchPattern":"try {\n    command._ftSugAdd(key, value, arg);\n} catch (UnsupportedOperationException e) {\n    log.error(\"Unsupported command argument type: \" + e.getMessage());\n}","preventionTips":["Convert numbers/enums to String with String.valueOf before passing","Implement RedisCommandExtraArguments for structured options","Check the RedisCommand.put supported types when adding new call sites"],"tags":["validation","redis","unsupported-type","command-builder"],"backgroundTag":"unsupported-argument-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}