Skip to content

Commit f1eb26a

Browse files
committed
Changed typeReachable conditions into typeReached.
1 parent 345dc1a commit f1eb26a

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/NativeImageConditionResolver.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ public TypeResult<RegistrationCondition> resolveCondition(UnresolvedConfiguratio
5353
* reachability checks.
5454
*/
5555
var runtimeChecked = !classInitializationSupport.isAlwaysReached(type) && unresolvedCondition.isRuntimeChecked();
56-
/*
57-
* GR-62516, this should be deleted
58-
*/
56+
/* This condition might be typeReachable */
5957
return TypeReachabilityCondition.create(type, runtimeChecked);
6058
});
6159
}

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ private void registerField(RegistrationCondition cnd, boolean queriedOnly, Field
619619
}
620620

621621
if (declaringClass.isAnnotation()) {
622-
processAnnotationField(cnd, reflectField);
622+
processAnnotationField(reflectField);
623623
}
624624
}
625625

@@ -660,12 +660,7 @@ private void processAnnotationMethod(boolean queriedOnly, Method method) {
660660
Class<?> annotationClass = method.getDeclaringClass();
661661
Class<?> proxyClass = Proxy.getProxyClass(annotationClass.getClassLoader(), annotationClass);
662662
try {
663-
/*
664-
* build-time condition as it is registered during analysis GR-62516, this should be
665-
* deleted
666-
*/
667-
var condition = TypeReachabilityCondition.create(proxyClass, false);
668-
register(condition, queriedOnly, proxyClass.getDeclaredMethod(method.getName(), method.getParameterTypes()));
663+
register(RegistrationCondition.always(), queriedOnly, proxyClass.getDeclaredMethod(method.getName(), method.getParameterTypes()));
669664
} catch (NoSuchMethodException e) {
670665
/*
671666
* The annotation member is not present in the proxy class so we don't add it.
@@ -674,11 +669,11 @@ private void processAnnotationMethod(boolean queriedOnly, Method method) {
674669
}
675670

676671
@SuppressWarnings("deprecation")
677-
private void processAnnotationField(RegistrationCondition cnd, Field field) {
672+
private void processAnnotationField(Field field) {
678673
Class<?> annotationClass = field.getDeclaringClass();
679674
Class<?> proxyClass = Proxy.getProxyClass(annotationClass.getClassLoader(), annotationClass);
680675
try {
681-
register(cnd, false, proxyClass.getDeclaredField(field.getName()));
676+
register(RegistrationCondition.always(), false, proxyClass.getDeclaredField(field.getName()));
682677
} catch (NoSuchFieldException e) {
683678
/*
684679
* The annotation member is not present in the proxy class so we don't add it.
@@ -1240,7 +1235,7 @@ public void registerHeapReflectionField(Field reflectField, ScanReason reason) {
12401235
if (!SubstitutionReflectivityFilter.shouldExclude(reflectField, metaAccess, universe)) {
12411236
registerTypesForField(analysisField, reflectField, false);
12421237
if (analysisField.getDeclaringClass().isAnnotation()) {
1243-
processAnnotationField(RegistrationCondition.always(), reflectField);
1238+
processAnnotationField(reflectField);
12441239
}
12451240
}
12461241
}

0 commit comments

Comments
 (0)