Skip to content

Commit 4b94ec8

Browse files
committed
Fix filtering of proxies using internal types
1 parent 3e4e2b3 commit 4b94ec8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/metadata/MetadataTracer.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,6 @@ public void traceUnsafeAllocatedType(Class<?> clazz) {
239239
public void traceProxyType(Class<?>[] interfaces) {
240240
List<String> interfaceNames = Arrays.stream(interfaces).map(Class::getTypeName).toList();
241241
ProxyConfigurationTypeDescriptor descriptor = new ProxyConfigurationTypeDescriptor(interfaceNames);
242-
for (String interfaceName : interfaceNames) {
243-
if (isInternal(interfaceName)) {
244-
debug("proxy type not registered for reflection (uses an internal interface)", descriptor);
245-
return;
246-
}
247-
}
248242
traceReflectionTypeImpl(descriptor);
249243
}
250244

@@ -257,6 +251,7 @@ public void traceProxyType(Class<?>[] interfaces) {
257251
public ConfigurationType traceReflectionTypeImpl(ConfigurationTypeDescriptor typeDescriptor) {
258252
assert enabledAtRunTime();
259253
if (isInternal(typeDescriptor)) {
254+
debug("type not registered for reflection (uses an internal interface)", typeDescriptor);
260255
return null;
261256
}
262257
ConfigurationSet configurationSet = getConfigurationSetForTracing();
@@ -270,6 +265,12 @@ public ConfigurationType traceReflectionTypeImpl(ConfigurationTypeDescriptor typ
270265
private static boolean isInternal(ConfigurationTypeDescriptor typeDescriptor) {
271266
if (typeDescriptor instanceof NamedConfigurationTypeDescriptor(String name)) {
272267
return isInternal(name);
268+
} else if (typeDescriptor instanceof ProxyConfigurationTypeDescriptor proxyType) {
269+
for (String interfaceName : proxyType.interfaceNames()) {
270+
if (isInternal(interfaceName)) {
271+
return true;
272+
}
273+
}
273274
}
274275
return false;
275276
}

0 commit comments

Comments
 (0)