Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 81371 invoked from network); 9 Oct 2006 20:08:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Oct 2006 20:08:42 -0000 Received: (qmail 30886 invoked by uid 500); 9 Oct 2006 20:08:42 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 30749 invoked by uid 500); 9 Oct 2006 20:08:41 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 30738 invoked by uid 99); 9 Oct 2006 20:08:41 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Oct 2006 13:08:41 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Oct 2006 13:08:40 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 4BE651A981A; Mon, 9 Oct 2006 13:08:20 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r454481 - /cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/xscript/XScriptObjectInlineXML.java Date: Mon, 09 Oct 2006 20:08:20 -0000 To: cvs@cocoon.apache.org From: joerg@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061009200820.4BE651A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: joerg Date: Mon Oct 9 13:08:18 2006 New Revision: 454481 URL: http://svn.apache.org/viewvc?view=rev&rev=454481 Log: reusing the XScriptObjectInlineXML(XScriptManager, StringBuffer) constructor Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/xscript/XScriptObjectInlineXML.java Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/xscript/XScriptObjectInlineXML.java URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/xscript/XScriptObjectInlineXML.java?view=diff&rev=454481&r1=454480&r2=454481 ============================================================================== --- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/xscript/XScriptObjectInlineXML.java (original) +++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/xscript/XScriptObjectInlineXML.java Mon Oct 9 13:08:18 2006 @@ -36,51 +36,46 @@ StringBufferContentHandler streamHandler; public XScriptObjectInlineXML(XScriptManager manager) { - super(manager); - stringBuffer = new StringBuffer(); - stringBuffer.append("\n\n"); - streamHandler = new StringBufferContentHandler(stringBuffer); + this(manager, new StringBuffer("\n\n")); } - public XScriptObjectInlineXML(XScriptManager manager, StringBuffer stringBuffer) { - super(manager); - this.stringBuffer = stringBuffer; - streamHandler = new StringBufferContentHandler(stringBuffer); + public XScriptObjectInlineXML(XScriptManager manager, String string) { + this(manager, new StringBuffer(string)); } - public XScriptObjectInlineXML(XScriptManager manager, String string) { + public XScriptObjectInlineXML(XScriptManager manager, StringBuffer stringBuffer) { super(manager); - this.stringBuffer = new StringBuffer(string); - streamHandler = new StringBufferContentHandler(stringBuffer); + this.stringBuffer = stringBuffer; + this.streamHandler = new StringBufferContentHandler(this.stringBuffer); } public InputStream getInputStream() throws IOException { // FIXME(VG): This method should never be used because it // always converts content into system encoding. This will // ruin i18n documents. Use getInputSource() instead. - return new ByteArrayInputStream(stringBuffer.toString().getBytes()); + return new ByteArrayInputStream(this.stringBuffer.toString().getBytes()); } public InputSource getInputSource() throws IOException { - InputSource is = new InputSource(new StringReader(stringBuffer.toString())); + InputSource is = new InputSource(new StringReader(this.stringBuffer.toString())); is.setSystemId(getURI()); return is; } public ContentHandler getContentHandler() { - return streamHandler; + return this.streamHandler; } public String toString() { - return stringBuffer.toString(); + return this.stringBuffer.toString(); } public long getContentLength() { - return stringBuffer.length(); + return this.stringBuffer.length(); } public String getContent() { - return stringBuffer.toString(); + return this.stringBuffer.toString(); } public String getURI() { @@ -88,4 +83,5 @@ // variables by URI return "xscript:inline:" + System.identityHashCode(this); } + }