You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dd-java-agent/instrumentation/java-lang/src/main/java/datadog/trace/instrumentation/java/lang/StringBuilderCallSite.java
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,9 @@
10
10
importjavax.annotation.Nonnull;
11
11
importjavax.annotation.Nullable;
12
12
13
+
/**
14
+
* This class provides instrumentation for {@link StringBuilder} and {@link StringBuffer} methods.
15
+
*/
13
16
@Propagation
14
17
@CallSite(spi = IastCallSites.class)
15
18
publicclassStringBuilderCallSite {
@@ -103,6 +106,7 @@ public static String afterToString(
Copy file name to clipboardExpand all lines: dd-java-agent/instrumentation/java-lang/src/test/groovy/datadog/trace/instrumentation/java/lang/StringBuilderCallSiteTest.groovy
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -188,8 +188,9 @@ class StringBuilderCallSiteTest extends AgentTestRunner {
188
188
0 * _
189
189
190
190
where:
191
-
param | beginIndex | expected
192
-
sb('012345') | 1 | '12345'
191
+
param | beginIndex | expected
192
+
sb('012345') | 1 | '12345'
193
+
sbf('012345') | 1 | '12345'
193
194
}
194
195
195
196
def 'test string builder substring with endIndex call site'() {
@@ -206,8 +207,9 @@ class StringBuilderCallSiteTest extends AgentTestRunner {
206
207
0 * _
207
208
208
209
where:
209
-
param | beginIndex | endIndex | expected
210
-
sb('012345') | 1 | 5 | '1234'
210
+
param | beginIndex | endIndex | expected
211
+
sb('012345') | 1 | 5 | '1234'
212
+
sbf('012345') | 1 | 5 | '1234'
211
213
}
212
214
213
215
private static class BrokenToString {
@@ -226,4 +228,8 @@ class StringBuilderCallSiteTest extends AgentTestRunner {
0 commit comments