commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r490424 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FilenameUtils.java
Date Wed, 27 Dec 2006 01:20:44 GMT
Author: bayard
Date: Tue Dec 26 17:20:43 2006
New Revision: 490424

URL: http://svn.apache.org/viewvc?view=rev&rev=490424
Log:
Added findbugs optimisation: 'http://findbugs.sourceforge.net/bugDescriptions.html#ITA_INEFFICIENT_TO_ARRAY'.
Pass in a correctly sized array to list.toArray

Modified:
    jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FilenameUtils.java

Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FilenameUtils.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FilenameUtils.java?view=diff&rev=490424&r1=490423&r2=490424
==============================================================================
--- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FilenameUtils.java (original)
+++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FilenameUtils.java Tue
Dec 26 17:20:43 2006
@@ -1243,7 +1243,7 @@
             list.add(buffer.toString());
         }
 
-        return (String[]) list.toArray(new String[0]);
+        return (String[]) list.toArray( new String[ list.size() ] );
     }
 
 }



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


Mime
View raw message