Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-1373

Align class loading in ClassGeneratingEntityInstantiator with ClassGeneratingPropertyAccessorFactory

    Details

      Description

      ClassGeneratingEntityInstantiator uses a child classloader to load and define generated EntityInstantiator classes so that these can be used. Using a child classloader imposes a constraint on target class visibility, specifically package-private classes. These can only be accessed by classes that reside in the same package and are loaded by the same class loader.

      ClassGeneratingPropertyAccessorFactory uses ReflectUtils.defineClass(…) that allows injection of a class into the classloader that was used to load the entity class.

      ReflectUtils.defineClass(…) is deprecated with JDK 9 and newer as the reflectively used methods are encapsulated and cause warnings to be logged on JDK 9.

      We should at least use ReflectUtils to enable generated EntityInstantiator use for package-private types.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mp911de Mark Paluch
                Reporter:
                mp911de Mark Paluch
                Last updater:
                Juergen Hoeller
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: