Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 55387 invoked from network); 3 Nov 2007 11:30:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Nov 2007 11:30:35 -0000 Received: (qmail 47855 invoked by uid 500); 3 Nov 2007 11:30:23 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 47794 invoked by uid 500); 3 Nov 2007 11:30:22 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 47783 invoked by uid 99); 3 Nov 2007 11:30:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Nov 2007 04:30:22 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Nov 2007 11:30:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 30A9B1A9832; Sat, 3 Nov 2007 04:30:14 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r591599 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/multipart/MultipartParser.java Date: Sat, 03 Nov 2007 11:30:13 -0000 To: cvs@cocoon.apache.org From: felixk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071103113014.30A9B1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: felixk Date: Sat Nov 3 04:30:13 2007 New Revision: 591599 URL: http://svn.apache.org/viewvc?rev=591599&view=rev Log: Method invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead Creating new instances of java.lang.Boolean wastes memory, since Boolean objects are immutable and there are only two useful values of this type. Use the Boolean.valueOf() method (or Java 1.5 autoboxing) to create Boolean objects instead. 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=591599&r1=591598&r2=591599&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 04:30:13 2007 @@ -146,12 +146,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.valueOf(false)); + this.uploadStatus.put("finished", Boolean.valueOf(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("error", Boolean.valueOf(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", new Boolean(true)); + this.uploadStatus.put("finished", Boolean.valueOf(true)); } return this.parts; @@ -285,8 +285,8 @@ } if (hasSession) { // upload widget support - this.uploadStatus.put("finished", new Boolean(false)); - this.uploadStatus.put("started", new Boolean(true)); + this.uploadStatus.put("finished", Boolean.valueOf(false)); + this.uploadStatus.put("started", Boolean.valueOf(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", new Boolean(false)); + this.uploadStatus.put("error", Boolean.valueOf(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", new Boolean(true)); + this.uploadStatus.put("error", Boolean.valueOf(true)); } throw ioe; } finally {