cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r479303 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/multipart/MultipartParser.java
Date Sun, 26 Nov 2006 06:56:18 GMT
Author: antonio
Date: Sat Nov 25 22:56:17 2006
New Revision: 479303

URL: http://svn.apache.org/viewvc?view=rev&rev=479303
Log:
Don't create new Booleans or emprty strings.

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/multipart/MultipartParser.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/multipart/MultipartParser.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/multipart/MultipartParser.java?view=diff&rev=479303&r1=479302&r2=479303
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/multipart/MultipartParser.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/multipart/MultipartParser.java
Sat Nov 25 22:56:17 2006
@@ -147,12 +147,12 @@
         this.hasSession = this.session != null;
         if (this.hasSession) {
             this.uploadStatus = new Hashtable();
-            this.uploadStatus.put("started", new Boolean(false));
-            this.uploadStatus.put("finished", new Boolean(false));
+            this.uploadStatus.put("started", Boolean.FALSE);
+            this.uploadStatus.put("finished", Boolean.FALSE);
             this.uploadStatus.put("sent", new Integer(0));
             this.uploadStatus.put("total", new Integer(request.getContentLength()));
-            this.uploadStatus.put("filename",  new String());
-            this.uploadStatus.put("error", new Boolean(false));
+            this.uploadStatus.put("filename",  "");
+            this.uploadStatus.put("error", Boolean.FALSE);
             this.uploadStatus.put("uploadsdone", new Integer(0));
             this.session.setAttribute(UPLOAD_STATUS_SESSION_ATTR, this.uploadStatus);
         }
@@ -160,7 +160,7 @@
         parseParts(request.getContentLength(), request.getContentType(), request.getInputStream());
   
 
         if (this.hasSession) {
-            this.uploadStatus.put("finished", new Boolean(true));
+            this.uploadStatus.put("finished", Boolean.TRUE);
         }
 
         return this.parts;    
@@ -285,10 +285,10 @@
         }
         
         if (hasSession) { // upload widget support
-            this.uploadStatus.put("finished", new Boolean(false));
-            this.uploadStatus.put("started", new Boolean(true));
-            this.uploadStatus.put("widget", (String)headers.get("name"));
-            this.uploadStatus.put("filename", (String)headers.get("filename"));
+            this.uploadStatus.put("finished", Boolean.FALSE);
+            this.uploadStatus.put("started", Boolean.TRUE);
+            this.uploadStatus.put("widget", headers.get("name"));
+            this.uploadStatus.put("filename", headers.get("filename"));
         }
         
         int length = 0; // Track length for OversizedPart
@@ -309,7 +309,7 @@
                 this.uploadStatus.put("uploadsdone", 
                     new Integer(((Integer)this.uploadStatus.get("uploadsdone")).intValue()
+ 1)
                 );
-                this.uploadStatus.put("error", new Boolean(false));
+                this.uploadStatus.put("error", Boolean.FALSE);
             }
         } catch (IOException ioe) {
             // don't let incomplete file uploads pile up in the upload dir.
@@ -318,7 +318,7 @@
             out = null;
             if ( file!=null ) file.delete();
             if (this.hasSession) { // upload widget support
-                this.uploadStatus.put("error", new Boolean(true));
+                this.uploadStatus.put("error", Boolean.TRUE);
             }
             throw ioe;
         } finally {



Mime
View raw message