From cab1a4bc1e479c28d6abedf4dd2056c5dd21781e Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Sun, 9 Mar 2014 14:41:23 +0100 Subject: [PATCH] Converted all StringBuffers to StringBuilders --- .../org/x4o/xml/conv/text/StringSplitConverter.java | 2 +- .../xml/eld/lang/AttributeFromBodyConfigurator.java | 2 +- .../x4o/xml/eld/lang/ElementModuleBindingHandler.java | 2 +- .../java/org/x4o/xml/eld/xsd/EldXsdWriterElement.java | 4 ++-- .../src/main/java/org/x4o/xml/io/XMLConstants.java | 10 +++++----- .../main/java/org/x4o/xml/io/sax/X4ODebugWriter.java | 4 ++-- .../java/org/x4o/xml/io/sax/X4OEntityResolver.java | 4 ++-- .../main/java/org/x4o/xml/io/sax/X4OErrorHandler.java | 2 +- .../xml/io/sax/ext/AbstractContentWriterHandler.java | 4 ++-- .../org/x4o/xml/lang/DefaultX4OLanguageLoader.java | 4 ++-- .../org/x4o/xml/lang/task/AbstractX4OLanguageTask.java | 2 +- .../org/x4o/xml/lang/task/run/X4OTaskCommandLine.java | 2 +- .../main/java/org/x4o/xml/eld/doc/EldDocWriter.java | 6 +++--- .../org/x4o/xml/eld/doc/EldDocWriterElementClass.java | 2 +- .../org/x4o/xml/eld/doc/EldDocXTreePageWriter.java | 2 +- .../org/x4o/xml/eld/doc/api/AbstractApiDocWriter.java | 4 ++-- .../org/x4o/xml/eld/doc/api/ApiDocContentWriter.java | 4 ++-- .../java/org/x4o/xml/eld/doc/api/ApiDocWriter.java | 8 ++++---- .../org/x4o/xml/eld/doc/api/DefaultPageWriterTree.java | 4 ++-- .../main/java/org/x4o/xml/eld/doc/api/dom/ApiDoc.java | 2 +- 20 files changed, 37 insertions(+), 37 deletions(-) diff --git a/x4o-driver/src/main/java/org/x4o/xml/conv/text/StringSplitConverter.java b/x4o-driver/src/main/java/org/x4o/xml/conv/text/StringSplitConverter.java index a54e2e1..5a57c83 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/conv/text/StringSplitConverter.java +++ b/x4o-driver/src/main/java/org/x4o/xml/conv/text/StringSplitConverter.java @@ -146,7 +146,7 @@ public class StringSplitConverter extends AbstractStringObjectConverter { throw new ObjectConverterException(this,"Step size is wrong; "+steps.size()+" need: "+splitSize); } try { - StringBuffer buf = new StringBuffer(200); + StringBuilder buf = new StringBuilder(200); for (int i=0;i childsAll = element.getAllChilderen(); List childs = ElementType.filterElements(childsAll, elementType); for (int i=0;i prefixMapping = null; private List printedMappings = null; - private StringBuffer startElement = null; + private StringBuilder startElement = null; private boolean printReturn = false; private String lastElement = null; private Stack elements = null; @@ -248,7 +248,7 @@ public class AbstractContentWriterHandler implements ContentHandler { throw new SAXException("LocalName of element is not valid in xml; '"+localName+"'"); } autoCloseStartElement(); - startElement = new StringBuffer(200); + startElement = new StringBuilder(200); startElement.append(getPropertyConfig().getPropertyString(OUTPUT_CHAR_NEWLINE)); for (int i = 0; i < indent; i++) { startElement.append(getPropertyConfig().getPropertyString(OUTPUT_CHAR_TAB)); diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageLoader.java b/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageLoader.java index d1d3152..4151b55 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageLoader.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageLoader.java @@ -267,7 +267,7 @@ TODO: if (language.getLanguageConfiguration().hasX4ODebugWriter()) { } private class ModulesTagHandler extends DefaultHandler2 { - private StringBuffer buf = new StringBuffer(); + private StringBuilder buf = new StringBuilder(); private String loadedFrom = null; private VersionedResources versionedResources = null; private List result = null; @@ -302,7 +302,7 @@ TODO: if (language.getLanguageConfiguration().hasX4ODebugWriter()) { // Get and clear text String value = buf.toString(); - buf = new StringBuffer(); + buf = new StringBuilder(); // Skip root and language and non versions if ("modules".equals(tag)) { diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/task/AbstractX4OLanguageTask.java b/x4o-driver/src/main/java/org/x4o/xml/lang/task/AbstractX4OLanguageTask.java index 8f40c28..819fded 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/task/AbstractX4OLanguageTask.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/task/AbstractX4OLanguageTask.java @@ -64,7 +64,7 @@ public abstract class AbstractX4OLanguageTask implements X4OLanguageTask { if (keys.isEmpty()) { return config; } - StringBuffer buf = new StringBuffer(100); + StringBuilder buf = new StringBuilder(100); buf.append("Error missing value(s) for key(s) {"); for (int i=0;i l = (List)value; if (l.isEmpty()) { @@ -197,7 +197,7 @@ public abstract class AbstractApiDocWriter { return buf.toString(); } if (value instanceof Object[]) { - StringBuffer buf = new StringBuffer(100); + StringBuilder buf = new StringBuilder(100); buf.append("[A: "); Object[] l = (Object[])value; if (l.length==0) { diff --git a/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/api/ApiDocContentWriter.java b/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/api/ApiDocContentWriter.java index c009337..2cbb5cc 100644 --- a/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/api/ApiDocContentWriter.java +++ b/x4o-eld-doc/src/main/java/org/x4o/xml/eld/doc/api/ApiDocContentWriter.java @@ -68,7 +68,7 @@ public class ApiDocContentWriter extends ContentWriterHtml { // ======= Write body printTagStart(Tag.body); - StringBuffer script = new StringBuffer(); + StringBuilder script = new StringBuilder(); script.append("\n"); script.append("\tif (location.href.indexOf('is-external=true') == -1) {\n"); script.append("\t\tparent.document.title=\"");script.append(title);script.append("\";\n"); @@ -300,7 +300,7 @@ public class ApiDocContentWriter extends ContentWriterHtml { } static public String toSafeUri(String...paths) { - StringBuffer result = new StringBuffer(100); + StringBuilder result = new StringBuilder(100); for (int i=0;i resources) throws IOException, SecurityException, InterruptedException { - StringBuffer cssData = new StringBuffer(); + StringBuilder cssData = new StringBuilder(); for (String cssResource:resources) { appendResourceToBuffer(cssData,cssResource); } @@ -891,7 +891,7 @@ public class ApiDocWriter extends AbstractApiDocWriter { } } - private void appendResourceToBuffer(StringBuffer buffer,String resource) throws IOException { + private void appendResourceToBuffer(StringBuilder buffer,String resource) throws IOException { ClassLoader cl = X4OLanguageClassLoader.getClassLoader(); BufferedReader reader = null; try { @@ -948,7 +948,7 @@ public class ApiDocWriter extends AbstractApiDocWriter { } private File createOutputPathFile(File basePath,String...argu) { - StringBuffer buf = new StringBuffer(200); + StringBuilder buf = new StringBuilder(200); buf.append(basePath.getAbsolutePath()); buf.append(File.separatorChar); for (int i=0;i