{"record":{"id":"f4f8ce92fb47e1ae","repo":"skylot/jadx","slug":"is-unknown-for-parameter-possible-values","errorCode":null,"errorMessage":"'{}' is unknown for parameter {}, possible values are {}","messagePattern":"'(.+?)' is unknown for parameter (.+?), possible values are (.+?)","errorType":"validation","errorClass":"JadxArgsValidateException","httpStatus":null,"severity":"error","filePath":"jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java","lineNumber":977,"sourceCode":"\n\t\tRenameConverter(String paramName) {\n\t\t\tthis.paramName = paramName;\n\t\t}\n\n\t\t@Override\n\t\tpublic Set<RenameEnum> convert(String value) {\n\t\t\tif (value.equalsIgnoreCase(\"NONE\")) {\n\t\t\t\treturn EnumSet.noneOf(RenameEnum.class);\n\t\t\t}\n\t\t\tif (value.equalsIgnoreCase(\"ALL\")) {\n\t\t\t\treturn EnumSet.allOf(RenameEnum.class);\n\t\t\t}\n\t\t\tSet<RenameEnum> set = EnumSet.noneOf(RenameEnum.class);\n\t\t\tfor (String s : value.split(\",\")) {\n\t\t\t\ttry {\n\t\t\t\t\tset.add(RenameEnum.valueOf(s.trim().toUpperCase(Locale.ROOT)));\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new JadxArgsValidateException(\n\t\t\t\t\t\t\t'\\'' + s + \"' is unknown for parameter \" + paramName\n\t\t\t\t\t\t\t\t\t+ \", possible values are \" + enumValuesString(RenameEnum.values()));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn set;\n\t\t}\n\t}\n\n\tpublic static class CommentsLevelConverter extends BaseEnumConverter<CommentsLevel> {\n\t\tpublic CommentsLevelConverter() {\n\t\t\tsuper(CommentsLevel::valueOf, CommentsLevel::values);\n\t\t}\n\t}\n\n\tpublic static class UseKotlinMethodsForVarNamesConverter extends BaseEnumConverter<UseKotlinMethodsForVarNames> {\n\t\tpublic UseKotlinMethodsForVarNamesConverter() {\n\t\t\tsuper(UseKotlinMethodsForVarNames::valueOf, UseKotlinMethodsForVarNames::values);\n\t\t}","sourceCodeStart":959,"sourceCodeEnd":995,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java#L959-L995","documentation":"Thrown by DebugController.checkType(ArgType, Object value) immediately before sending a new value to the device via SmaliDebugger.setValueSync. It enforces that the Java object supplied matches the declared ArgType exactly (INT->Integer, STRING->String, LONG->Long, FLOAT->Float, DOUBLE->Double, OBJECT->Long where the Long is an object id). A mismatch means the caller built an inconsistent (type, value) pair, which would corrupt the JDWP write, so it is rejected up front.","triggerScenarios":"modifyValueInternal(valNode, type, value) is invoked with a value whose Java class does not pair with the ArgType, e.g. passing an Integer for ArgType.LONG, a String for ArgType.OBJECT, or a Long for ArgType.DOUBLE. The check runs before the synchronous set so the device never receives a malformed value.","commonSituations":"UI passing a parsed number literal as Integer while the register is ArgType.LONG; passing a parsed hex object id as String instead of Long; changes to the value-edit dialog that lost type coercion. This is a programming precondition failure in the GUI/controller layer, not an environment issue.","solutions":["Ensure the value object is coerced to the exact Java type matching the ArgType before calling modifyValueInternal (Integer for INT, Long for LONG/OBJECT, Float for FLOAT, Double for DOUBLE, String for STRING).","Validate the (type, value) pair in the edit dialog before dispatching the modify request.","If extending the editor to new types, update checkType's predicate list in lockstep.","Treat the exception as a bug report: log the ArgType and value class and fix the producer."],"exampleFix":"// before\nprivate void checkType(ArgType type, Object value) {\n    if (!(type == ArgType.INT && value instanceof Integer)\n            && !(type == ArgType.STRING && value instanceof String)\n            /* ... */\n            && !(type == ArgType.OBJECT && value instanceof Long)) {\n        throw new JadxRuntimeException(\"Type must be one of int, long, float, double, String or Object.\");\n    }\n}\n\n// after (coerce the parsed value before this check)\nObject coerced = coerceToType(parsedText, type); // returns Integer/Long/Float/Double/String as needed\ncheckType(type, coerced);\ndebugger.setValueSync(regNum, castType(type), coerced, threadId, frameId);","handlingStrategy":"type-guard","validationCode":"// Coerce the user-entered value to the exact Java type for the ArgType before modifyValueInternal:\nObject coerce(ArgType type, String text) {\n    if (type == ArgType.INT)    return Integer.decode(text);\n    if (type == ArgType.LONG)   return Long.decode(text);\n    if (type == ArgType.FLOAT)  return Float.valueOf(text);\n    if (type == ArgType.DOUBLE) return Double.valueOf(text);\n    if (type == ArgType.STRING) return text;\n    if (type == ArgType.OBJECT) return Long.decode(text); // object id\n    throw new IllegalArgumentException(\"Unsupported edit type: \" + type);\n}","typeGuard":"static boolean valueMatchesType(ArgType type, Object value) {\n    return (type == ArgType.INT && value instanceof Integer)\n        || (type == ArgType.STRING && value instanceof String)\n        || (type == ArgType.LONG && value instanceof Long)\n        || (type == ArgType.FLOAT && value instanceof Float)\n        || (type == ArgType.DOUBLE && value instanceof Double)\n        || (type == ArgType.OBJECT && value instanceof Long);\n}","tryCatchPattern":"try {\n    checkType(type, value);\n    modifyValueInternal(valNode, castType(type), value);\n} catch (JadxRuntimeException e) {\n    if (e.getMessage().startsWith(\"Type must be one of\")) {\n        LOG.warn(\"Rejected value {} for type {}\", value == null ? null : value.getClass(), type);\n        showError(\"Value does not match register type\");\n        return false;\n    }\n    throw e;\n}","preventionTips":["Always coerce parsed edit text to the Java type that pairs with the ArgType before dispatching.","Remember OBJECT expects a Long object id, not a String.","Keep checkType's predicate list synchronized with castType's handled set.","Validate in the edit dialog so invalid (type, value) pairs never reach checkType."],"tags":["debugger","type-validation","value-modify","registers"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}