{"record":{"id":"59871a18e5f5af64","repo":"pxb1988/dex2jar","slug":"can-t-parse-type-list","errorCode":null,"errorMessage":"can't parse type list: ","messagePattern":"can't parse type list: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"dex-translator/src/main/java/com/googlecode/d2j/util/Types.java","lineNumber":89,"sourceCode":"                    }\n                }\n                count++;\n                list.add(new String(chars, i, count));\n                i += count;\n                break;\n            }\n            case 'L': {\n                int count = 1;\n                while (chars[i + count] != ';') {\n                    ++count;\n                }\n                count++;\n                list.add(new String(chars, i, count));\n                i += count;\n                break;\n            }\n            default:\n                throw new RuntimeException(\"can't parse type list: \" + desc);\n            }\n        }\n        return list;\n    }\n\n    public static Object[] buildDexStyleSignature(String signature) {\n        int rawLength = signature.length();\n        ArrayList<String> pieces = new ArrayList<String>(20);\n\n        for (int at = 0; at < rawLength; /* at */) {\n            char c = signature.charAt(at);\n            int endAt = at + 1;\n            if (c == 'L') {\n                // Scan to ';' or '<'. Consume ';' but not '<'.\n                while (endAt < rawLength) {\n                    c = signature.charAt(endAt);\n                    if (c == ';') {\n                        endAt++;","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/pxb1988/dex2jar/blob/b5bda4fb4935ae8b3869b422454ae3b3896c7bc1/dex-translator/src/main/java/com/googlecode/d2j/util/Types.java#L71-L107","documentation":"Types.listDesc walks a descriptor string character by character, expecting primitive/array/object type markers. When it meets a character that is not a recognized type-start token it throws RuntimeException(\"can't parse type list: \" + desc), meaning the type-list descriptor contains an illegal character.","triggerScenarios":"Calling Types.listDesc(desc) — directly or via Types.getParameterTypeDesc — with a segment containing unsupported characters, e.g. generic signatures with '<'/'T' tokens, stray text, or corrupted type descriptors inside a method desc's parameter section.","commonSituations":"Passing a Java generic signature like '(Ljava/util/List<Ljava/lang/String;>;)V' where the code expects an erased descriptor; corrupted dex descriptors; hand-built desc strings with typos; parsing output of tools that emit non-erased signatures.","solutions":["Erase generics first: use only standard JVM type descriptors (I, J, [Ljava/lang/String;, etc.) in the type list","Strip generic signature tokens (<...>, T...) or parse with a signature parser instead of listDesc","Inspect the appended desc in the message to find the illegal character and its origin","If descriptors come from a dex/APK, re-extract from a known-good build — corruption or an exotic obfuscator may be at fault"],"exampleFix":"// before\nTypes.listDesc(\"Ljava/util/List<Ljava/lang/String;>;\"); // throws\n// after\nTypes.listDesc(\"Ljava/util/List;\"); // erased descriptor parses fine","handlingStrategy":"validation","validationCode":"private static final String TYPE_START = \"BCDFIJSZL[\";\npublic static void requirePlainTypeList(String desc) {\n    if (desc == null || desc.indexOf('<') >= 0 || desc.indexOf('T') >= 0)\n        throw new IllegalArgumentException(\"generic or invalid type list: \" + desc);\n    for (int i = 0; i < desc.length(); i++) {\n        if (TYPE_START.indexOf(desc.charAt(i)) < 0)\n            throw new IllegalArgumentException(\"illegal char in type list: \" + desc);\n    }\n}","typeGuard":"static boolean isPlainDescriptor(String s) {\n    return s != null && !s.isEmpty() && s.matches(\"([BCDFIJSZ\\[]+|L[a-zA-Z0-9/_$]+;|[BCDFIJSZ\\[\\]|L;])*\");\n}","tryCatchPattern":"try {\n    Types.listDesc(desc);\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"can't parse type list\")) {\n        // erase generics / sanitize the descriptor before retrying\n    } else {\n        throw e;\n    }\n}","preventionTips":["Erase generic signatures to JVM descriptors before parsing","Never feed signature grammar (<, T, .) into listDesc","Validate every character in type lists against valid descriptor starts (B C D F I J S Z L [)"],"tags":["java","dex","descriptor-parsing","type-descriptor"],"backgroundTag":"invalid-argument-format","analyzedSha":"b5bda4fb4935ae8b3869b422454ae3b3896c7bc1","analyzedAt":"2026-09-08T00:44:01.258Z","contentChangedAt":"2026-09-08T00:44:01.258Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}