[LANG-1685] reflectionToString falls back to toString if reflective access is not permitted.#1470
[LANG-1685] reflectionToString falls back to toString if reflective access is not permitted.#1470iwauo wants to merge 1 commit intoapache:masterfrom
Conversation
…ccess is not permitted.
|
I made a minor code change to refactor. Verified on JDK 8, 11, and 21. |
|
Hi @garydgregory , could you please take a look at this PR and let me know your thoughts? I'd appreciate any feedback you have. |
|
Hi,@garydgregory ,@iwauo,, is there any contribution that you can assighn to me as a beginner , who only knows java DSA in this project , I would like to contribute, or can you guide me? |
Description
The
ToStringBuilder.reflectionToString()implementation previously threw an exception when access to a field was prohibited by JPMS. This patch adds defensive handling so that, when reflective access is not permitted, the method falls back to invoking the target object's nativetoString().Additionally, the change is implemented to work on JVMs that do not support JPMS (JDK 8).
mvn; that'smvnon the command line by itself.