Skip to content

Commit 78e252c

Browse files
committed
Filter internal types from reflection tracing
1 parent 8d8adfb commit 78e252c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,24 @@ private ConfigurationSet getConfigurationSetForTracing() {
146146
* (e.g., during shutdown).
147147
*/
148148
public ConfigurationType traceReflectionType(String typeName) {
149+
if (isInternal(typeName)) {
150+
return null;
151+
}
149152
return traceReflectionTypeImpl(new NamedConfigurationTypeDescriptor(typeName));
150153
}
151154

152155
/**
153156
* Marks the given proxy type as reachable from reflection.
154157
*/
155158
public void traceProxyType(List<String> interfaceNames) {
156-
traceReflectionTypeImpl(new ProxyConfigurationTypeDescriptor(interfaceNames));
159+
ProxyConfigurationTypeDescriptor descriptor = new ProxyConfigurationTypeDescriptor(interfaceNames);
160+
for (String interfaceName : interfaceNames) {
161+
if (isInternal(interfaceName)) {
162+
debug("proxy type not registered for reflection (uses an internal interface)", descriptor);
163+
return;
164+
}
165+
}
166+
traceReflectionTypeImpl(descriptor);
157167
}
158168

159169
private ConfigurationType traceReflectionTypeImpl(ConfigurationTypeDescriptor typeDescriptor) {
@@ -165,6 +175,10 @@ private ConfigurationType traceReflectionTypeImpl(ConfigurationTypeDescriptor ty
165175
return null;
166176
}
167177

178+
private static boolean isInternal(String typeName) {
179+
return typeName.startsWith("com.oracle.svm.core");
180+
}
181+
168182
/**
169183
* Marks the given type as reachable from JNI.
170184
*

0 commit comments

Comments
 (0)