Replace StringBuffe with StringBuilder
Issues: SWF-1532
This commit is contained in:
@@ -51,7 +51,7 @@ public class AjaxEventInterceptorRenderer extends DojoElementDecorationRenderer
|
||||
processIds = component.getClientId(context);
|
||||
}
|
||||
String childId = getElementId(context, component);
|
||||
StringBuffer script = new StringBuffer();
|
||||
StringBuilder script = new StringBuilder();
|
||||
script.append("dojo.addOnLoad(function(){");
|
||||
script.append("Spring.addDecoration(new Spring.AjaxEventDecoration({");
|
||||
script.append("event:'" + event + "'");
|
||||
|
||||
@@ -69,7 +69,7 @@ public class DojoElementDecorationRenderer extends BaseSpringJavascriptDecoratio
|
||||
|
||||
ResourceHelper.beginScriptBlock(context);
|
||||
|
||||
StringBuffer script = new StringBuffer();
|
||||
StringBuilder script = new StringBuilder();
|
||||
script.append(" dojo.addOnLoad(function(){dojo.query(" + selector + ").forEach(function(element){");
|
||||
script.append(" Spring.addDecoration(new Spring.ElementDecoration({ ");
|
||||
script.append(" elementId : element, ");
|
||||
|
||||
@@ -8,7 +8,7 @@ public class DojoWidgetRenderer extends DojoElementDecorationRenderer {
|
||||
protected String getDojoAttributesAsString(FacesContext context, UIComponent component) {
|
||||
|
||||
DojoWidget advisor = (DojoWidget) component;
|
||||
StringBuffer attrs = new StringBuffer();
|
||||
StringBuilder attrs = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < advisor.getDojoAttributes().length; i++) {
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ProgressiveCommandButtonRenderer extends BaseDojoComponentRenderer
|
||||
|
||||
public void doRender(FacesContext context, ResponseWriter writer, UIComponent component, String attribute,
|
||||
Object attributeValue, String property) throws IOException {
|
||||
StringBuffer onclick = new StringBuffer();
|
||||
StringBuilder onclick = new StringBuilder();
|
||||
if (attributeValue != null) {
|
||||
String originalOnclick = attributeValue.toString().trim();
|
||||
if (!originalOnclick.endsWith(";")) {
|
||||
@@ -135,7 +135,7 @@ public class ProgressiveCommandButtonRenderer extends BaseDojoComponentRenderer
|
||||
}
|
||||
|
||||
protected String encodeParamsAsObject(FacesContext context, UIComponent component) {
|
||||
StringBuffer paramObj = new StringBuffer();
|
||||
StringBuilder paramObj = new StringBuilder();
|
||||
for (int i = 0; i < component.getChildCount(); i++) {
|
||||
if (component.getChildren().get(i) instanceof UIParameter) {
|
||||
UIParameter param = (UIParameter) component.getChildren().get(i);
|
||||
|
||||
@@ -160,7 +160,7 @@ public class ProgressiveCommandLinkRenderer extends ProgressiveCommandButtonRend
|
||||
} else {
|
||||
super.encodeEnd(context, component);
|
||||
|
||||
StringBuffer decorationParams = new StringBuffer();
|
||||
StringBuilder decorationParams = new StringBuilder();
|
||||
decorationParams.append("{");
|
||||
decorationParams.append("elementId : '" + component.getClientId(context) + "'");
|
||||
|
||||
@@ -183,7 +183,7 @@ public class ProgressiveCommandLinkRenderer extends ProgressiveCommandButtonRend
|
||||
}
|
||||
|
||||
decorationParams.append("}");
|
||||
StringBuffer advisorScript = new StringBuffer();
|
||||
StringBuilder advisorScript = new StringBuilder();
|
||||
advisorScript.append("Spring.addDecoration(new Spring.CommandLinkDecoration(" + decorationParams.toString()
|
||||
+ "));");
|
||||
ResourceHelper.beginScriptBlock(context);
|
||||
@@ -220,7 +220,7 @@ public class ProgressiveCommandLinkRenderer extends ProgressiveCommandButtonRend
|
||||
return "";
|
||||
} else {
|
||||
String params = encodeParamsAsArray(context, component);
|
||||
StringBuffer onclick = new StringBuffer();
|
||||
StringBuilder onclick = new StringBuilder();
|
||||
onclick.append("this.submitFormFromLink('" + RendererUtils.getFormId(context, component) + "','"
|
||||
+ component.getClientId(context) + "', " + params + "); return false;");
|
||||
return onclick.toString();
|
||||
@@ -228,7 +228,7 @@ public class ProgressiveCommandLinkRenderer extends ProgressiveCommandButtonRend
|
||||
}
|
||||
|
||||
protected String encodeParamsAsArray(FacesContext context, UIComponent component) {
|
||||
StringBuffer paramArray = new StringBuffer();
|
||||
StringBuilder paramArray = new StringBuilder();
|
||||
paramArray.append("[");
|
||||
for (int i = 0; i < component.getChildCount(); i++) {
|
||||
if (component.getChildren().get(i) instanceof UIParameter) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ValidateAllRenderer extends BaseSpringJavascriptDecorationRenderer
|
||||
|
||||
ResourceHelper.beginScriptBlock(context);
|
||||
|
||||
StringBuffer script = new StringBuffer();
|
||||
StringBuilder script = new StringBuilder();
|
||||
script.append("Spring.addDecoration(new Spring.ValidateAllDecoration({" + "event : 'onclick', "
|
||||
+ "elementId : '" + advisedChild.getClientId(context) + "'}));");
|
||||
writer.writeText(script, null);
|
||||
|
||||
@@ -160,7 +160,7 @@ public class ResourceHelper {
|
||||
|
||||
public static void endCombineStyles(FacesContext facesContext) throws IOException {
|
||||
List<String> combinedResources = getCombinedResources(facesContext);
|
||||
StringBuffer combinedPath = new StringBuffer();
|
||||
StringBuilder combinedPath = new StringBuilder();
|
||||
for (int i = 0; i < combinedResources.size(); i++) {
|
||||
String resourcePath = combinedResources.get(i);
|
||||
if (i == 1) {
|
||||
|
||||
Reference in New Issue
Block a user