Author: markt Date: Mon Nov 2 18:45:17 2009 New Revision: 832036 URL: http://svn.apache.org/viewvc?rev=832036&view=rev Log: StringBuffer -> StringBuilder for o.a.jasper
Modified: tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java tomcat/trunk/java/org/apache/jasper/compiler/Dumper.java tomcat/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java tomcat/trunk/java/org/apache/jasper/compiler/Generator.java tomcat/trunk/java/org/apache/jasper/compiler/JDTCompiler.java tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java tomcat/trunk/java/org/apache/jasper/compiler/Node.java tomcat/trunk/java/org/apache/jasper/compiler/PageDataImpl.java tomcat/trunk/java/org/apache/jasper/compiler/Parser.java tomcat/trunk/java/org/apache/jasper/compiler/SmapGenerator.java tomcat/trunk/java/org/apache/jasper/compiler/SmapStratum.java tomcat/trunk/java/org/apache/jasper/compiler/TextOptimizer.java tomcat/trunk/java/org/apache/jasper/compiler/Validator.java tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java tomcat/trunk/java/org/apache/jasper/security/SecurityUtil.java tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Import.java tomcat/trunk/java/org/apache/jasper/xmlparser/TreeNode.java Modified: tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java (original) +++ tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java Mon Nov 2 18:45:17 2009 @@ -685,7 +685,7 @@ protected static final String canonicalURI(String s) { if (s == null) return null; - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); final int len = s.length(); int pos = 0; while (pos < len) { Modified: tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java Mon Nov 2 18:45:17 2009 @@ -85,7 +85,7 @@ public class JasperAntLogger extends DefaultLogger { - protected StringBuffer reportBuf = new StringBuffer(); + protected StringBuilder reportBuf = new StringBuilder(); protected void printMessage(final String message, final PrintStream stream, @@ -124,9 +124,9 @@ String sep = System.getProperty("path.separator"); - StringBuffer errorReport = new StringBuffer(); + StringBuilder errorReport = new StringBuilder(); - StringBuffer info=new StringBuffer(); + StringBuilder info=new StringBuilder(); info.append("Compile: javaFileName=" + javaFileName + "\n" ); info.append(" classpath=" + classpath + "\n" ); @@ -278,7 +278,7 @@ } private String quotePathList(String list) { - StringBuffer result = new StringBuffer(list.length() + 10); + StringBuilder result = new StringBuilder(list.length() + 10); StringTokenizer st = new StringTokenizer(list, File.pathSeparator); while (st.hasMoreTokens()) { String token = st.nextToken(); Modified: tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java Mon Nov 2 18:45:17 2009 @@ -64,7 +64,7 @@ } Object[] args = null; - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (int i=0; i < details.length; i++) { if (details[i].getJspBeginLineNumber() >= 0) { Modified: tomcat/trunk/java/org/apache/jasper/compiler/Dumper.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Dumper.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/Dumper.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/Dumper.java Mon Nov 2 18:45:17 2009 @@ -29,7 +29,7 @@ if (attrs == null) return ""; - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (int i=0; i < attrs.getLength(); i++) { buf.append(" " + attrs.getQName(i) + "=\"" + attrs.getValue(i) + "\""); Modified: tomcat/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java Mon Nov 2 18:45:17 2009 @@ -32,8 +32,8 @@ public class ELFunctionMapper { private int currFunc = 0; - StringBuffer ds; // Contains codes to initialize the functions mappers. - StringBuffer ss; // Contains declarations of the functions mappers. + StringBuilder ds; // Contains codes to initialize the functions mappers. + StringBuilder ss; // Contains declarations of the functions mappers. /** * Creates the functions mappers for all EL expressions in the JSP page. @@ -44,8 +44,8 @@ throws JasperException { ELFunctionMapper map = new ELFunctionMapper(); - map.ds = new StringBuffer(); - map.ss = new StringBuffer(); + map.ds = new StringBuilder(); + map.ss = new StringBuilder(); page.visit(map.new ELFunctionVisitor()); Modified: tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java Mon Nov 2 18:45:17 2009 @@ -86,7 +86,7 @@ */ private ELNode.Nodes parseEL() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); ELexpr = new ELNode.Nodes(); while (hasNext()) { curToken = nextToken(); @@ -176,7 +176,7 @@ */ private String skipUntilEL() { char prev = 0; - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); while (hasNextChar()) { char ch = nextChar(); if (prev == '\\') { @@ -227,7 +227,7 @@ if (hasNextChar()) { char ch = nextChar(); if (Character.isJavaIdentifierStart(ch)) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(ch); while ((ch = peekChar()) != -1 && Character.isJavaIdentifierPart(ch)) { @@ -252,7 +252,7 @@ * '\\', and ('\"', or "\'") */ private Token parseQuotedChars(char quote) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(quote); while (hasNextChar()) { char ch = nextChar(); Modified: tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java Mon Nov 2 18:45:17 2009 @@ -431,7 +431,7 @@ throws IOException, JasperException { ArrayList<JavacErrorDetail> errors = new ArrayList<JavacErrorDetail>(); - StringBuffer errMsgBuf = null; + StringBuilder errMsgBuf = null; int lineNum = -1; JavacErrorDetail javacError = null; @@ -465,7 +465,7 @@ lineNum = -1; } - errMsgBuf = new StringBuffer(); + errMsgBuf = new StringBuilder(); javacError = createJavacError(fname, page, errMsgBuf, lineNum); } @@ -503,7 +503,7 @@ * @throws JasperException */ public static JavacErrorDetail createJavacError(String fname, - Node.Nodes page, StringBuffer errMsgBuf, int lineNum) + Node.Nodes page, StringBuilder errMsgBuf, int lineNum) throws JasperException { return createJavacError(fname, page, errMsgBuf, lineNum, null); } @@ -519,7 +519,7 @@ * @throws JasperException */ public static JavacErrorDetail createJavacError(String fname, - Node.Nodes page, StringBuffer errMsgBuf, int lineNum, + Node.Nodes page, StringBuilder errMsgBuf, int lineNum, JspCompilationContext ctxt) throws JasperException { JavacErrorDetail javacError; // Attempt to map javac error line number to line in JSP page Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Mon Nov 2 18:45:17 2009 @@ -129,7 +129,7 @@ if (s == null) return ""; - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == '"') @@ -151,7 +151,7 @@ */ static String quote(char c) { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); b.append('\''); if (c == '\'') b.append('\\').append('\''); @@ -169,7 +169,7 @@ private String createJspId() { if (this.jspIdPrefix == null) { - StringBuffer sb = new StringBuffer(32); + StringBuilder sb = new StringBuilder(32); String name = ctxt.getServletJavaFileName(); sb.append("jsp_").append(Math.abs(name.hashCode())).append('_'); this.jspIdPrefix = sb.toString(); @@ -829,7 +829,7 @@ if (tx==null) return null; Class<?> type = expectedType; int size = tx.length(); - StringBuffer output = new StringBuffer(size); + StringBuilder output = new StringBuilder(size); boolean el = false; int i = 0; int mark = 0; @@ -1996,7 +1996,7 @@ n.setBeginJavaLine(out.getJavaLine()); out.printin(); - StringBuffer sb = new StringBuffer("out.write(\""); + StringBuilder sb = new StringBuilder("out.write(\""); int initLength = sb.length(); int count = JspUtil.CHUNKSIZE; int srcLine = 0; // relative to starting srouce line @@ -2822,7 +2822,7 @@ } else if (attr.isELInterpreterInput()) { // results buffer - StringBuffer sb = new StringBuffer(64); + StringBuilder sb = new StringBuilder(64); TagAttributeInfo tai = attr.getTagAttributeInfo(); Modified: tomcat/trunk/java/org/apache/jasper/compiler/JDTCompiler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JDTCompiler.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/JDTCompiler.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JDTCompiler.java Mon Nov 2 18:45:17 2009 @@ -106,7 +106,7 @@ Reader reader = new BufferedReader(new InputStreamReader(is, ctxt.getOptions().getJavaEncoding())); char[] chars = new char[8192]; - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); int count; while ((count = reader.read(chars, 0, chars.length)) > 0) { @@ -374,7 +374,7 @@ new String(problems[i].getOriginatingFileName()); try { problemList.add(ErrorDispatcher.createJavacError - (name, pageNodes, new StringBuffer(problem.getMessage()), + (name, pageNodes, new StringBuilder(problem.getMessage()), problem.getSourceLineNumber(), ctxt)); } catch (JasperException e) { log.error("Error visiting node", e); Modified: tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java Mon Nov 2 18:45:17 2009 @@ -39,7 +39,7 @@ private int javaLineNum; private String jspFileName; private int jspBeginLineNum; - private StringBuffer errMsg; + private StringBuilder errMsg; private String jspExtract = null; /** @@ -52,7 +52,7 @@ */ public JavacErrorDetail(String javaFileName, int javaLineNum, - StringBuffer errMsg) { + StringBuilder errMsg) { this.javaFileName = javaFileName; this.javaLineNum = javaLineNum; @@ -77,7 +77,7 @@ int javaLineNum, String jspFileName, int jspBeginLineNum, - StringBuffer errMsg, + StringBuilder errMsg, JspCompilationContext ctxt) { this(javaFileName, javaLineNum, errMsg); @@ -113,7 +113,7 @@ } // copy out a fragment of JSP to display to the user - StringBuffer fragment = new StringBuffer(1024); + StringBuilder fragment = new StringBuilder(1024); int startIndex = Math.max(0, this.jspBeginLineNum-1-3); int endIndex = Math.min( jspLines.length-1, this.jspBeginLineNum-1+3); Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java Mon Nov 2 18:45:17 2009 @@ -68,7 +68,7 @@ private JspCompilationContext ctxt; private PageInfo pageInfo; private String path; - private StringBuffer charBuffer; + private StringBuilder charBuffer; // Node representing the XML element currently being parsed private Node current; @@ -454,7 +454,7 @@ public void characters(char[] buf, int offset, int len) { if (charBuffer == null) { - charBuffer = new StringBuffer(); + charBuffer = new StringBuilder(); } charBuffer.append(buf, offset, len); } Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java Mon Nov 2 18:45:17 2009 @@ -403,9 +403,9 @@ * @param quoted If <strong>true</strong> accept quoted strings. */ String parseToken(boolean quoted) throws JasperException { - StringBuffer stringBuffer = new StringBuffer(); + StringBuilder StringBuilder = new StringBuilder(); skipSpaces(); - stringBuffer.setLength(0); + StringBuilder.setLength(0); if (!hasMoreInput()) { return ""; @@ -423,7 +423,7 @@ ch = nextChar()) { if (ch == '\\') ch = nextChar(); - stringBuffer.append((char) ch); + StringBuilder.append((char) ch); } // Check end of quote, skip closing quote: if (ch == -1) { @@ -443,12 +443,12 @@ peekChar() == '>' || peekChar() == '%') ch = nextChar(); } - stringBuffer.append((char) ch); + StringBuilder.append((char) ch); } while (!isDelimiter()); } } - return stringBuffer.toString(); + return StringBuilder.toString(); } void setSingleFile(boolean val) { Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java Mon Nov 2 18:45:17 2009 @@ -323,7 +323,7 @@ */ private void initClassPath() { - StringBuffer cpath = new StringBuffer(); + StringBuilder cpath = new StringBuilder(); String sep = System.getProperty("path.separator"); if (parentClassLoader instanceof URLClassLoader) { Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java Mon Nov 2 18:45:17 2009 @@ -207,7 +207,7 @@ public static String escapeXml(String s) { if (s == null) return null; - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == '<') { @@ -232,7 +232,7 @@ * string <tt>with</tt>. */ public static String replace(String name, char replace, String with) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); int begin = 0; int end; int last = name.length(); @@ -428,7 +428,7 @@ // the generated Servlet/SimpleTag implements FunctionMapper, so // that machinery is already in place (mroth). targetType = toJavaSourceType(targetType); - StringBuffer call = new StringBuffer( + StringBuilder call = new StringBuilder( "(" + targetType + ") " @@ -745,7 +745,7 @@ } private static String getClassNameBase(String urn) { - StringBuffer base = new StringBuffer("org.apache.jsp.tag.meta."); + StringBuilder base = new StringBuilder("org.apache.jsp.tag.meta."); if (urn != null) { base.append(makeJavaPackage(urn)); base.append('.'); @@ -763,7 +763,7 @@ */ public static final String makeJavaPackage(String path) { String classNameComponents[] = split(path, "/"); - StringBuffer legalClassNames = new StringBuffer(); + StringBuilder legalClassNames = new StringBuilder(); for (int i = 0; i < classNameComponents.length; i++) { legalClassNames.append(makeJavaIdentifier(classNameComponents[i])); if (i < classNameComponents.length - 1) { @@ -813,7 +813,7 @@ * @return Legal Java identifier corresponding to the given identifier */ public static final String makeJavaIdentifier(String identifier) { - StringBuffer modifiedIdentifier = new StringBuffer(identifier.length()); + StringBuilder modifiedIdentifier = new StringBuilder(identifier.length()); if (!Character.isJavaIdentifierStart(identifier.charAt(0))) { modifiedIdentifier.append('_'); } @@ -938,7 +938,7 @@ break; } } - StringBuffer resultType = new StringBuffer(t); + StringBuilder resultType = new StringBuilder(t); for (; dims > 0; dims--) { resultType.append("[]"); } @@ -963,7 +963,7 @@ return binaryName; } - StringBuffer buf = new StringBuffer(binaryName); + StringBuilder buf = new StringBuilder(binaryName); do { buf.setCharAt(c.getName().length(), '.'); c = c.getDeclaringClass(); Modified: tomcat/trunk/java/org/apache/jasper/compiler/Node.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Node.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/Node.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/Node.java Mon Nov 2 18:45:17 2009 @@ -830,7 +830,7 @@ String ret = text; if (ret == null) { if (body != null) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (int i = 0; i < body.size(); i++) { buf.append(body.getNode(i).getText()); } Modified: tomcat/trunk/java/org/apache/jasper/compiler/PageDataImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/PageDataImpl.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/PageDataImpl.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/PageDataImpl.java Mon Nov 2 18:45:17 2009 @@ -53,7 +53,7 @@ private static final String CDATA_END_SECTION = "]]>\n"; // string buffer used to build XML view - private StringBuffer buf; + private StringBuilder buf; /** * Constructor. @@ -69,7 +69,7 @@ page.visit(firstPass); // Second pass - buf = new StringBuffer(); + buf = new StringBuilder(); SecondPassVisitor secondPass = new SecondPassVisitor(page.getRoot(), buf, compiler, firstPass.getJspIdPrefix()); @@ -82,7 +82,7 @@ * @return the input stream of the XML view */ public InputStream getInputStream() { - // Turn StringBuffer into InputStream + // Turn StringBuilder into InputStream try { return new ByteArrayInputStream(buf.toString().getBytes("UTF-8")); } catch (UnsupportedEncodingException uee) { @@ -234,7 +234,7 @@ implements TagConstants { private Node.Root root; - private StringBuffer buf; + private StringBuilder buf; private Compiler compiler; private String jspIdPrefix; private boolean resetDefaultNS = false; @@ -245,7 +245,7 @@ /* * Constructor */ - public SecondPassVisitor(Node.Root root, StringBuffer buf, + public SecondPassVisitor(Node.Root root, StringBuilder buf, Compiler compiler, String jspIdPrefix) { this.root = root; this.buf = buf; Modified: tomcat/trunk/java/org/apache/jasper/compiler/Parser.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Parser.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/Parser.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/Parser.java Mon Nov 2 18:45:17 2009 @@ -220,7 +220,7 @@ private String parseName() throws JasperException { char ch = (char) reader.peekChar(); if (Character.isLetter(ch) || ch == '_' || ch == ':') { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(ch); reader.nextChar(); ch = (char) reader.peekChar(); @@ -263,7 +263,7 @@ */ private String parseQuoted(Mark start, String tx, char quote) throws JasperException { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); int size = tx.length(); int i = 0; while (i < size) { Modified: tomcat/trunk/java/org/apache/jasper/compiler/SmapGenerator.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/SmapGenerator.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/SmapGenerator.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/SmapGenerator.java Mon Nov 2 18:45:17 2009 @@ -111,7 +111,7 @@ // check state and initialize buffer if (outputFileName == null) throw new IllegalStateException(); - StringBuffer out = new StringBuffer(); + StringBuilder out = new StringBuilder(); // start the SMAP out.append("SMAP\n"); Modified: tomcat/trunk/java/org/apache/jasper/compiler/SmapStratum.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/SmapStratum.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/SmapStratum.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/SmapStratum.java Mon Nov 2 18:45:17 2009 @@ -93,7 +93,7 @@ public String getString() { if (inputStartLine == -1 || outputStartLine == -1) throw new IllegalStateException(); - StringBuffer out = new StringBuffer(); + StringBuilder out = new StringBuilder(); out.append(inputStartLine); if (lineFileIDSet) out.append("#" + lineFileID); @@ -295,7 +295,7 @@ if (fileNameList.size() == 0 || lineData.size() == 0) return null; - StringBuffer out = new StringBuffer(); + StringBuilder out = new StringBuilder(); // print StratumSection out.append("*S " + stratumName + "\n"); Modified: tomcat/trunk/java/org/apache/jasper/compiler/TextOptimizer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/TextOptimizer.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/TextOptimizer.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/TextOptimizer.java Mon Nov 2 18:45:17 2009 @@ -32,7 +32,7 @@ private PageInfo pageInfo; private int textNodeCount = 0; private Node.TemplateText firstTextNode = null; - private StringBuffer textBuffer; + private StringBuilder textBuffer; private final String emptyText = new String(""); public TextCatVisitor(Compiler compiler) { @@ -80,7 +80,7 @@ if (textNodeCount++ == 0) { firstTextNode = n; - textBuffer = new StringBuffer(n.getText()); + textBuffer = new StringBuilder(n.getText()); } else { // Append text to text buffer textBuffer.append(n.getText()); Modified: tomcat/trunk/java/org/apache/jasper/compiler/Validator.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Validator.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/Validator.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/Validator.java Mon Nov 2 18:45:17 2009 @@ -418,7 +418,7 @@ private ClassLoader loader; - private final StringBuffer buf = new StringBuffer(32); + private final StringBuilder buf = new StringBuilder(32); private static final JspUtil.ValidAttribute[] jspRootAttrs = { new JspUtil.ValidAttribute("xsi:schemaLocation"), @@ -709,7 +709,7 @@ } // build expression - StringBuffer expr = this.getBuffer(); + StringBuilder expr = this.getBuffer(); expr.append(n.getType()).append('{').append(n.getText()) .append('}'); ELNode.Nodes el = ELParser.parse(expr.toString()); @@ -1363,9 +1363,9 @@ } /* - * Return an empty StringBuffer [not thread-safe] + * Return an empty StringBuilder [not thread-safe] */ - private StringBuffer getBuffer() { + private StringBuilder getBuffer() { this.buf.setLength(0); return this.buf; } @@ -1674,7 +1674,7 @@ ValidationMessage[] errors = tagInfo.validate(n.getTagData()); if (errors != null && errors.length != 0) { - StringBuffer errMsg = new StringBuffer(); + StringBuilder errMsg = new StringBuilder(); errMsg.append("<h3>"); errMsg.append(Localizer.getMessage( "jsp.error.tei.invalid.attributes", n.getQName())); @@ -1764,7 +1764,7 @@ private static void validateXmlView(PageData xmlView, Compiler compiler) throws JasperException { - StringBuffer errMsg = null; + StringBuilder errMsg = null; ErrorDispatcher errDisp = compiler.getErrorDispatcher(); for (Iterator<TagLibraryInfo> iter = @@ -1778,7 +1778,7 @@ ValidationMessage[] errors = tli.validate(xmlView); if ((errors != null) && (errors.length != 0)) { if (errMsg == null) { - errMsg = new StringBuffer(); + errMsg = new StringBuilder(); } errMsg.append("<h3>"); errMsg.append(Localizer.getMessage( Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java (original) +++ tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java Mon Nov 2 18:45:17 2009 @@ -951,7 +951,7 @@ enc = "ISO-8859-1"; // The default request encoding } - StringBuffer out = new StringBuffer(s.length()); + StringBuilder out = new StringBuilder(s.length()); ByteArrayOutputStream buf = new ByteArrayOutputStream(); OutputStreamWriter writer = null; try { Modified: tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java (original) +++ tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java Mon Nov 2 18:45:17 2009 @@ -872,7 +872,7 @@ private static String XmlEscape(String s) { if (s == null) return null; - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == '<') { Modified: tomcat/trunk/java/org/apache/jasper/security/SecurityUtil.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/security/SecurityUtil.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/security/SecurityUtil.java (original) +++ tomcat/trunk/java/org/apache/jasper/security/SecurityUtil.java Mon Nov 2 18:45:17 2009 @@ -55,7 +55,7 @@ char content[] = new char[message.length()]; message.getChars(0, message.length(), content, 0); - StringBuffer result = new StringBuffer(content.length + 50); + StringBuilder result = new StringBuilder(content.length + 50); for (int i = 0; i < content.length; i++) { switch (content[i]) { case '<': Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java (original) +++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java Mon Nov 2 18:45:17 2009 @@ -150,7 +150,7 @@ * taken from org.apache.taglibs.standard.tag.common.core.ImportSupport */ public static String stripSession(String url) { - StringBuffer u = new StringBuffer(url); + StringBuilder u = new StringBuilder(url); int sessionStart; while ((sessionStart = u.toString().indexOf(";" + Constants.SESSION_PARAMETER_NAME + "=")) != -1) { int sessionEnd = u.toString().indexOf(";", sessionStart + 1); @@ -182,16 +182,16 @@ int start = 0; int length = buffer.length(); char[] arrayBuffer = buffer.toCharArray(); - StringBuffer escapedBuffer = null; + StringBuilder escapedBuffer = null; for (int i = 0; i < length; i++) { char c = arrayBuffer[i]; if (c <= HIGHEST_SPECIAL) { char[] escaped = specialCharactersRepresentation[c]; if (escaped != null) { - // create StringBuffer to hold escaped xml string + // create StringBuilder to hold escaped xml string if (start == 0) { - escapedBuffer = new StringBuffer(length + 5); + escapedBuffer = new StringBuilder(length + 5); } // add unescaped portion if (start < i) { Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Import.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Import.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Import.java (original) +++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Import.java Mon Nov 2 18:45:17 2009 @@ -52,7 +52,7 @@ String requestDispatcherName = ctxt.getTemporaryVariableName(); String irwName = ctxt.getTemporaryVariableName(); //ImportResponseWrapper name String brName = ctxt.getTemporaryVariableName(); //BufferedReader name - String sbName = ctxt.getTemporaryVariableName(); //StringBuffer name + String sbName = ctxt.getTemporaryVariableName(); //StringBuilder name String tempStringName = ctxt.getTemporaryVariableName(); //is absolute url @@ -300,7 +300,7 @@ ctxt.generateJavaSource(" }"); ctxt.generateJavaSource(" java.io.BufferedReader " + brName + " = new java.io.BufferedReader(" + tempReaderName + ");"); - ctxt.generateJavaSource(" StringBuffer " + sbName + " = new StringBuffer();"); + ctxt.generateJavaSource(" StringBuilder " + sbName + " = new StringBuilder();"); String index = ctxt.getTemporaryVariableName(); ctxt.generateJavaSource(" int " + index + ";"); ctxt.generateJavaSource(" while(("+index+" = "+brName+".read()) != -1) "+sbName+".append((char)"+index+");"); Modified: tomcat/trunk/java/org/apache/jasper/xmlparser/TreeNode.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/xmlparser/TreeNode.java?rev=832036&r1=832035&r2=832036&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/xmlparser/TreeNode.java (original) +++ tomcat/trunk/java/org/apache/jasper/xmlparser/TreeNode.java Mon Nov 2 18:45:17 2009 @@ -296,7 +296,7 @@ */ public String toString() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); toString(sb, 0, this); return (sb.toString()); @@ -307,14 +307,14 @@ /** - * Append to the specified StringBuffer a character representation of + * Append to the specified StringBuilder a character representation of * this node, with the specified amount of indentation. * - * @param sb The StringBuffer to append to + * @param sb The StringBuilder to append to * @param indent Number of characters of indentation * @param node The TreeNode to be printed */ - protected void toString(StringBuffer sb, int indent, + protected void toString(StringBuilder sb, int indent, TreeNode node) { int indent2 = indent + 2; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org