You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2023/10/26 21:58:08 UTC
[groovy] branch master updated (a52a3888c9 -> a2f6aa214c)
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
from a52a3888c9 vmplugin: missing class erorr
new 5ab745cfd7 fix(XmlUtil): escapeControlCharacters off-by-one bug
new a2f6aa214c fix(XmlUtil): add control characters in escaping unit test
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java | 2 +-
subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlUtilTest.groovy | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
[groovy] 01/02: fix(XmlUtil): escapeControlCharacters off-by-one bug
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 5ab745cfd7d9ebd408f6b587c267f68670330d85
Author: Pierre-Nicolas Clauss <pi...@protonmail.com>
AuthorDate: Sun Oct 22 11:18:18 2023 +0200
fix(XmlUtil): escapeControlCharacters off-by-one bug
---
subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java b/subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java
index 91cac1ab31..93e77396e1 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java
@@ -476,7 +476,7 @@ public class XmlUtil {
public static String escapeControlCharacters(String orig) {
return StringGroovyMethods.collectReplacements(orig, new Closure<String>(null) {
public String doCall(Character arg) {
- if (arg < 31) {
+ if (arg < 0x20) {
return "&#" + (int) arg + ";";
}
return null;
[groovy] 02/02: fix(XmlUtil): add control characters in escaping unit test
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit a2f6aa214c0b2958046e9971bcf6701649827dad
Author: Pierre-Nicolas Clauss <pi...@protonmail.com>
AuthorDate: Thu Oct 26 13:57:53 2023 +0200
fix(XmlUtil): add control characters in escaping unit test
---
subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlUtilTest.groovy | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlUtilTest.groovy b/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlUtilTest.groovy
index e71076b94c..2f2c411ee1 100644
--- a/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlUtilTest.groovy
+++ b/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlUtilTest.groovy
@@ -103,7 +103,7 @@ class XmlUtilTest extends GroovyTestCase {
// GROOVY-5775
void testEscaping() {
- def ans = escapeControlCharacters(escapeXml('"bread" & "butter"\r\n'))
- assert ans == '"bread" & "butter" '
+ def ans = escapeControlCharacters(escapeXml('"bread" & "butter"\r\n\u0000\u001f'))
+ assert ans == '"bread" & "butter" �'
}
}