fix: declare java.xml module dependency for Java 9+ modular usage - #7619
fix: declare java.xml module dependency for Java 9+ modular usage#7619JinlongLiao wants to merge 4 commits into
Conversation
|
jinlongliao seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅ — gpt-5.5 via Qwen Code /review
|
Hi, will this PR be merged soon for the next release? |
wenshao
left a comment
There was a problem hiding this comment.
LGTM ✅
The requires java.xml; declaration is correct and necessary — ObjectWriterImplXmlNode and ObjectWriterProvider both directly reference org.w3c.dom.Node and javax.xml.transform.* types from the java.xml module. Non-transitive requires is the right choice since these types are only used internally and do not leak into the exported public API.
— qwen3.7-max via Qwen Code /review
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.8-max-preview via Qwen Code /review
What this PR does / why we need it?
This PR fixes the
IllegalAccessErrorthat occurs when using fastjson2 (v2.0.61) in Java 9+ modular environments. The error is caused by missingjava.xmlmodule declaration insrc/main/moditect/module-info.java, while the code internally referencesorg.w3c.dom.Nodefromjava.xml.Without this fix, users cannot properly use fastjson2 in modularized projects, as the JVM prevents access to
java.xmlclasses.Summary of your change
src/main/moditect/module-info.javato explicitly declarerequires java.xml;.ObjectWriterProviderand related XML handling code can accessorg.w3c.dom.NodewithoutIllegalAccessError.Please indicate you've done the following: