{"record":{"id":"28e50edda764393b","repo":"java-native-access/jna","slug":"runtimeexception-e","errorCode":null,"errorMessage":"RuntimeException(e)","messagePattern":"RuntimeException\\(e\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"contrib/platform/src/com/sun/jna/platform/bsd/ExtAttrUtil.java","lineNumber":108,"sourceCode":"    public static void delete(String path, String name) throws IOException {\n        int r = ExtAttr.INSTANCE.extattr_delete_file(path, ExtAttr.EXTATTR_NAMESPACE_USER, name);\n        if (r < 0) {\n            throw new IOException(\"errno: \" + Native.getLastError());\n        }\n    }\n\n    private static List<String> decodeStringList(ByteBuffer buffer) {\n        List<String> list = new ArrayList<>();\n\n        while (buffer.hasRemaining()) {\n            int length = buffer.get() & 0xFF;\n            byte[] value = new byte[length];\n            buffer.get(value);\n\n            try {\n                list.add(new String(value, \"UTF-8\"));\n            } catch (UnsupportedEncodingException e) {\n                throw new RuntimeException(e);\n            }\n        }\n\n        return list;\n    }\n\n}\n","sourceCodeStart":90,"sourceCodeEnd":116,"githubUrl":"https://github.com/java-native-access/jna/blob/d036ad9781adad4b66693e8fa7098e4ac665e0a3/contrib/platform/src/com/sun/jna/platform/bsd/ExtAttrUtil.java#L90-L116","documentation":"Wraps an UnsupportedEncodingException raised while decoding an extended-attribute name from bytes using the charset name passed to the helper; the fault is an invalid or unsupported charset name for attribute decoding, not the attribute data itself.","triggerScenarios":"Thrown at contrib/platform/src/com/sun/jna/platform/bsd/ExtAttrUtil.java:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid charset name guaranteed by the JVM (e.g. UTF-8) instead of an arbitrary one","Catch RuntimeException at the list() call site and treat the attribute set as undecodable rather than aborting"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d036ad9781adad4b66693e8fa7098e4ac665e0a3","analyzedAt":"2026-09-12T06:50:59.239Z","contentChangedAt":"2026-09-12T06:50:59.239Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}