Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1667

Cannot Use ReflectionToStringBuilder for ArrayList on Java 16 Due to Module Access

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.12.0
    • 3.13.0
    • lang.builder.*
    • None
    • JDK 16

    Description

      In Java 16, many classes in java.base module are not able to be made accessible due to access restrictions on the module. An example is ArrayList.

       

      In ToStringBuilderTest.testReflectionHierarchyArrayList(), the test fails with the following error:

      java.lang.reflect.InaccessibleObjectException: Unable to make field private static final java.lang.Object[] java.util.ArrayList.DEFAULTCAPACITY_EMPTY_ELEMENTDATA accessible: module java.base does not "opens java.util" to unnamed module @3339ad8e

       

      This is causing build failures for all open PRs.

      Attachments

        Activity

          People

            Unassigned Unassigned
            greatmastermario Andrew Thomas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h