Author: antonio Date: Tue Jan 11 23:31:47 2005 New Revision: 124946 URL: http://svn.apache.org/viewcvs?view=rev&rev=124946 Log: Create buffer inside the scope and only if needed Modified: cocoon/trunk/tools/src/anttasks/SitemapTask.java
Modified: cocoon/trunk/tools/src/anttasks/SitemapTask.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/tools/src/anttasks/SitemapTask.java?view=diff&rev=124946&p1=cocoon/trunk/tools/src/anttasks/SitemapTask.java&r1=124945&p2=cocoon/trunk/tools/src/anttasks/SitemapTask.java&r2=124946 ============================================================================== --- cocoon/trunk/tools/src/anttasks/SitemapTask.java (original) +++ cocoon/trunk/tools/src/anttasks/SitemapTask.java Tue Jan 11 23:31:47 2005 @@ -401,33 +401,31 @@ } Document doc = parent.getOwnerDocument(); Node node; - StringBuffer buffer = new StringBuffer(); + // first check: deprecated? if ( SitemapTask.this.deprecated || this.getTagValue("deprecated", null) != null ) { indent(parent, 3); - buffer.append("The ") - .append(this.type) + StringBuffer buffer = new StringBuffer("The "); + buffer.append(this.type) .append(" ") .append(this.name) .append(" is deprecated"); node = doc.createComment(buffer.toString()); parent.appendChild(node); newLine(parent); - buffer = new StringBuffer(); } // unstable block? if ( !SitemapTask.this.stable ) { indent(parent, 3); - buffer.append("The ") - .append(this.type) + StringBuffer buffer = new StringBuffer("The "); + buffer.append(this.type) .append(" ") .append(this.name) .append(" is in an unstable block"); node = doc.createComment(buffer.toString()); parent.appendChild(node); newLine(parent); - buffer = new StringBuffer(); } indent(parent, 3);