tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r832017 - in /tomcat/trunk/java/org/apache/catalina/servlets: CGIServlet.java DefaultServlet.java WebdavServlet.java
Date Mon, 02 Nov 2009 18:33:42 GMT
Author: markt
Date: Mon Nov  2 18:33:41 2009
New Revision: 832017

URL: http://svn.apache.org/viewvc?rev=832017&view=rev
Log:
StringBuffer -> StringBuilder for o.a.c.servlets

Modified:
    tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java
    tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
    tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java

Modified: tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java?rev=832017&r1=832016&r2=832017&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java Mon Nov  2 18:33:41 2009
@@ -1078,8 +1078,8 @@
          * directory to enable CGI script to be executed.
          */
         protected void expandCGIScript() {
-            StringBuffer srcPath = new StringBuffer();
-            StringBuffer destPath = new StringBuffer();
+            StringBuilder srcPath = new StringBuilder();
+            StringBuilder destPath = new StringBuilder();
             InputStream is = null;
 
             // paths depend on mapping
@@ -1170,7 +1170,7 @@
          */
         public String toString() {
 
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
 
             sb.append("<TABLE border=2>");
 
@@ -1585,7 +1585,7 @@
             int bufRead = -1;
 
             //create query arguments
-            StringBuffer cmdAndArgs = new StringBuffer();
+            StringBuilder cmdAndArgs = new StringBuilder();
             if (command.indexOf(" ") < 0) {
                 cmdAndArgs.append(command);
             } else {
@@ -1608,7 +1608,7 @@
                 }
             }
 
-            StringBuffer command = new StringBuffer(cgiExecutable);
+            StringBuilder command = new StringBuilder(cgiExecutable);
             command.append(" ");
             command.append(cmdAndArgs.toString());
             cmdAndArgs = command;

Modified: tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java?rev=832017&r1=832016&r2=832017&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java Mon Nov  2 18:33:41
2009
@@ -377,7 +377,7 @@
     protected void doOptions(HttpServletRequest req, HttpServletResponse resp)
         throws ServletException, IOException {
 
-        StringBuffer allow = new StringBuffer();
+        StringBuilder allow = new StringBuilder();
         // There is a doGet method
         allow.append("GET, HEAD");
         // There is a doPost
@@ -635,7 +635,7 @@
     /**
      * Display the size of a file.
      */
-    protected void displaySize(StringBuffer buf, int filesize) {
+    protected void displaySize(StringBuilder buf, int filesize) {
 
         int leftside = filesize / 1024;
         int rightside = (filesize % 1024) / 103;  // makes 1 digit
@@ -1149,7 +1149,7 @@
                                     InputStream xsltInputStream)
         throws IOException, ServletException {
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append("<?xml version=\"1.0\"?>");
         sb.append("<listing ");
@@ -1275,7 +1275,7 @@
         OutputStreamWriter osWriter = new OutputStreamWriter(stream, "UTF8");
         PrintWriter writer = new PrintWriter(osWriter);
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         
         // rewriteUrl(contextPath) is expensive. cache result for later reuse
         String rewrittenContextPath =  rewriteUrl(contextPath);

Modified: tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java?rev=832017&r1=832016&r2=832017&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java Mon Nov  2 18:33:41
2009
@@ -406,7 +406,7 @@
 
         resp.addHeader("DAV", "1,2");
 
-        StringBuffer methodsAllowed = determineMethodsAllowed(resources,
+        StringBuilder methodsAllowed = determineMethodsAllowed(resources,
                                                               req);
 
         resp.addHeader("Allow", methodsAllowed.toString());
@@ -423,7 +423,7 @@
 
         if (!listings) {
             // Get allowed methods
-            StringBuffer methodsAllowed = determineMethodsAllowed(resources,
+            StringBuilder methodsAllowed = determineMethodsAllowed(resources,
                                                                   req);
 
             resp.addHeader("Allow", methodsAllowed.toString());
@@ -728,7 +728,7 @@
         // path
         if (exists) {
             // Get allowed methods
-            StringBuffer methodsAllowed = determineMethodsAllowed(resources,
+            StringBuilder methodsAllowed = determineMethodsAllowed(resources,
                                                                   req);
 
             resp.addHeader("Allow", methodsAllowed.toString());
@@ -2600,7 +2600,7 @@
      * Get creation date in ISO format.
      */
     private String getISOCreationDate(long creationDate) {
-        StringBuffer creationDateValue = new StringBuffer
+        StringBuilder creationDateValue = new StringBuilder
             (creationDateFormat.format
              (new Date(creationDate)));
         /*
@@ -2627,10 +2627,10 @@
      * Determines the methods normally allowed for the resource.
      *
      */
-    private StringBuffer determineMethodsAllowed(DirContext resources,
+    private StringBuilder determineMethodsAllowed(DirContext resources,
                                                  HttpServletRequest req) {
 
-        StringBuffer methodsAllowed = new StringBuffer();
+        StringBuilder methodsAllowed = new StringBuilder();
         boolean exists = true;
         Object object = null;
         try {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message