-
Type:
Improvement
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.1 RC1 (Lovelace), 1.13.14 (Ingalls SR14), 2.0.9 (Kay SR9)
-
Fix Version/s: 2.1 RC2 (Lovelace), 2.0.10 (Kay SR10)
-
Component/s: Core, Mapping / Conversion
-
Labels:None
-
Pull Request URL:
-
Sprint:Lovelace RC1
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.