{"record":{"id":"e936a3cc85192aeb","repo":"skylot/jadx","slug":"unknown-condition-mode","errorCode":null,"errorMessage":"Unknown condition mode: ","messagePattern":"Unknown condition mode: ","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/codegen/ConditionGen.java","lineNumber":74,"sourceCode":"\t\t\tcase COMPARE:\n\t\t\t\taddCompare(code, stack, condition.getCompare());\n\t\t\t\tbreak;\n\n\t\t\tcase TERNARY:\n\t\t\t\taddTernary(code, stack, condition);\n\t\t\t\tbreak;\n\n\t\t\tcase NOT:\n\t\t\t\taddNot(code, stack, condition);\n\t\t\t\tbreak;\n\n\t\t\tcase AND:\n\t\t\tcase OR:\n\t\t\t\taddAndOr(code, stack, condition);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new JadxRuntimeException(\"Unknown condition mode: \" + condition.getMode());\n\t\t}\n\t\tstack.pop();\n\t}\n\n\tprivate void wrap(ICodeWriter code, CondStack stack, IfCondition cond) throws CodegenException {\n\t\tboolean wrap = isWrapNeeded(cond);\n\t\tif (wrap) {\n\t\t\tcode.add('(');\n\t\t}\n\t\tadd(code, stack, cond);\n\t\tif (wrap) {\n\t\t\tcode.add(')');\n\t\t}\n\t}\n\n\tprivate void wrap(ICodeWriter code, InsnArg firstArg) throws CodegenException {\n\t\tboolean wrap = isArgWrapNeeded(firstArg);\n\t\tif (wrap) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/codegen/ConditionGen.java#L56-L92","documentation":"Thrown by ConditionGen.add() as the default branch of the switch on condition.getMode(). IfCondition.Mode defines COMPARE, TERNARY, NOT, AND, OR — all are handled. The default is an exhaustive-switch guard that should be unreachable; hitting it indicates a new Mode constant was added without updating this switch or an internal invariant violation.","triggerScenarios":"A new IfCondition.Mode enum value exists but this switch was not updated. Internal corruption of the condition tree producing an unexpected mode value.","commonSituations":"Contributing a new condition mode to jadx without updating all switch sites. Extremely unlikely to occur from user input — this is a developer-facing guard.","solutions":["If you added a new IfCondition.Mode, add a matching case in ConditionGen.add().","Report as an internal jadx bug with the class that triggered it."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    conditionGen.add(code, condition);\n} catch (JadxRuntimeException e) {\n    if (e.getMessage().startsWith(\"Unknown condition mode\")) {\n        // Fallback: emit the condition as a comment\n        code.add(\"/* unknown condition: \" + condition.getMode() + \" */\");\n        logger.warn(\"Unhandled condition mode\", e);\n    } else {\n        throw e;\n    }\n}","preventionTips":["If you add a new IfCondition.Mode, update ConditionGen.add() and all consumers.","Report as an internal jadx bug — this guard should be unreachable in shipped code."],"tags":["codegen","condition","exhaustive-switch","internal-bug"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}