forked from spring-projects/spring-framework
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contribute introspection hints on registered beans
Prior to this commit, reflection hints registered for beans was selectively applied to only consider the methods that we'll actually need reflection on at runtime. This would rely on an undocumented behavior of GraalVM Native where calling `getDeclaredMethods` on a type would only return known metadata at runtime, ignoring the ones that were not registered during native compilation. As of oracle/graal#5171, this behavior is now fixed in GraalVM and aligns with the JVM behavior: all methods will be returned. This means that if during native compilation, introspection was not registered for the type a new `MissingReflectionMetadataException` will be raised. As a follow up of spring-projects#29205, this commit contributes the "introspection on declared method" reflection hint for all registered beans. Closes spring-projectsgh-29246
- Loading branch information
Showing
6 changed files
with
72 additions
and
17 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2002-2022 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.beans.factory.aot; | ||
|
||
/** | ||
* Record class holding key information for beans registered in a bean factory. | ||
* @param beanName the name of the registered bean | ||
* @param beanClass the type of the registered bean | ||
* @author Brian Clozel | ||
* @since 6.0 | ||
*/ | ||
record BeanRegistrationKey(String beanName, Class<?> beanClass) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters