Skip to content

Commit b2b51d1

Browse files
committed
fix forbidden api
1 parent 344c6d2 commit b2b51d1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/ConfigurationUpdater.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ public class ConfigurationUpdater implements DebuggerContext.ProbeResolver, Conf
6363
Method getAnnotatedTypesMethod = null;
6464
if (JAVA_AT_LEAST_16) {
6565
try {
66-
Class<?> recordClass = Class.forName("java.lang.Record");
66+
Class<?> recordClass = Class.forName("java.lang.Record", true, null);
6767
getRecordComponentsMethod = recordClass.getClass().getDeclaredMethod("getRecordComponents");
68-
Class<?> recordComponentClass = Class.forName("java.lang.reflect.RecordComponent");
68+
Class<?> recordComponentClass =
69+
Class.forName("java.lang.reflect.RecordComponent", true, null);
6970
getAnnotatedTypesMethod = recordComponentClass.getDeclaredMethod("getAnnotatedType");
7071
} catch (Exception e) {
7172
LOGGER.debug("Exception initializing reflection constants", e);

0 commit comments

Comments
 (0)