| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This PR fixes a bug in the AbstractLogger.replaceParam method where replacement strings containing the {} marker would be incorrectly processed, causing repeated replacements. The fix replaces the regex-based approach with a more efficient StringBuilder-based implementation that correctly handles replacement strings containing {} by tracking the position after each replacement.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/logging/core/AbstractLogger.java | Refactored replaceParam method to use StringBuilder instead of regex, fixing the double-replacement bug and improving performance |
| apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/logging/core/AbstractLoggerTest.java | Added new test file with test cases for normal parameter replacement and the specific bug case with {} in replacement strings |
| CHANGES.md | Added changelog entry documenting the fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
For replaceParam("from {} to {}", "a={}", "b={}"), the correct output should be from a={} to b={}, not from a=b={} to {}.
Closes apache/skywalking#13591