You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by ah...@apache.org on 2024/12/03 08:58:01 UTC
(causeway) branch v3 updated: CAUSEWAY-3835: ditch unnecessary conversion step in _DocumentFactories
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch v3
in repository https://gitbox.apache.org/repos/asf/causeway.git
The following commit(s) were added to refs/heads/v3 by this push:
new 62394e6c4ef CAUSEWAY-3835: ditch unnecessary conversion step in _DocumentFactories
62394e6c4ef is described below
commit 62394e6c4efcd3970c0b812ee579cf79d5a90847
Author: andi-huber <ah...@apache.org>
AuthorDate: Tue Dec 3 09:57:54 2024 +0100
CAUSEWAY-3835: ditch unnecessary conversion step in _DocumentFactories
---
.../apache/causeway/commons/internal/codec/_DocumentFactories.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/commons/src/main/java/org/apache/causeway/commons/internal/codec/_DocumentFactories.java b/commons/src/main/java/org/apache/causeway/commons/internal/codec/_DocumentFactories.java
index 031a4baecfc..5fc6f538df6 100644
--- a/commons/src/main/java/org/apache/causeway/commons/internal/codec/_DocumentFactories.java
+++ b/commons/src/main/java/org/apache/causeway/commons/internal/codec/_DocumentFactories.java
@@ -18,7 +18,7 @@
*/
package org.apache.causeway.commons.internal.codec;
-import java.io.ByteArrayInputStream;
+import java.io.StringReader;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
@@ -103,8 +103,8 @@ public class _DocumentFactories {
var dbf = _DocumentFactories.documentBuilderFactory();
dbf.setNamespaceAware(true);
var documentBuilder = dbf.newDocumentBuilder();
- try(var bis = new ByteArrayInputStream(xml.getBytes("utf-8"))) {
- var doc = documentBuilder.parse(new InputSource(bis));
+ try(var reader = new StringReader(xml)) {
+ var doc = documentBuilder.parse(new InputSource(reader));
return doc;
}
}