Skip to content

Commit 6077967

Browse files
author
Mihailo Markovic
committed
Changed typeReachable conditions into typeReached.
1 parent fba3d6d commit 6077967

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
@@ -609,7 +609,7 @@ private void registerField(RegistrationCondition cnd, boolean queriedOnly, Field
609609
}
610610

611611
if (declaringClass.isAnnotation()) {
612-
processAnnotationField(cnd, reflectField);
612+
processAnnotationField(reflectField);
613613
}
614614
}
615615

@@ -650,12 +650,7 @@ private void processAnnotationMethod(boolean queriedOnly, Method method) {
650650
Class<?> annotationClass = method.getDeclaringClass();
651651
Class<?> proxyClass = Proxy.getProxyClass(annotationClass.getClassLoader(), annotationClass);
652652
try {
653-
/*
654-
* build-time condition as it is registered during analysis GR-62516, this should be
655-
* deleted
656-
*/
657-
var condition = TypeReachabilityCondition.create(proxyClass, false);
658-
register(condition, queriedOnly, proxyClass.getDeclaredMethod(method.getName(), method.getParameterTypes()));
653+
register(RegistrationCondition.always(), queriedOnly, proxyClass.getDeclaredMethod(method.getName(), method.getParameterTypes()));
659654
} catch (NoSuchMethodException e) {
660655
/*
661656
* The annotation member is not present in the proxy class so we don't add it.
@@ -664,11 +659,11 @@ private void processAnnotationMethod(boolean queriedOnly, Method method) {
664659
}
665660

666661
@SuppressWarnings("deprecation")
667-
private void processAnnotationField(RegistrationCondition cnd, Field field) {
662+
private void processAnnotationField(Field field) {
668663
Class<?> annotationClass = field.getDeclaringClass();
669664
Class<?> proxyClass = Proxy.getProxyClass(annotationClass.getClassLoader(), annotationClass);
670665
try {
671-
register(cnd, false, proxyClass.getDeclaredField(field.getName()));
666+
register(RegistrationCondition.always(), false, proxyClass.getDeclaredField(field.getName()));
672667
} catch (NoSuchFieldException e) {
673668
/*
674669
* The annotation member is not present in the proxy class so we don't add it.
@@ -1229,7 +1224,7 @@ public void registerHeapReflectionField(Field reflectField, ScanReason reason) {
12291224
if (!SubstitutionReflectivityFilter.shouldExclude(reflectField, metaAccess, universe)) {
12301225
registerTypesForField(analysisField, reflectField, false);
12311226
if (analysisField.getDeclaringClass().isAnnotation()) {
1232-
processAnnotationField(RegistrationCondition.always(), reflectField);
1227+
processAnnotationField(reflectField);
12331228
}
12341229
}
12351230
}

0 commit comments

Comments
 (0)