{"record":{"id":"3443688c6437cc3c","repo":"oracle/graal","slug":"static-field-write-requires-null-receiver","errorCode":null,"errorMessage":"Static field write requires null receiver","messagePattern":"Static field write requires null receiver","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalResolvedJavaField.java","lineNumber":121,"sourceCode":"\n    @Override\n    public int hashCode() {\n        return vmFieldMirror.hashCode();\n    }\n\n    public Value readValue(Value receiver) {\n        return vmFieldMirror.invokeMember(\"read\", receiver);\n    }\n\n    void writeValue(JavaConstant receiver, JavaConstant value) {\n        if (value == null) {\n            throw new NullPointerException(\"value\");\n        }\n\n        final Value receiverValue;\n        if (isStatic()) {\n            if (receiver != null) {\n                throw new IllegalArgumentException(\"Static field write requires null receiver\");\n            }\n            receiverValue = null;\n        } else {\n            if (receiver == null) {\n                throw new NullPointerException(\"receiver\");\n            }\n            if (receiver.isNull()) {\n                throw new IllegalArgumentException(\"Receiver is null\");\n            }\n            if (!(receiver instanceof EspressoExternalObjectConstant espressoReceiver)) {\n                throw new IllegalArgumentException(\"Expected an espresso object receiver, got \" + receiver.getClass().getName());\n            }\n            receiverValue = espressoReceiver.getValue();\n        }\n\n        JavaKind kind = getJavaKind();\n        final Object boxed;\n        if (kind == JavaKind.Object) {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalResolvedJavaField.java#L103-L139","documentation":"Error \"Static field write requires null receiver\" thrown in oracle/graal.","triggerScenarios":"Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalResolvedJavaField.java:121 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Static field write requires null receiver","solutions":["Fix the condition reported by the error: Static field write requires null receiver","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: Static field write requires null receiver","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"}