From 3d92da7853cd64e94bdc38365d18c4e5f83d3717 Mon Sep 17 00:00:00 2001 From: Kristof Date: Fri, 7 Aug 2020 11:47:56 +0200 Subject: [PATCH] Indentation disappears with custom escape handler If a custom escape handler is set in combination with the JAXB_FORMATTED_OUTPUT option, the tabs are not printed as the tab() call expects the escaped value in the os stream. I haven't done any significant testing with this fix. Signed-off-by: Kristof Dhondt --- .../org/eclipse/persistence/oxm/record/OutputStreamRecord.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/OutputStreamRecord.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/OutputStreamRecord.java index 3b69ce503a0..44a382b962b 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/OutputStreamRecord.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/OutputStreamRecord.java @@ -292,7 +292,7 @@ protected void writeValue(String value, boolean escapeChars, boolean isAttribute CharArrayWriter out = new CharArrayWriter(); escapeHandler.escape(value.toCharArray(), 0, value.length(), isAttribute, out); byte[] bytes = out.toString().getBytes(); - outputStreamWrite(bytes); + outputStreamWrite(bytes, os); out.close(); } catch (IOException e) { throw XMLMarshalException.marshalException(e);