Skip to content

Commit f3e167d

Browse files
committed
Add support for Guava and FastUtil
Consider guava and fastutil collections and maps as safe so they can be treated as regular collections and maps and use in expression and captured as well
1 parent 295f7bf commit f3e167d

File tree

1 file changed

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

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,14 @@ public static boolean isSafe(Collection<?> collection) {
215215
// All Collection implementations from Google ProtoBuf are considered as safe
216216
return true;
217217
}
218+
if (className.startsWith("com.google.common.collect.")) {
219+
// All Collection implementations from Google Guava are considered as safe
220+
return true;
221+
}
222+
if (className.startsWith("it.unimi.dsi.fastutil.")) {
223+
// All Collection implementations from fastutil are considered as safe
224+
return true;
225+
}
218226
return false;
219227
}
220228

@@ -229,6 +237,14 @@ public static boolean isSafe(Map<?, ?> map) {
229237
// All Map implementations from Google ProtoBuf are considered as safe
230238
return true;
231239
}
240+
if (className.startsWith("com.google.common.collect.")) {
241+
// All Map implementations from Google Guava are considered as safe
242+
return true;
243+
}
244+
if (className.startsWith("it.unimi.dsi.fastutil.")) {
245+
// All Map implementations from fastutil are considered as safe
246+
return true;
247+
}
232248
return false;
233249
}
234250

0 commit comments

Comments
 (0)