{"record":{"id":"0ba8235c41970115","repo":"oracle/graal","slug":"reclaimed-jni-reference-this","errorCode":null,"errorMessage":"Reclaimed JNI reference: <this>","messagePattern":"Reclaimed JNI reference: <this>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdk/src/org.graalvm.jniutils/src/org/graalvm/jniutils/HSObject.java","lineNumber":149,"sourceCode":"     *\n     * @return the number of objects in the list\n     */\n    static int invalidate(HSObject head) {\n        HSObject o = head;\n        int count = 0;\n        while (o != null) {\n            HSObject next = o.next;\n            // Makes the handle now invalid.\n            o.next = o;\n            o = next;\n            count++;\n        }\n        return count;\n    }\n\n    public final JObject getHandle() {\n        if (next == this) {\n            throw new IllegalArgumentException(\"Reclaimed JNI reference: \" + this);\n        }\n        return handle;\n    }\n\n    @Override\n    public String toString() {\n        return String.format(\"%s[0x%x]\", getClass().getSimpleName(), handle.rawValue());\n    }\n\n    public final void release(JNIEnv env) {\n        if (cleaner != null) {\n            assert next == null || next == this;\n            this.next = this;\n            cleaner.clean(env);\n        }\n    }\n\n    /**","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/sdk/src/org.graalvm.jniutils/src/org/graalvm/jniutils/HSObject.java#L131-L167","documentation":"Error \"Reclaimed JNI reference: <this>\" thrown in oracle/graal.","triggerScenarios":"Thrown at sdk/src/org.graalvm.jniutils/src/org/graalvm/jniutils/HSObject.java:149 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Reclaimed JNI reference: <this>","solutions":["Fix the condition reported by the error: Reclaimed JNI reference: <this>","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Reclaimed JNI reference: <this>","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}