cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/xscript XScriptObjectInlineXML.java
Date Sat, 05 Jul 2003 04:32:06 GMT
joerg       2003/07/04 21:32:05

  Modified:    src/java/org/apache/cocoon/components/xscript
                        XScriptObjectInlineXML.java
  Log:
  fixed usage of deprecated StringBufferInputStream
  
  Revision  Changes    Path
  1.3       +7 -10     cocoon-2.1/src/java/org/apache/cocoon/components/xscript/XScriptObjectInlineXML.java
  
  Index: XScriptObjectInlineXML.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/xscript/XScriptObjectInlineXML.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XScriptObjectInlineXML.java	11 Mar 2003 14:42:54 -0000	1.2
  +++ XScriptObjectInlineXML.java	5 Jul 2003 04:32:05 -0000	1.3
  @@ -50,14 +50,14 @@
   */
   package org.apache.cocoon.components.xscript;
   
  -import org.xml.sax.ContentHandler;
  -import org.xml.sax.InputSource;
  -
  +import java.io.ByteArrayInputStream;
   import java.io.IOException;
   import java.io.InputStream;
  -import java.io.StringBufferInputStream;
   import java.io.StringReader;
   
  +import org.xml.sax.ContentHandler;
  +import org.xml.sax.InputSource;
  +
   /**
    * An <code>XScriptObject</code> created from an inline XML fragment.
    *
  @@ -78,8 +78,7 @@
           streamHandler = new StringBufferContentHandler(stringBuffer);
       }
   
  -    public XScriptObjectInlineXML(XScriptManager manager,
  -                                  StringBuffer stringBuffer) {
  +    public XScriptObjectInlineXML(XScriptManager manager, StringBuffer stringBuffer) {
           super(manager);
           this.stringBuffer = stringBuffer;
           streamHandler = new StringBufferContentHandler(stringBuffer);
  @@ -92,9 +91,7 @@
       }
   
       public InputStream getInputStream() throws IOException {
  -        // FIXME(VG): This method should never be used because it
  -        // incorrectly converts characters into bytes.
  -        return new StringBufferInputStream(stringBuffer.toString());
  +        return new ByteArrayInputStream(stringBuffer.toString().getBytes());
       }
   
       public InputSource getInputSource() throws IOException {
  
  
  

Mime
View raw message