You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gg...@apache.org on 2018/02/28 12:54:30 UTC

[karaf] branch master updated: [KARAF-5376] Woodstox doesn't like mixing access to underlying writer

This is an automated email from the ASF dual-hosted git repository.

ggrzybek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/master by this push:
     new 7e7b643  [KARAF-5376] Woodstox doesn't like mixing access to underlying writer
7e7b643 is described below

commit 7e7b6432871336ab08b0f6ec3095c4dac448b9fa
Author: Grzegorz Grzybek <gg...@redhat.com>
AuthorDate: Wed Feb 28 13:54:09 2018 +0100

    [KARAF-5376] Woodstox doesn't like mixing access to underlying writer
---
 .../features/internal/service/FeaturesProcessingSerializer.java   | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesProcessingSerializer.java b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesProcessingSerializer.java
index 6fcbbcb..3c92b8f 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesProcessingSerializer.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesProcessingSerializer.java
@@ -175,10 +175,6 @@ public class FeaturesProcessingSerializer {
                             String comment = props.getProperty(tag);
                             xmlEventWriter.add(evFactory.createCharacters("\n    "));
                             xmlEventWriter.add(evFactory.createComment(" " + comment + " "));
-                            if (emptyElements.get(tag) != null && emptyElements.get(tag)) {
-                                skipClose = true;
-                                writer.write("    <" + tag + " />\n");
-                            }
                         }
                     } else if (type == XMLEvent.END_ELEMENT) {
                         skipClose = false;
@@ -186,9 +182,6 @@ public class FeaturesProcessingSerializer {
                         if (depth == 1) {
                             String tag = ev.asEndElement().getName().getLocalPart();
                             String comment = props.getProperty(tag);
-                            if (emptyElements.get(tag) != null && emptyElements.get(tag)) {
-                                skipClose = true;
-                            }
                         }
                     }
                     if (type == XMLEvent.END_ELEMENT && depth == 0) {
@@ -202,6 +195,7 @@ public class FeaturesProcessingSerializer {
                     }
                 }
             }
+            xmlEventWriter.add(evFactory.createEndDocument());
             writer.flush();
         } catch (Exception e) {
             LOG.warn(e.getMessage(), e);

-- 
To stop receiving notification emails like this one, please contact
ggrzybek@apache.org.