Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit c886be9

Browse files
committed
Allow config props exclusion to work when functional mode inferred
1 parent 618555c commit c886be9

File tree

1 file changed

+2
-6
lines changed
  • spring-graalvm-native-feature/src/main/java/org/springframework/graalvm/type

1 file changed

+2
-6
lines changed

spring-graalvm-native-feature/src/main/java/org/springframework/graalvm/type/Type.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ void collectHints(AnnotationNode an, List<Hint> hints, Set<AnnotationNode> visit
12231223
List<CompilationHint> hints2 = typeSystem.findHints(an.desc);
12241224
if (hints2.size() != 0) {
12251225
List<String> typesCollectedFromAnnotation = collectTypeReferencesInAnnotation(an);
1226-
if (an.desc.equals(Type.AtEnableConfigurationProperties) && !isFunctionalMode()) {
1226+
if (an.desc.equals(Type.AtEnableConfigurationProperties) && !ConfigOptions.isFunctionalMode()) {
12271227
// TODO special handling here for @EnableConfigurationProperties - should we
12281228
// promote this to a hint annotation value or truly a special case?
12291229
addInners(typesCollectedFromAnnotation);
@@ -1902,7 +1902,7 @@ public static int inferAccessRequired(Type t) {
19021902
} else if (t.isArray()) {
19031903
return AccessBits.CLASS;
19041904
} else if (t.isConfigurationProperties()) {
1905-
if (!isFunctionalMode()) {
1905+
if (!ConfigOptions.isFunctionalMode()) {
19061906
return AccessBits.CLASS | AccessBits.DECLARED_METHODS | AccessBits.DECLARED_CONSTRUCTORS;
19071907
} else {
19081908
SpringFeature.log("Skipping registration of reflective access to configuration properties: "+t.getDottedName());
@@ -1917,10 +1917,6 @@ public static int inferAccessRequired(Type t) {
19171917
}
19181918
}
19191919

1920-
private static boolean isFunctionalMode() {
1921-
return System.getProperty("spring.native.mode", "reflection").equals("functional");
1922-
}
1923-
19241920
@SuppressWarnings("unchecked")
19251921
private List<CompilationHint> fromConfigurationHintsToCompilationHints(AnnotationNode an) {
19261922
List<CompilationHint> chs = new ArrayList<>();

0 commit comments

Comments
 (0)