-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add After callsites support for void methods (#8116)
- Loading branch information
1 parent
8b2bb8e
commit a3e9bda
Showing
8 changed files
with
147 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...tooling/src/test/java/datadog/trace/agent/tooling/csi/StringBuilderSetLengthCallSite.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package datadog.trace.agent.tooling.csi; | ||
|
||
public class StringBuilderSetLengthCallSite { | ||
|
||
public static volatile Object[] LAST_CALL; | ||
|
||
public static void after(final StringBuilder builder, int length) { | ||
LAST_CALL = new Object[] {builder, length}; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...-tooling/src/test/java/datadog/trace/agent/tooling/csi/StringBuilderSetLengthExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package datadog.trace.agent.tooling.csi; | ||
|
||
import java.util.function.BiConsumer; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class StringBuilderSetLengthExample implements BiConsumer<StringBuilder, Integer> { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(StringBuilderSetLengthExample.class); | ||
|
||
public void accept(final StringBuilder builder, final Integer length) { | ||
LOGGER.debug("Before apply {} {}", builder, length); | ||
builder.setLength(length); | ||
LOGGER.debug("After apply {} {}", builder, length); | ||
} | ||
} |