Allow @CompileWithTargetClassAccess to work with all classes
Switch from `MethodHandles.privateLookupIn` to a reflection based approach to that target classes to not need to be explicitly listed. Closes gh-28580
This commit is contained in:
@@ -91,7 +91,7 @@ class AutowiredAnnotationBeanRegistrationAotContributionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@CompileWithTargetClassAccess(classes = PackagePrivateFieldInjectionSample.class)
|
||||
@CompileWithTargetClassAccess
|
||||
void contributeWhenPackagePrivateFieldInjectionInjectsUsingConsumer() {
|
||||
Environment environment = new StandardEnvironment();
|
||||
this.beanFactory.registerSingleton("environment", environment);
|
||||
@@ -122,7 +122,7 @@ class AutowiredAnnotationBeanRegistrationAotContributionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@CompileWithTargetClassAccess(classes = PackagePrivateMethodInjectionSample.class)
|
||||
@CompileWithTargetClassAccess
|
||||
void contributeWhenPackagePrivateMethodInjectionInjectsUsingConsumer() {
|
||||
Environment environment = new StandardEnvironment();
|
||||
this.beanFactory.registerSingleton("environment", environment);
|
||||
|
||||
@@ -342,7 +342,7 @@ class BeanDefinitionMethodGeneratorTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@CompileWithTargetClassAccess(classes = PackagePrivateTestBean.class)
|
||||
@CompileWithTargetClassAccess
|
||||
void generateBeanDefinitionMethodWhenPackagePrivateBean() {
|
||||
RegisteredBean registeredBean = registerBean(
|
||||
new RootBeanDefinition(PackagePrivateTestBean.class));
|
||||
|
||||
Reference in New Issue
Block a user