You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assertThat().usingRecursiveComparison() on XMLGregorianCalendar objects triggers an illegal reflective access operation
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.assertj.core.util.introspection.FieldUtils (file:/home/lc22j176/.m2/repository/org/assertj/assertj-core/3.24.2/assertj-core-3.24.2.jar) to field com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl.orig_second
WARNING: Please consider reporting this to the maintainers of org.assertj.core.util.introspection.FieldUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Yes, I think anything that AssertJ won't be able to introspect because of java policy to restrict reflective access should be compared by their equals method since there is not much else we can do.
In this case, I could fix the issue by adding com.sun.* to java types detection (javax did not solve the issue but should be added too).
@lcharrie in the meantime, you can get rid of the warning by telling the recursive comparison to compare XMLGregorianCalendar with their equals method:
assertThat().usingRecursiveComparison() on XMLGregorianCalendar objects triggers an illegal reflective access operation
Test case reproducing the bug
The text was updated successfully, but these errors were encountered: