Skip to content

Commit d5b629d

Browse files
authored
Add protobuf collections as safe ones (#7438)
protobuf collections used are specific ones implementing JDK interfaces. They are in-memory collection so it is safe to handle them like the JDK ones.
1 parent ab9943c commit d5b629d

File tree

1 file changed

+8
-0
lines changed
  • dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util

1 file changed

+8
-0
lines changed

dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/WellKnownClasses.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ public static boolean isSafe(Collection<?> collection) {
160160
// All Collection implementations from JDK base module are considered as safe
161161
return true;
162162
}
163+
if (className.startsWith("com.google.protobuf.")) {
164+
// All Collection implementations from Google ProtoBuf are considered as safe
165+
return true;
166+
}
163167
return false;
164168
}
165169

@@ -170,6 +174,10 @@ public static boolean isSafe(Map<?, ?> map) {
170174
// All Map implementations from JDK base module are considered as safe
171175
return true;
172176
}
177+
if (className.startsWith("com.google.protobuf.")) {
178+
// All Map implementations from Google ProtoBuf are considered as safe
179+
return true;
180+
}
173181
return false;
174182
}
175183

0 commit comments

Comments
 (0)