Skip to content

Illegal reflective access when recursively comparing XMLGregorianCalendar #2928

@lcharrie

Description

@lcharrie

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
  • assertj core version 3.24.2
  • java 14
  • junit-jupiter-api version 5.8.2

Test case reproducing the bug

  void AssertjXMLGregorianCalendarTest() throws Exception {

    XMLGregorianCalendar in = DatatypeFactory.newInstance().newXMLGregorianCalendar();
    XMLGregorianCalendar out = DatatypeFactory.newInstance().newXMLGregorianCalendar();

    assertThat(out).usingRecursiveComparison().isEqualTo(in);
  }

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions