{"record":{"id":"77003d854418532c","repo":"MuntashirAkon/AppManager","slug":"class-definition-for-node-getfullpath-is-not-found","errorCode":null,"errorMessage":"Class definition for + node.getFullPath() + is not found.","messagePattern":"Class definition for \\+ node\\.getFullPath\\(\\) \\+ is not found\\.","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/io/fs/DexFileSystem.java","lineNumber":271,"sourceCode":"        boolean canAccess = true;\n        if ((access & OsConstants.R_OK) != 0) {\n            canAccess &= true;\n        }\n        if ((access & OsConstants.W_OK) != 0) {\n            canAccess &= false;\n        }\n        if ((access & OsConstants.X_OK) != 0) {\n            canAccess &= false;\n        }\n        return canAccess;\n    }\n\n    @NonNull\n    @Override\n    protected InputStream getInputStream(@NonNull Node<?> node) throws IOException {\n        ClassDef classDef = (ClassDef) node.getObject();\n        if (classDef == null) {\n            throw new FileNotFoundException(\"Class definition for \" + node.getFullPath() + \" is not found.\");\n        }\n        try {\n            return new ByteArrayInputStream(getDexClasses().getClassContents(classDef).getBytes(StandardCharsets.UTF_8));\n        } catch (ClassNotFoundException e) {\n            throw new IOException(e);\n        }\n    }\n\n    @Override\n    protected void cacheFile(@NonNull Node<?> src, @NonNull File sink) throws IOException {\n        ClassDef classDef = (ClassDef) src.getObject();\n        if (classDef == null) {\n            throw new FileNotFoundException(\"Class definition for \" + src.getFullPath() + \" is not found.\");\n        }\n        try (FileOutputStream os = new FileOutputStream(sink)) {\n            os.write(getDexClasses().getClassContents(classDef).getBytes(StandardCharsets.UTF_8));\n        } catch (ClassNotFoundException e) {\n            throw new IOException(e);","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/io/fs/DexFileSystem.java#L253-L289","documentation":"DexFileSystem.getInputStream reads a class from a mounted DEX file. If the Node's ClassDef object is null — the node does not correspond to a class definition present in the DEX — a FileNotFoundException naming the node's full path is thrown before any class content can be read.","triggerScenarios":"Opening an InputStream on a DEX-VFS node whose getObject() (ClassDef) is null: the class name/path is not in the DEX, the DEX was reloaded so the node is stale, or the node is a directory/metadata pseudo-entry.","commonSituations":"Requesting a class after the DEX was replaced (hot-patch/update) without remounting; probing paths like classes.dex/ tree entries that are not classes; typo in the fully-qualified class path.","solutions":["Confirm the class exists in the DEX (list nodes under the DEX mount) and use the exact full path.","Remount the DEX filesystem so fresh ClassDef objects are built for each node.","Catch FileNotFoundException and handle 'class not present in this DEX' explicitly.","Avoid opening streams on non-class nodes of the DEX mount."],"exampleFix":"// before\nInputStream in = node.openInputStream();\n// after\nif (node.getObject() == null) throw new FileNotFoundException(\"Not a class in this DEX: \" + node.getFullPath());\nInputStream in = node.openInputStream();","handlingStrategy":"validation","validationCode":"if (node.getObject() == null) throw new FileNotFoundException(\"Not a class in this DEX: \" + node.getFullPath());","typeGuard":"static boolean isClassNode(Node<?> n) { return n.getObject() instanceof ClassDef; }","tryCatchPattern":"try (InputStream in = vfs.newInputStream(path)) {\n    // read\n} catch (FileNotFoundException e) {\n    // class absent from this DEX: handle/skip\n}","preventionTips":["Enumerate real class nodes instead of guessing paths.","Remount after DEX updates so ClassDefs are fresh.","Handle per-node failures gracefully in bulk class exports."],"tags":["filesystem","dex","file-not-found","android"],"backgroundTag":"file-not-found","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}