{"record":{"id":"a5d821d34d240e2b","repo":"pxb1988/dex2jar","slug":"while-accept-parameter-annotation-in-method-s","errorCode":null,"errorMessage":"while accept parameter annotation in method:%s.","messagePattern":"while accept parameter annotation in method:(.+?)\\.","errorType":"exception","errorClass":"DexException","httpStatus":null,"severity":"error","filePath":"dex-reader/src/main/java/com/googlecode/d2j/reader/DexFileReader.java","lineNumber":1050,"sourceCode":"\r\n        try {\r\n            DexMethodVisitor dmv = cv.visitMethod(method_access_flags, method);\r\n            if (dmv != null) {\r\n                if ((config & SKIP_ANNOTATION) == 0) {\r\n                    Integer annotation_offset = methodAnnos.get(method_id);\r\n                    if (annotation_offset != null) {\r\n                        try {\r\n                            read_annotation_set_item(annotation_offset, dmv);\r\n                        } catch (Exception e) {\r\n                            throw new DexException(e, \"while accept annotation in method:%s.\", method.toString());\r\n                        }\r\n                    }\r\n                    Integer parameter_annotation_offset = parameterAnnos.get(method_id);\r\n                    if (parameter_annotation_offset != null) {\r\n                        try {\r\n                            read_annotation_set_ref_list(parameter_annotation_offset, dmv);\r\n                        } catch (Exception e) {\r\n                            throw new DexException(e, \"while accept parameter annotation in method:%s.\",\r\n                                    method.toString());\r\n                        }\r\n                    }\r\n                }\r\n                if (code_off != 0) {\r\n                    boolean keep = true;\r\n                    if (0 != (SKIP_CODE & config)) {\r\n                        keep = 0 != (KEEP_CLINIT & config) && method.getName().equals(\"<clinit>\");\r\n                    }\r\n                    if(keep) {\r\n                        DexCodeVisitor dcv = dmv.visitCode();\r\n                        if (dcv != null) {\r\n                            try {\r\n                                acceptCode(code_off, dcv, config, (method_access_flags & DexConstants.ACC_STATIC) != 0,\r\n                                        method);\r\n                            } catch (Exception e) {\r\n                                throw new DexException(e, \"while accept code in method:[%s] @%08x\", method.toString(),\r\n                                        code_off);\r","sourceCodeStart":1032,"sourceCodeEnd":1068,"githubUrl":"https://github.com/pxb1988/dex2jar/blob/b5bda4fb4935ae8b3869b422454ae3b3896c7bc1/dex-reader/src/main/java/com/googlecode/d2j/reader/DexFileReader.java#L1032-L1068","documentation":"DexException wrapping any failure that occurs while DexFileReader.accept(DexMethodVisitor) reads and dispatches a method's parameter annotations from the dex file's parameter-annotation table. The original cause is preserved as the exception cause; the message identifies which method's annotations failed to decode.","triggerScenarios":"Calling accept() on a DexFileReader whose dex file has a corrupt or truncated parameter_annotations entry, or an annotation set ref list offset that points outside the file, causing read_annotation_set_ref_list to throw.","commonSituations":"Processing a dex file produced by a non-standard toolchain, an obfuscator or packer that rewrites annotation offsets, or a truncated/corrupted classes.dex inside an APK.","solutions":["Inspect the wrapped cause (e.getCause()) to find the underlying decode failure","Verify the dex file with dexdump/dexlint to confirm the annotation section is intact","Rebuild the dex/apk with the standard dx/d8 toolchain before converting","If the dex is known-bad, skip parameter annotations via config options or catch DexException around accept()"],"exampleFix":"// before\nreader.accept(dmv);\n// after\ntry {\n    reader.accept(dmv);\n} catch (DexException e) {\n    log.warn(\"bad parameter annotations for dex\", e.getCause());\n}","handlingStrategy":"try-catch","validationCode":"// Validate dex before conversion\nDexFileReader r = new DexFileReader(dexBytes);\n// optionally run dexdump -d classes.dex externally and fail on errors","typeGuard":null,"tryCatchPattern":"try {\n    reader.accept(dmv);\n} catch (DexException e) {\n    logger.warn(\"parameter annotations unreadable\", e.getCause());\n}","preventionTips":["Use dexes built by dx/d8, not hand-patched ones","Verify dex integrity (checksum/signature) before parsing","Keep d2j updated"],"tags":["dex","annotations","malformed-input","dex-file-reader"],"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"}