You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Lindquist, Johan" <Jo...@reuters.com> on 2000/06/06 11:47:57 UTC

possible bug in XMLSerialize?!?

Hi,

When using the XMLSerialize, the call to the constructor with a OutputFormat
parameter of null willl cause a NullPointerException at line 143 of
XMLSerializer.java  (Code snippet w/ some comments follows)

Cheers,

Johan

------ CODE SNIPPET -----------

/**
 * Constructs a new serializer that writes to the specified writer
 * using the specified output format. If <tt>format</tt> is null,
 * will use a default output format.
 *
 * @param writer The writer to use
 * @param format The output format to use, null for the default
 */
 public XMLSerializer( Writer writer, OutputFormat format )
 {
   super( format != null ? format : new OutputFormat( Method.XML, null,
false ) );
   //
   // This next call will fail if format is null.
   //  
   format.setMethod( Method.XML ); 
   // Should it read  
   // _format.setMethod(Method.XML);  ????

   setOutputCharStream( writer );
 }

------ END --------------------
-----------------------------------------------------------------
        Visit our Internet site at http://www.reuters.com

Any views expressed in this message are those of  the  individual
sender,  except  where  the sender specifically states them to be
the views of Reuters Ltd.