cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r591649 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/multipart/MultipartParser.java
Date Sat, 03 Nov 2007 16:46:43 GMT
Author: felixk
Date: Sat Nov  3 09:46:31 2007
New Revision: 591649

URL: http://svn.apache.org/viewvc?rev=591649&view=rev
Log:
Thanks to Joerg for spotting.

>> Use the Boolean.valueOf() method (or Java 1.5 autoboxing) to create Boolean objects
instead.

Even better should be the usage of the constants Boolean.FALSE and Boolean.TRUE since the
exact values are known beforehand.

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/multipart/MultipartParser.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/multipart/MultipartParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/multipart/MultipartParser.java?rev=591649&r1=591648&r2=591649&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/multipart/MultipartParser.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/multipart/MultipartParser.java
Sat Nov  3 09:46:31 2007
@@ -146,12 +146,12 @@
         this.hasSession = this.session != null;
         if (this.hasSession) {
             this.uploadStatus = new Hashtable();
-            this.uploadStatus.put("started", Boolean.valueOf(false));
-            this.uploadStatus.put("finished", Boolean.valueOf(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", "");
-            this.uploadStatus.put("error", Boolean.valueOf(false));
+            this.uploadStatus.put("error", Boolean.FALSE);
             this.uploadStatus.put("uploadsdone", new Integer(0));
             this.session.setAttribute(UPLOAD_STATUS_SESSION_ATTR, this.uploadStatus);
         }
@@ -159,7 +159,7 @@
         parseParts(request.getContentLength(), request.getContentType(), request.getInputStream());
   
 
         if (this.hasSession) {
-            this.uploadStatus.put("finished", Boolean.valueOf(true));
+            this.uploadStatus.put("finished", Boolean.TRUE);
         }
 
         return this.parts;    
@@ -285,8 +285,8 @@
         }
         
         if (hasSession) { // upload widget support
-            this.uploadStatus.put("finished", Boolean.valueOf(false));
-            this.uploadStatus.put("started", Boolean.valueOf(true));
+            this.uploadStatus.put("finished", Boolean.FALSE);
+            this.uploadStatus.put("started", Boolean.TRUE);
             this.uploadStatus.put("widget", (String)headers.get("name"));
             this.uploadStatus.put("filename", (String)headers.get("filename"));
         }
@@ -310,7 +310,7 @@
                 this.uploadStatus.put("uploadsdone", 
                     new Integer(((Integer)this.uploadStatus.get("uploadsdone")).intValue()
+ 1)
                 );
-                this.uploadStatus.put("error", Boolean.valueOf(false));
+                this.uploadStatus.put("error", Boolean.FALSE);
             }
         } catch (IOException ioe) {
             // don't let incomplete file uploads pile up in the upload dir.
@@ -319,7 +319,7 @@
             out = null;
             if ( file!=null ) file.delete();
             if (this.hasSession) { // upload widget support
-                this.uploadStatus.put("error", Boolean.valueOf(true));
+                this.uploadStatus.put("error", Boolean.TRUE);
             }
             throw ioe;
         } finally {



Mime
View raw message