< prev index next >

src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -76,10 +76,13 @@
 import com.sun.xml.internal.bind.v2.runtime.output.XMLStreamWriterOutput;
 import com.sun.xml.internal.bind.v2.runtime.output.XmlOutput;
 import com.sun.xml.internal.bind.v2.util.FatalAdapter;
 
 import java.net.URISyntaxException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.XMLFilterImpl;
 

@@ -93,10 +96,12 @@
  * @author Kohsuke Kawaguchi
  * @author Vivek Pandey
  */
 public /*to make unit tests happy*/ final class MarshallerImpl extends AbstractMarshallerImpl implements ValidationEventHandler
 {
+    private static final Logger LOGGER = Logger.getLogger(MarshallerImpl.class.getName());
+
     /** Indentation string. Default is four whitespaces. */
     private String indent = "    ";
 
     /** Used to assign prefixes to namespace URIs. */
     private NamespacePrefixMapper prefixMapper = null;

@@ -325,16 +330,18 @@
         if(toBeFlushed!=null)
             try {
                 toBeFlushed.flush();
             } catch (IOException e) {
                 // ignore
+                LOGGER.log(Level.SEVERE, e.getMessage(), e);
             }
         if(toBeClosed!=null)
             try {
                 toBeClosed.close();
             } catch (IOException e) {
                 // ignore
+                LOGGER.log(Level.SEVERE, e.getMessage(), e);
             }
         toBeFlushed = null;
         toBeClosed = null;
     }
 
< prev index next >