Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jtduffy committed Jan 2, 2025
1 parent d7cb8da commit 51a81f1
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
import static com.newrelic.agent.bridge.logging.AppLoggingUtils.isApplicationLoggingLocalDecoratingEnabled;

public class AgentUtils {
// Detect the end of the "message" field when it's not the last field -- ",
private static final Pattern JSON_MESSAGE_VALUE_END = Pattern.compile("\"message\".+?[^\\\\]((\",)|(\"}))");
// Detect the end of the "message" field when it is the last field -- "}
private static final Pattern JSON_MESSAGE_VALUE_END2 = Pattern.compile("\"message\".+?(\"})");

/**
* Checks pretty or compact JSON layout strings for a series of characters and returns the index of
Expand All @@ -40,13 +37,7 @@ public static int getIndexToModifyJson(String writerString) {
if (matcher.find()) {
// Group 1 in the match is the ", char sequence
index = matcher.start(1);
} /*else {
matcher = JSON_MESSAGE_VALUE_END2.matcher(writerString);
if (matcher.find()) {
// Group 1 in the match is "}
index = matcher.start(1);
}
}*/
}

return index;
}
Expand Down

0 comments on commit 51a81f1

Please sign in to comment.