You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ma...@apache.org on 2005/12/01 08:10:32 UTC

svn commit: r350197 - in /jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload: FileUploadBase.java disk/DiskFileItem.java

Author: martinc
Date: Wed Nov 30 23:10:29 2005
New Revision: 350197

URL: http://svn.apache.org/viewcvs?rev=350197&view=rev
Log:
Fix Checkstyle warnings.

Modified:
    jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/FileUploadBase.java
    jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java

Modified: jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/FileUploadBase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/FileUploadBase.java?rev=350197&r1=350196&r2=350197&view=diff
==============================================================================
--- jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/FileUploadBase.java (original)
+++ jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/FileUploadBase.java Wed Nov 30 23:10:29 2005
@@ -444,8 +444,9 @@
                     if (fileName != null) {
                         fileName = fileName.trim();
                     } else {
-                        // Even if there is no value, the parameter is present, so
-                        // we return an empty file name rather than no file name.
+                        // Even if there is no value, the parameter is present,
+                        // so we return an empty file name rather than no file
+                        // name.
                         fileName = "";
                     }
                 }

Modified: jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java?rev=350197&r1=350196&r2=350197&view=diff
==============================================================================
--- jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java (original)
+++ jakarta/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java Wed Nov 30 23:10:29 2005
@@ -83,7 +83,7 @@
     /**
      * UID used in unique file name generation.
      */
-    private static final String uid =
+    private static final String UID =
             new UID().toString().replace(':', '_').replace('-', '_');
 
     /**
@@ -573,7 +573,7 @@
             tempDir = new File(System.getProperty("java.io.tmpdir"));
         }
 
-        String fileName = "upload_" + uid + "_" + getUniqueId() + ".tmp";
+        String fileName = "upload_" + UID + "_" + getUniqueId() + ".tmp";
 
         File f = new File(tempDir, fileName);
         FileCleaner.track(f, this);
@@ -591,6 +591,7 @@
      * @return A String with the non-random looking instance identifier.
      */
     private static String getUniqueId() {
+        final int limit = 100000000;
         int current;
         synchronized (DiskFileItem.class) {
             current = counter++;
@@ -599,7 +600,7 @@
 
         // If you manage to get more than 100 million of ids, you'll
         // start getting ids longer than 8 characters.
-        if (current < 100000000) {
+        if (current < limit) {
             id = ("00000000" + id).substring(id.length());
         }
         return id;
@@ -610,6 +611,8 @@
 
     /**
      * Returns a string representation of this object.
+     *
+     * @return a string representation of this object.
      */
     public String toString() {
         return "name=" + this.getName()



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