{"record":{"id":"fe679f99116641e1","repo":"skylot/jadx","slug":"not-class-type","errorCode":null,"errorMessage":"Not class type: {}","messagePattern":"Not class type: (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/info/ClassInfo.java","lineNumber":59,"sourceCode":"\n\tpublic static ClassInfo fromName(RootNode root, String clsName) {\n\t\treturn fromType(root, ArgType.object(clsName));\n\t}\n\n\tpublic static ClassInfo fromNameWithoutCache(RootNode root, String fullClsName, boolean canBeInner) {\n\t\treturn new ClassInfo(root, ArgType.object(fullClsName), canBeInner);\n\t}\n\n\tprivate static ArgType checkClassType(ArgType type) {\n\t\tif (type == null) {\n\t\t\tthrow new JadxRuntimeException(\"Null class type\");\n\t\t}\n\t\tif (type.isArray()) {\n\t\t\t// TODO: check case with method declared in array class like ( clone in int[])\n\t\t\treturn ArgType.OBJECT;\n\t\t}\n\t\tif (!type.isObject() || type.isGenericType()) {\n\t\t\tthrow new JadxRuntimeException(\"Not class type: \" + type);\n\t\t}\n\t\tif (type.isGeneric()) {\n\t\t\treturn ArgType.object(type.getObject());\n\t\t}\n\t\treturn type;\n\t}\n\n\tpublic void changeShortName(String aliasName) {\n\t\tClassAliasInfo newAlias;\n\t\tString aliasPkg = getAliasPkg();\n\t\tif (Objects.equals(name, aliasName) || StringUtils.isEmpty(aliasName)) {\n\t\t\tif (Objects.equals(getPackage(), aliasPkg)) {\n\t\t\t\tnewAlias = null;\n\t\t\t} else {\n\t\t\t\tnewAlias = new ClassAliasInfo(aliasPkg, name);\n\t\t\t}\n\t\t} else {\n\t\t\tnewAlias = new ClassAliasInfo(aliasPkg, aliasName);","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/info/ClassInfo.java#L41-L77","documentation":"Thrown by ClassInfo.checkClassType when the ArgType is non-null but is neither an object type nor is a generic type (type.isObject() false, or type.isGenericType() true). It enforces that a ClassInfo only describes a concrete class type, not a primitive, a bare type variable, or an unparameterised generic.","triggerScenarios":"Passing an ArgType that is a primitive (INT, etc.), a type variable (e.g. T), or a generic-type-token where a concrete class is required. Happens when class resolution is fed a type that does not denote an actual class.","commonSituations":"Misrouting generic/type-variable resolution into class-info lookup; parsing a type descriptor incorrectly so it is not recognised as OBJECT; obfuscated descriptors that resolve to a generic instead of a class.","solutions":["Before building ClassInfo, check type.isObject() && !type.isGenericType(); if not, handle via the appropriate (generic/primitive) path instead.","For generic types, extract the raw object type first: ArgType.object(type.getObject()).","Inspect the offending ArgType (printed in the message) to see why it is not a class type.","Fix the upstream descriptor/type parsing that produced the wrong kind."],"exampleFix":"// before\nClassInfo info = ClassInfo.fromType(root, type); // throws for primitives/generics\n\n// after\nif (type == null) {\n    return null;\n}\nif (!type.isObject() || type.isGenericType()) {\n    if (type.isGeneric()) {\n        type = ArgType.object(type.getObject()); // use raw type\n    } else {\n        throw new IllegalArgumentException(\"Not a class type: \" + type);\n    }\n}\nClassInfo info = ClassInfo.fromType(root, type);","handlingStrategy":"type-guard","validationCode":"if (type == null || !type.isObject() || type.isGenericType()) {\n    if (type != null && type.isGeneric()) {\n        type = ArgType.object(type.getObject()); // use raw type\n    } else {\n        throw new IllegalArgumentException(\"Not a class type: \" + type);\n    }\n}","typeGuard":"static boolean isClassType(ArgType t) {\n    return t != null && t.isObject() && !t.isGenericType();\n}","tryCatchPattern":"try {\n    return ClassInfo.fromType(root, type);\n} catch (JadxRuntimeException e) {\n    if (type != null && type.isGeneric()) {\n        return ClassInfo.fromType(root, ArgType.object(type.getObject()));\n    }\n    throw e;\n}","preventionTips":["For generics, extract the raw object type before class-info lookup.","Validate isObject() && !isGenericType() at the call site.","Route primitives and type variables through their own resolution paths."],"tags":["classinfo","type-system","generic","precondition"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}