Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java Tue Apr 12 13:02:41 2005 @@ -1,5 +1,7 @@ package org.apache.beehive.netui.tags; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + //import org.apache.beehive.netui.pageflow.util.URLRewriterService; import org.apache.beehive.netui.tags.html.Html; import org.apache.beehive.netui.tags.javascript.IScriptReporter; @@ -263,7 +265,7 @@ ScriptContainer.SCOPE_ID); if (list == null) return tagId; - StringBuffer sb = new StringBuffer(); + InternalStringBuilder sb = new InternalStringBuilder(); for (int i=0;i<list.size();i++) { sb.append((String) list.get(i)); sb.append('.');
Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java Tue Apr 12 13:02:41 2005 @@ -1,5 +1,7 @@ package org.apache.beehive.netui.tags; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.util.Bundle; import org.apache.beehive.netui.util.logging.Logger; import org.apache.struts.util.ResponseUtils; @@ -156,7 +158,7 @@ int cnt = _errors.size(); - StringBuffer sb = new StringBuffer(128); + InternalStringBuilder sb = new InternalStringBuilder(128); // check the first error to see if we are reporting errors at the end AbstractPageError info = (AbstractPageError) _errors.get(0); @@ -204,7 +206,7 @@ * This method get the current errors and write the formated output * @param sb */ - public static void reportCollectedErrors(StringBuffer sb, JspTag tag) + public static void reportCollectedErrors(InternalStringBuilder sb, JspTag tag) { IErrorReporter er = getErrorReporter(tag); if (er == null) Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/HtmlUtils.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/HtmlUtils.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/HtmlUtils.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/HtmlUtils.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.core.URLCodec; import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender; @@ -127,7 +129,7 @@ public static String escapeEscapes(String val) { assert(val != null); - StringBuffer sb = new StringBuffer(val.length()); + InternalStringBuilder sb = new InternalStringBuilder(val.length()); for (int i = 0; i < val.length(); i++) { char c = val.charAt(i); if (c == '"') { @@ -146,7 +148,7 @@ public static String legacyEscapeEscapes(String val) { assert(val != null); - StringBuffer sb = new StringBuffer(val.length()); + InternalStringBuilder sb = new InternalStringBuilder(val.length()); for (int i = 0; i < val.length(); i++) { char c = val.charAt(i); if (c == '"') { @@ -172,7 +174,7 @@ public static String addParams(String url, Map params, String encoding) throws JspException { - StringBuffer urlBuffer = new StringBuffer(url); + InternalStringBuilder urlBuffer = new InternalStringBuilder(url); try { // Add dynamic parameters if requested Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java Tue Apr 12 13:02:41 2005 @@ -10,6 +10,7 @@ import org.apache.beehive.netui.tags.rendering.*; import org.apache.beehive.netui.util.Bundle; import org.apache.beehive.netui.util.ParamHelper; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; import org.apache.beehive.netui.util.logging.Logger; import org.apache.struts.taglib.html.Constants; @@ -483,7 +484,7 @@ // Emit javascript if this anchor needs to sumbit the form or open a popup window if (_formSubmit && formAction != null || idScript != null || _popupSupport != null) { - StringBuffer script = new StringBuffer(32); + InternalStringBuilder script = new InternalStringBuilder(32); StringBuilderRenderAppender scriptWriter = new StringBuilderRenderAppender(script); if (_formSubmit && formAction != null) Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + //java imports import org.apache.beehive.netui.tags.AbstractSimpleTag; @@ -131,7 +133,7 @@ // evaluate the body, this is called basically so any attributes my be applied. getBufferBody(false); - StringBuffer buf = new StringBuffer(64); + InternalStringBuilder buf = new InternalStringBuilder(64); // calculate the href buf.append(request.getScheme()); Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.core.urls.URLRewriterService; import org.apache.beehive.netui.pageflow.PageFlowUtils; import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils; @@ -400,7 +402,7 @@ //Emit javascript if this button needs to sumbit the form or open a popup window if (idScript != null || _popupSupport != null || buttonDisable || buttonDisableAndSubmit) { ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request); - StringBuffer script = new StringBuffer(32); + InternalStringBuilder script = new InternalStringBuilder(32); StringBuilderRenderAppender scriptWriter = new StringBuilderRenderAppender(script); IScriptReporter sr = getScriptReporter(); Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxGroup.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxGroup.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxGroup.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxGroup.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.pageflow.ProcessPopulate; import org.apache.beehive.netui.script.common.DataAccessProviderStack; import org.apache.beehive.netui.tags.naming.FormDataNameInterceptor; @@ -158,7 +160,7 @@ private String[] _match; // The actual values we will match against, calculated in doStartTag(). private Object _dynamicAttrs; // the Object - private StringBuffer _saveBody; + private InternalStringBuilder _saveBody; private static final List _internalNamingChain; private WriteRenderAppender _writer; @@ -395,7 +397,7 @@ DataAccessProviderStack.addDataAccessProvider(this, pageContext); } - _saveBody = new StringBuffer(128); + _saveBody = new InternalStringBuilder(128); // Continue processing this page return EVAL_BODY_BUFFERED; Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.util.Bundle; import org.apache.struts.Globals; import org.apache.struts.action.ActionMessage; @@ -140,7 +142,7 @@ } // Render the error message appropriately - StringBuffer results = new StringBuffer(128); + InternalStringBuilder results = new InternalStringBuilder(128); String message = null; Iterator reports = null; Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.util.Bundle; import org.apache.struts.Globals; import org.apache.struts.action.ActionMessage; @@ -133,7 +135,7 @@ } // Render the error messages appropriately - StringBuffer results = new StringBuffer(128); + InternalStringBuilder results = new InternalStringBuilder(128); boolean headerDone = false; String message = null; Iterator reports = null; Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Exceptions.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Exceptions.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Exceptions.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Exceptions.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.pageflow.internal.AdapterManager; import org.apache.beehive.netui.tags.AbstractSimpleTag; import org.apache.beehive.netui.util.HtmlExceptionFormatter; @@ -101,7 +103,7 @@ // First look for the exception in the pageflow/struts request attribute. If it's not there, // look for it in the request attribute the container provides for web.xml-configured error // pages. - StringBuffer results = new StringBuffer(128); + InternalStringBuilder results = new InternalStringBuilder(128); PageContext pageContext = getPageContext(); Throwable e = (Throwable) pageContext.getAttribute(Globals.EXCEPTION_KEY, PageContext.REQUEST_SCOPE); Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.core.urls.MutableURI; import org.apache.beehive.netui.core.urls.URLType; import org.apache.beehive.netui.core.urls.URLRewriterService; @@ -858,7 +860,7 @@ * Write a hidden field for a paramter * @param paramName The name of the parameter * @param paramValue The value of the paramter - * @param results The StringBuffer to append the result to + * @param results The InternalStringBuilder to append the result to * @param req THe servlet request */ private void writeHiddenParam(String paramName, String paramValue, AbstractRenderAppender results, Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatDate.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.util.Bundle; import org.apache.beehive.netui.util.logging.Logger; @@ -278,7 +280,7 @@ if (dataToFormat == null) { return null; } - StringBuffer formattedString = new StringBuffer(32); + InternalStringBuilder formattedString = new InternalStringBuilder(32); SimpleDateFormat dateFormat = null; if (getPattern() != null) { Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.util.Bundle; import javax.servlet.jsp.JspException; @@ -200,7 +202,7 @@ if (dataToFormat == null) { return null; } - StringBuffer formattedString = new StringBuffer(32); + InternalStringBuilder formattedString = new InternalStringBuilder(32); DecimalFormat numberFormat = null; // get the number format. The type has been validated when it was set on the tag. Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatString.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.util.Bundle; import javax.servlet.jsp.JspException; @@ -177,7 +179,7 @@ if (dataToFormat == null) { return null; } - StringBuffer formattedString = new StringBuffer(32); + InternalStringBuilder formattedString = new InternalStringBuilder(32); int index = 0; int patternIndex = 0; String unformattedString = dataToFormat.toString(); Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Hidden.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Hidden.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Hidden.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Hidden.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.tags.ByRef; import org.apache.beehive.netui.tags.HtmlUtils; import org.apache.beehive.netui.tags.rendering.*; @@ -159,7 +161,7 @@ nameHtmlControl(_state, ref); if (_value != null) { - StringBuffer sb = new StringBuffer(_value.length() + 16); + InternalStringBuilder sb = new InternalStringBuilder(_value.length() + 16); StringBuilderRenderAppender sbAppend = new StringBuilderRenderAppender(sb); HtmlUtils.filter(_value, sbAppend); _state.value = sb.toString(); Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/LabelBase.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/LabelBase.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/LabelBase.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/LabelBase.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.tags.HtmlUtils; import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender; @@ -156,7 +158,7 @@ protected String formatText(Object text) throws JspException { - StringBuffer errors = null; + InternalStringBuilder errors = null; if (text == null) return null; @@ -170,7 +172,7 @@ // and continue to the next one. if (currentFormatter.hasError()) { if (errors == null) { - errors = new StringBuffer(32); + errors = new InternalStringBuilder(32); } assert(errors != null); errors.append(currentFormatter.getErrorMessage()); Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.pageflow.internal.InternalConstants; import org.apache.beehive.netui.pageflow.scoping.ScopedRequest; import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils; @@ -122,7 +124,7 @@ public String getOnClick(ServletRequest req, String url) { // Build up the string that's passed to javascript open() to specify window features. - StringBuffer features = new StringBuffer(); + InternalStringBuilder features = new InternalStringBuilder(); if (_features != null) { boolean firstOne = true; Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonGroup.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonGroup.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonGroup.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RadioButtonGroup.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.pageflow.ProcessPopulate; import org.apache.beehive.netui.script.common.DataAccessProviderStack; import org.apache.beehive.netui.tags.naming.FormDataNameInterceptor; @@ -156,7 +158,7 @@ private String _match; // The actual values we will match against, calculated in doStartTag(). private String _defaultRadio; // private Object _dynamicAttrs; // The optionsDataSource object - private StringBuffer _saveBody; // The body text + private InternalStringBuilder _saveBody; // The body text private WriteRenderAppender _writer; @@ -305,7 +307,7 @@ } //write(results.toString()); // This is basically this is if enough for 5 options - _saveBody = new StringBuffer(640); + _saveBody = new InternalStringBuilder(640); return EVAL_BODY_INCLUDE; } @@ -365,7 +367,7 @@ if (_cr == null) _cr = TagRenderingBase.Factory.getConstantRendering(req); - //StringBuffer results = new StringBuffer(128); + //InternalStringBuilder results = new InternalStringBuilder(128); if (_saveBody != null) write(_saveBody.toString()); Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.pageflow.ProcessPopulate; import org.apache.beehive.netui.pageflow.RequestParameterHandler; import org.apache.beehive.netui.script.common.DataAccessProviderStack; @@ -923,8 +925,8 @@ { final String END_TOKEN = "</span>"; assert(_saveBody != null); - StringBuffer body = new StringBuffer(_saveBody.length()); - StringBuffer error = new StringBuffer(_saveBody.length()); + InternalStringBuilder body = new InternalStringBuilder(_saveBody.length()); + InternalStringBuilder error = new InternalStringBuilder(_saveBody.length()); // pull out all of the spans These should be legally constructed, otherwise we will ignore them. int len = _saveBody.length(); Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.tags.rendering.AbstractHtmlState; import org.apache.beehive.netui.tags.rendering.OptionTag; import org.apache.beehive.netui.tags.rendering.TagRenderingBase; @@ -261,7 +263,7 @@ // Generate an HTML <option> element - //StringBuffer results = new StringBuffer(128); + //InternalStringBuilder results = new InternalStringBuilder(128); _state.value = _value; // we assume that tagId will over have override id if both Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextBox.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextBox.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextBox.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/TextBox.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.html; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.tags.ByRef; import org.apache.beehive.netui.tags.HtmlUtils; import org.apache.beehive.netui.tags.IHtmlAccessable; @@ -262,7 +264,7 @@ String text = null; if (textObject != null) { text = formatText(textObject); - StringBuffer sb = new StringBuffer(text.length() + 16); + InternalStringBuilder sb = new InternalStringBuilder(text.length() + 16); StringBuilderRenderAppender sbAppend = new StringBuilderRenderAppender(sb); HtmlUtils.filter(text, sbAppend); text = sb.toString(); Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/IScriptReporter.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/IScriptReporter.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/IScriptReporter.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/IScriptReporter.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.javascript; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender; /** @@ -53,7 +55,7 @@ /** * This method will output all of the Script associated with the script reporter. - * @param sb The script is written into the provided StringBuffer. This value must not be null. + * @param sb The script is written into the provided InternalStringBuilder. This value must not be null. */ void writeScript(AbstractRenderAppender sb); } Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptContainer.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptContainer.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptContainer.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptContainer.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.javascript; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.tags.AbstractClassicTag; import org.apache.beehive.netui.tags.TagConfig; import org.apache.beehive.netui.tags.RequestUtils; @@ -172,7 +174,7 @@ /** * This method will output all of the Script associated with the script reporter. - * @param sb The script is written into the provided StringBuffer. This value must not be null. + * @param sb The script is written into the provided InternalStringBuilder. This value must not be null. */ public void writeScript(AbstractRenderAppender sb) { @@ -336,7 +338,7 @@ if (_codeBefore == null || _codeBefore.size() == 0) return; - StringBuffer s = new StringBuffer(256); + InternalStringBuilder s = new InternalStringBuilder(256); for (Iterator i = _codeBefore.iterator(); i.hasNext();) { String code = ( String ) i.next(); @@ -352,7 +354,7 @@ if (_codeAfter == null || _codeAfter.size() == 0) return; - StringBuffer s = new StringBuffer(256); + InternalStringBuilder s = new InternalStringBuilder(256); for (Iterator i = _codeAfter.iterator(); i.hasNext();) { String code = ( String ) i.next(); @@ -466,7 +468,7 @@ if (map == null || map.size() == 0) return null; - StringBuffer results = new StringBuffer(128); + InternalStringBuilder results = new InternalStringBuilder(128); Iterator/*<String>*/ ids = map.keySet().iterator(); while (ids.hasNext()) { String id = (String) ids.next(); Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.javascript; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.tags.RequestUtils; import org.apache.beehive.netui.tags.TagConfig; import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender; @@ -168,7 +170,7 @@ } // without a scripRepoter we need to create the actual JavaScript that will be written out - StringBuffer sb = new StringBuffer(128); + InternalStringBuilder sb = new InternalStringBuilder(128); StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb); getTagIdMapping(tagId, realId, realName, writer); return sb.toString(); @@ -194,7 +196,7 @@ } // without a scripRepoter we need to create the actual JavaScript that will be written out - StringBuffer sb = new StringBuffer(64); + InternalStringBuilder sb = new InternalStringBuilder(64); StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb); getTagIdMapping(tagId, value, writer); return sb.toString(); @@ -210,9 +212,9 @@ public String writeNetuiNameFunctions(IScriptReporter scriptReporter, boolean writeLegacy, boolean writeId, boolean writeName) { // allocate a String Buffer only if there is no script reporter - StringBuffer sb = null; + InternalStringBuilder sb = null; if (scriptReporter == null) - sb = new StringBuffer(256); + sb = new InternalStringBuilder(256); // if we are supporting legacy javascript then output the original javascript method if (TagConfig.isLegacyJavaScript() && writeLegacy) { @@ -238,7 +240,7 @@ /** * This is a static method that will write a consistent look/feel to the * tags and comment markup that appears around the JavaScript. - * @param results the StringBuffer that will have the <script> + * @param results the InternalStringBuilder that will have the <script> * tag written into * @param script the JavaScript block */ @@ -343,7 +345,7 @@ */ private void getTagIdMapping(String tagId, String realId, String realName, AbstractRenderAppender results) { - StringBuffer sb = new StringBuffer(128); + InternalStringBuilder sb = new InternalStringBuilder(128); if (realId != null) { if ((_javaScriptFeatures & CoreScriptFeature.ALLOCATE_ID.value) == 0) { _javaScriptFeatures |= CoreScriptFeature.ALLOCATE_ID.value; @@ -370,7 +372,7 @@ writeScriptBlock(_req, results, sb.toString()); } - private void writeLookupMethod(IScriptReporter scriptReporter, StringBuffer sb, String bundleString, int feature) + private void writeLookupMethod(IScriptReporter scriptReporter, InternalStringBuilder sb, String bundleString, int feature) { if ((_javaScriptFeatures & feature) != 0) return; Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java Tue Apr 12 13:02:41 2005 @@ -17,25 +17,27 @@ */ package org.apache.beehive.netui.tags.rendering; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + /** * This is an implementation of [EMAIL PROTECTED] AbstractRenderAppender} which appends - * Strings to a [EMAIL PROTECTED] java.lang.StringBuffer} + * Strings to a [EMAIL PROTECTED] java.lang.InternalStringBuilder} */ public class StringBuilderRenderAppender extends AbstractRenderAppender { - private StringBuffer _sb; + private InternalStringBuilder _sb; public StringBuilderRenderAppender() { } - public StringBuilderRenderAppender(StringBuffer sb) + public StringBuilderRenderAppender(InternalStringBuilder sb) { _sb = sb; } - public void setStringBuffer(StringBuffer sb) + public void setInternalStringBuilder(InternalStringBuilder sb) { _sb = sb; } Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.rendering; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.tags.html.Html; import org.apache.beehive.netui.util.Bundle; import org.apache.beehive.netui.util.config.ConfigUtil; @@ -130,15 +132,15 @@ /** * Render the start tag for an element. The element will render the tag and all of it's - * attributes into a StringBuffer. - * @param sb A StringBuffer where the element start tag is appended. + * attributes into a InternalStringBuilder. + * @param sb A InternalStringBuilder where the element start tag is appended. * @param renderState The state assocated with the element. */ abstract public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState); /** * Render the end tag for an element. The end tag will be rendered if the tag requires an end tag. - * @param sb A StringBuffer where the element end tag may be appended. + * @param sb A InternalStringBuilder where the element end tag may be appended. */ abstract public void doEndTag(AbstractRenderAppender sb); @@ -167,11 +169,11 @@ } /** - * This method will append an attribute value to a StringBuffer. + * This method will append an attribute value to a InternalStringBuilder. * The method assumes that the attr is not <code>null</code>. If the * <code>value</code> attribute is <code>null</code> the attribute will not be appended to the - * <code>StringBuffer</code>. - * @param buf The StringBuffer to append the attribute into. + * <code>InternalStringBuilder</code>. + * @param buf The InternalStringBuilder to append the attribute into. * @param name The name of the attribute * @param value The value of teh attribute. If this is <code>null</code> the attribute will not be written. */ Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderer.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderer.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderer.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderer.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.tree; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.tags.rendering.AbstractHtmlState; import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender; import org.apache.beehive.netui.util.logging.Logger; @@ -30,11 +32,11 @@ { private static final Logger logger = Logger.getInstance(ServletTreeRenderer.class); AbstractRenderAppender _writer; - StringBuffer _sb; + InternalStringBuilder _sb; ServletTreeRenderer(TreeRenderState trs, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext, - AbstractRenderAppender writer, StringBuffer sb) + AbstractRenderAppender writer, InternalStringBuilder sb) { super(trs, request, response, servletContext); _writer = writer; Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.tree; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.pageflow.requeststate.INameable; import org.apache.beehive.netui.pageflow.requeststate.NameService; import org.apache.beehive.netui.script.ExpressionUpdateException; @@ -116,7 +118,7 @@ private String _treeStyle; // tree style private String _treeStyleClass; // tree class - private StringBuffer _errorText; // Text of any error that may have occurred. + private InternalStringBuilder _errorText; // Text of any error that may have occurred. private String _dataSource = null; // The name of the tree. private boolean _renderTagIdLookup = false; // cause the base javascript support to be output @@ -768,7 +770,7 @@ // prepare to render the tree HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); HttpServletResponse response = (HttpServletResponse) pageContext.getResponse(); - StringBuffer sb = new StringBuffer(1024); + InternalStringBuilder sb = new InternalStringBuilder(1024); StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb); // this is the treeId from the request. If there was an tree expansion this will be @@ -915,7 +917,7 @@ int index = template.indexOf(placeholder); if (index < 0) break; - StringBuffer temp = new StringBuffer(template.substring(0, index)); + InternalStringBuilder temp = new InternalStringBuilder(template.substring(0, index)); temp.append(value); temp.append(template.substring(index + placeholder.length())); template = temp.toString(); @@ -947,7 +949,7 @@ public void collectChildError(String error) { if (_errorText == null) { - _errorText = new StringBuffer(32); + _errorText = new InternalStringBuilder(32); } _errorText.append(error); } Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeCRI.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeCRI.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeCRI.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeCRI.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.tree; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.pageflow.interceptor.InterceptorChain; import org.apache.beehive.netui.pageflow.interceptor.InterceptorException; import org.apache.beehive.netui.pageflow.interceptor.request.RequestInterceptor; @@ -113,7 +115,7 @@ elem.setExpanded(expand); if (expandSvr != null) { - StringBuffer sb = new StringBuffer(1024); + InternalStringBuilder sb = new InternalStringBuilder(1024); StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb); // Start the document writeStartElement(writer, TREE_EXPAND_ELEM); @@ -126,7 +128,7 @@ TreeElement children[] = elem.getChildren(); AttributeRenderer extraAttrs = new AttributeRenderer(); int newLevel = elem.getLevel() + 1; - StringBuffer treeRendering = new StringBuffer(); + InternalStringBuilder treeRendering = new InternalStringBuilder(); TreeElement tmp = elem; InheritableState iState = null; while (iState == null && tmp != null) { Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderer.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderer.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderer.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderer.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.tree; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.core.URLCodec; import org.apache.beehive.netui.pageflow.PageFlowUtils; import org.apache.beehive.netui.pageflow.internal.AdapterManager; @@ -90,7 +92,7 @@ * @param state * @throws javax.servlet.jsp.JspException */ - protected void render(StringBuffer sb, TreeElement node, int level, AttributeRenderer attrs, + protected void render(InternalStringBuilder sb, TreeElement node, int level, AttributeRenderer attrs, InheritableState state) throws JspException { @@ -123,7 +125,7 @@ AttributeRenderer.RemoveInfo removes = attrs.addElement(node); // get the renderers for this tree... - StringBuffer img = new StringBuffer(32); + InternalStringBuilder img = new InternalStringBuilder(32); // Render the beginning of this node @@ -151,7 +153,7 @@ boolean devMode = !AdapterManager.getServletContainerAdapter(servletContext).isInProductionMode(); if (devMode) { boolean error = false; - StringBuffer errorText = new StringBuffer(64); + InternalStringBuilder errorText = new InternalStringBuilder(64); if (node.getName() == null) { errorText.append("name"); error = true; @@ -439,7 +441,7 @@ // Render the label for this node (if any) if (label != null) { if (_trs.escapeContent) { - StringBuffer s = new StringBuffer(label.length() + 16); + InternalStringBuilder s = new InternalStringBuilder(label.length() + 16); StringBuilderRenderAppender sbAppend = new StringBuilderRenderAppender(sb); HtmlUtils.filter(label, sbAppend); label = s.toString(); @@ -453,7 +455,7 @@ String ctnt = node.getContent(); if (ctnt != null) { if (_trs.escapeContent) { - StringBuffer s = new StringBuffer(ctnt.length() + 16); + InternalStringBuilder s = new InternalStringBuilder(ctnt.length() + 16); StringBuilderRenderAppender sbAppend = new StringBuilderRenderAppender(sb); HtmlUtils.filter(ctnt, sbAppend); ctnt = s.toString(); @@ -484,7 +486,7 @@ attrs.removeElement(node, removes); } - private boolean renderExpansionAnchor(StringBuffer sb, TagRenderingBase anchorRenderer, + private boolean renderExpansionAnchor(InternalStringBuilder sb, TagRenderingBase anchorRenderer, TreeElement node, String nodeName, InheritableState state) throws JspException { @@ -534,7 +536,7 @@ * @param encodedNodeName * @return */ - private boolean renderClientExpansionAnchor(StringBuffer sb, TagRenderingBase anchorRenderer, + private boolean renderClientExpansionAnchor(InternalStringBuilder sb, TagRenderingBase anchorRenderer, TreeElement node, String encodedNodeName, InheritableState state) { Modified: incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/IncludeSection.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/IncludeSection.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/IncludeSection.java (original) +++ incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/IncludeSection.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.template; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.tags.AbstractClassicTag; import org.apache.beehive.netui.util.Bundle; import org.apache.beehive.netui.util.logging.Logger; @@ -331,7 +333,7 @@ int pos = in.indexOf(boldStart); if (pos == -1) return in; - StringBuffer sb = new StringBuffer(in.substring(0,pos)); + InternalStringBuilder sb = new InternalStringBuilder(in.substring(0,pos)); int fill = pos+boldStart.length(); pos = in.indexOf(boldEnd,fill); if (pos == -1) Modified: incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Section.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Section.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Section.java (original) +++ incubator/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Section.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.tags.template; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.tags.AbstractClassicTag; import org.apache.beehive.netui.tags.javascript.IScriptReporter; import org.apache.beehive.netui.tags.javascript.ScriptRequestState; @@ -211,7 +213,7 @@ } } if (parentTag instanceof DivPanel) { - StringBuffer results = new StringBuffer(128); + InternalStringBuilder results = new InternalStringBuilder(128); results.append("<div "); renderTagId(results); if (hasErrors()) { @@ -328,7 +330,7 @@ * @param buffer * @return String */ - private final String renderTagId(StringBuffer buffer) + private final String renderTagId(InternalStringBuilder buffer) throws JspException { assert(_name != null); @@ -342,12 +344,12 @@ } /** - * This method will write append an attribute value to a StringBuffer. + * This method will write append an attribute value to a InternalStringBuilder. * The method assumes that the attr is not <code>null</code>. If the * value is <code>null</code> the attribute will not be appended to the - * <code>StringBuffer</code>. + * <code>InternalStringBuilder</code>. */ - private void renderAttribute(StringBuffer buf, String name, String value) + private void renderAttribute(InternalStringBuilder buf, String name, String value) { assert (name != null); if (value == null) Modified: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/MutableURI.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/MutableURI.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/MutableURI.java (original) +++ incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/MutableURI.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.core.urls; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.core.URLCodec; import java.net.URI; @@ -551,7 +553,7 @@ if ( _params == null || _params.isEmpty() ) { return null; } - StringBuffer query = new StringBuffer( 64 ); + InternalStringBuilder query = new InternalStringBuilder( 64 ); boolean firstParam = true; for ( Iterator i = _params.keySet().iterator(); i.hasNext(); ) { @@ -842,7 +844,7 @@ private String getURIString(String paramSeparator) { - StringBuffer buf = new StringBuffer( 128 ); + InternalStringBuilder buf = new InternalStringBuilder( 128 ); // Append the scheme if ( getScheme() != null ) @@ -901,7 +903,7 @@ return url; } - private static void appendEnsureSeparator( StringBuffer buf, String token ) + private static void appendEnsureSeparator( InternalStringBuilder buf, String token ) { if ( token != null && token.length() > 0 ) { Modified: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URLRewriterService.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URLRewriterService.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URLRewriterService.java (original) +++ incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URLRewriterService.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.core.urls; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils; import org.apache.beehive.netui.util.logging.Logger; @@ -69,7 +71,7 @@ { ArrayList/*< URLRewriter >*/ rewriters = getRewriters( request ); - StringBuffer prefix = new StringBuffer(); + InternalStringBuilder prefix = new InternalStringBuilder(); if ( rewriters != null ) { @@ -218,7 +220,7 @@ if ( rewriters.size() > 0 && _log.isInfoEnabled() ) { - StringBuffer message = new StringBuffer(); + InternalStringBuilder message = new InternalStringBuilder(); message.append( "Register exclusive URLRewriter, \""); message.append( rewriter.getClass().getName() ); message.append( "\". This removes any other URLRewriter objects already registered in the chain." ); @@ -232,7 +234,7 @@ { if ( _log.isInfoEnabled() ) { - StringBuffer message = new StringBuffer(); + InternalStringBuilder message = new InternalStringBuilder(); message.append( "Cannot register URLRewriter, \""); message.append( rewriter.getClass().getName() ); message.append( "\". The URLRewriter, \"" ); Modified: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urltemplates/URLTemplate.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urltemplates/URLTemplate.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urltemplates/URLTemplate.java (original) +++ incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urltemplates/URLTemplate.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.core.urltemplates; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -236,7 +238,7 @@ parseTemplate(); } - StringBuffer result = new StringBuffer( _template.length() + 16 ); + InternalStringBuilder result = new InternalStringBuilder( _template.length() + 16 ); for ( java.util.Iterator ii = _parsedTemplate.iterator(); ii.hasNext(); ) { TemplateItem item = ( TemplateItem ) ii.next(); @@ -263,7 +265,7 @@ // check to make sure we don't end up with "//" between components // of the URL - private void appendToResult( StringBuffer result, String value ) + private void appendToResult( InternalStringBuilder result, String value ) { if ( value == null || value.length() == 0 ) return; Modified: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/HtmlExceptionFormatter.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/HtmlExceptionFormatter.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/HtmlExceptionFormatter.java (original) +++ incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/HtmlExceptionFormatter.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.util; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import java.io.PrintWriter; import java.io.StringWriter; @@ -57,7 +59,7 @@ * @return the formatted error message, optionally including the stack trace. */ public static String format(String message, Throwable t, boolean includeStackTrace) { - StringBuffer buf = new StringBuffer(); + InternalStringBuilder buf = new InternalStringBuilder(); if(message != null) { buf.append(message); @@ -92,7 +94,7 @@ } private static final String addStackTrace(Throwable t) { - StringBuffer buf = new StringBuffer(); + InternalStringBuilder buf = new InternalStringBuilder(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); Modified: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigUtil.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigUtil.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigUtil.java (original) +++ incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigUtil.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.util.config; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import java.io.InputStream; import java.io.IOException; import java.util.ArrayList; @@ -133,7 +135,7 @@ // Throw an exception if the XML is invalid. if(!isValid) { - StringBuffer msg = new StringBuffer("Invalid NetUI configuration file."); + InternalStringBuilder msg = new InternalStringBuilder("Invalid NetUI configuration file."); for(int i = 0; i < errorList.size(); i++) { XmlError error = (XmlError)errorList.get(i); Added: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/InternalStringBuilder.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/InternalStringBuilder.java?view=auto&rev=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/InternalStringBuilder.java (added) +++ incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/InternalStringBuilder.java Tue Apr 12 13:02:41 2005 @@ -0,0 +1,147 @@ +/* + * Copyright 2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * $Header:$ + */ +package org.apache.beehive.netui.util.internal; + +import java.io.Serializable; + + +/** + * Unsynchronized alternative to StringBuffer. + */ +public final class InternalStringBuilder + implements Serializable +{ + private char _buffer[]; + private int _length = 0; + private boolean _shared; + + static final long serialVersionUID = 1; + + public InternalStringBuilder() + { + this( 16 ); + } + + public InternalStringBuilder( int length ) + { + _buffer = new char[length]; + _shared = false; + } + + public InternalStringBuilder( String str ) + { + this( str.length() + 16 ); + append( str ); + } + + public int length() + { + return _length; + } + + private final void copyWhenShared() + { + if ( _shared ) + { + char newValue[] = new char[_buffer.length]; + System.arraycopy( _buffer, 0, newValue, 0, _length ); + _buffer = newValue; + _shared = false; + } + } + + public void ensureCapacity( int minCapacity ) + { + int maxCapacity = _buffer.length; + + if ( minCapacity > maxCapacity ) + { + int newCapacity = ( maxCapacity + 1 ) * 2; + if ( minCapacity > newCapacity ) newCapacity = minCapacity; + char newValue[] = new char[newCapacity]; + System.arraycopy( _buffer, 0, newValue, 0, _length ); + _buffer = newValue; + _shared = false; + } + } + + public void setLength( int length ) + { + if ( length < 0 ) throw new StringIndexOutOfBoundsException( length ); + ensureCapacity( length ); + + if ( _length < length ) + { + copyWhenShared(); + while ( _length < length ) + { + _buffer[_length++] = '\0'; + } + } + _length = length; + } + + public char charAt( int index ) + { + if ( index < 0 || index >= _length ) throw new StringIndexOutOfBoundsException( index ); + return _buffer[index]; + } + + public InternalStringBuilder append( Object obj ) + { + return append( String.valueOf( obj ) ); + } + + public InternalStringBuilder append( String str ) + { + if ( str == null ) str = String.valueOf( str ); + int len = str.length(); + ensureCapacity( _length + len ); + copyWhenShared(); + str.getChars( 0, len, _buffer, _length ); + _length += len; + return this; + } + + public InternalStringBuilder append( char c ) + { + ensureCapacity( _length + 1 ); + copyWhenShared(); + _buffer[_length++] = c; + return this; + } + + public InternalStringBuilder append( int i ) + { + return append( String.valueOf( i ) ); + } + + public String toString() + { + _shared = true; + return new String( _buffer, 0, _length ); + } + + public InternalStringBuilder deleteCharAt( int index ) + { + if ( index < 0 || index >= _length ) throw new StringIndexOutOfBoundsException( index ); + System.arraycopy( _buffer, index + 1, _buffer, index, _length - index - 1 ); + _length--; + return this; + } +} Propchange: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/InternalStringBuilder.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/type/TypeUtils.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/type/TypeUtils.java?view=diff&r1=161105&r2=161106 ============================================================================== --- incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/type/TypeUtils.java (original) +++ incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/type/TypeUtils.java Tue Apr 12 13:02:41 2005 @@ -17,6 +17,8 @@ */ package org.apache.beehive.netui.util.type; +import org.apache.beehive.netui.util.internal.InternalStringBuilder; + import java.io.InputStream; import java.math.BigDecimal; import java.math.BigInteger; @@ -194,7 +196,7 @@ if(TO_STRING != null) return TO_STRING; - StringBuffer sb = new StringBuffer(256); + InternalStringBuilder sb = new InternalStringBuilder(256); sb.append(TypeUtils.class.getName() + " regestered converters (class name, TypeConverter implementation):\n"); sb.append(":::::\n"); Iterator iterator = TYPE_CONVERTERS.keySet().iterator();
