Skip to content

Commit db0e2b1

Browse files
committed
Changed typeReachable conditions into typeReached.
1 parent 8eef57c commit db0e2b1

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<AccessCondition> resolveCondition(UnresolvedAccessCondition un
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
@@ -651,7 +651,7 @@ private void registerField(AccessCondition cnd, boolean queriedOnly, Field refle
651651
}
652652

653653
if (declaringClass.isAnnotation()) {
654-
processAnnotationField(cnd, reflectField);
654+
processAnnotationField(reflectField);
655655
}
656656
}
657657

@@ -692,12 +692,7 @@ private void processAnnotationMethod(boolean queriedOnly, Method method) {
692692
Class<?> annotationClass = method.getDeclaringClass();
693693
Class<?> proxyClass = Proxy.getProxyClass(annotationClass.getClassLoader(), annotationClass);
694694
try {
695-
/*
696-
* build-time condition as it is registered during analysis GR-62516, this should be
697-
* deleted
698-
*/
699-
var condition = TypeReachabilityCondition.create(proxyClass, false);
700-
register(condition, queriedOnly, proxyClass.getDeclaredMethod(method.getName(), method.getParameterTypes()));
695+
register(AccessCondition.unconditional(), queriedOnly, proxyClass.getDeclaredMethod(method.getName(), method.getParameterTypes()));
701696
} catch (NoSuchMethodException e) {
702697
/*
703698
* The annotation member is not present in the proxy class so we don't add it.
@@ -706,11 +701,11 @@ private void processAnnotationMethod(boolean queriedOnly, Method method) {
706701
}
707702

708703
@SuppressWarnings("deprecation")
709-
private void processAnnotationField(AccessCondition cnd, Field field) {
704+
private void processAnnotationField(Field field) {
710705
Class<?> annotationClass = field.getDeclaringClass();
711706
Class<?> proxyClass = Proxy.getProxyClass(annotationClass.getClassLoader(), annotationClass);
712707
try {
713-
register(cnd, false, proxyClass.getDeclaredField(field.getName()));
708+
register(AccessCondition.unconditional(), false, proxyClass.getDeclaredField(field.getName()));
714709
} catch (NoSuchFieldException e) {
715710
/*
716711
* The annotation member is not present in the proxy class so we don't add it.
@@ -1272,7 +1267,7 @@ public void registerHeapReflectionField(Field reflectField, ScanReason reason) {
12721267
if (!reflectivityFilter.shouldExclude(reflectField)) {
12731268
registerTypesForField(analysisField, reflectField, false);
12741269
if (analysisField.getDeclaringClass().isAnnotation()) {
1275-
processAnnotationField(AccessCondition.unconditional(), reflectField);
1270+
processAnnotationField(reflectField);
12761271
}
12771272
}
12781273
}

0 commit comments

Comments
 (0)