From 57aefd11c561859614f952336e1d73ed5fbaf75d Mon Sep 17 00:00:00 2001 From: piyush kumar sadangi Date: Sun, 13 Oct 2024 08:16:28 +0530 Subject: [PATCH 1/2] Issue #141: Some config results in OOM, reduce list of project in config --- .../main/java/com/example/extractor/ConfigSerializer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extractor/src/main/java/com/example/extractor/ConfigSerializer.java b/extractor/src/main/java/com/example/extractor/ConfigSerializer.java index 770fd98b..386dab8c 100644 --- a/extractor/src/main/java/com/example/extractor/ConfigSerializer.java +++ b/extractor/src/main/java/com/example/extractor/ConfigSerializer.java @@ -517,7 +517,9 @@ private static void appendProperty(final StringBuilder builder, final String ind private static String escapeXml(final String input) { String result = input; if (input != null && !input.isEmpty()) { - result = input.replace("\"", """) + result = input.replace("&", "&") + .replace("<", "<") + .replace("\"", """) .replace("'", "'"); } return result; @@ -535,6 +537,10 @@ private static String escapeXml(final String input) { private static String escapeXmlAttributeValue(final String input, final char delimiter) { String result = input; if (input != null && !input.isEmpty()) { + // Escape '&', '<', and '>' + result = result.replace("&", "&") + .replace("<", "<"); + // Escape the delimiter character if (delimiter == '\'') { result = result.replace("'", "'"); } From 11899da32c03386a205ec0b85788b66d73e8beca Mon Sep 17 00:00:00 2001 From: piyush kumar sadangi Date: Sun, 13 Oct 2024 08:16:38 +0530 Subject: [PATCH 2/2] changes --- Regexp/Example13/config.xml | 2 +- Regexp/all-examples-in-one/config.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Regexp/Example13/config.xml b/Regexp/Example13/config.xml index ead2954c..6037897e 100644 --- a/Regexp/Example13/config.xml +++ b/Regexp/Example13/config.xml @@ -24,7 +24,7 @@ - + diff --git a/Regexp/all-examples-in-one/config.xml b/Regexp/all-examples-in-one/config.xml index 551ba570..16a41e01 100644 --- a/Regexp/all-examples-in-one/config.xml +++ b/Regexp/all-examples-in-one/config.xml @@ -95,7 +95,7 @@ - +