commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r489740 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java
Date Fri, 22 Dec 2006 19:51:20 GMT
Author: bayard
Date: Fri Dec 22 11:51:19 2006
New Revision: 489740

URL: http://svn.apache.org/viewvc?view=rev&rev=489740
Log:
Fixed import. Also optimised list.toArray(..) to use new Token[list.size()] so that the passed
in array is used and not reflection. Latter reported by FindBugs

Modified:
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java?view=diff&rev=489740&r1=489739&r2=489740
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java
Fri Dec 22 11:51:19 2006
@@ -18,6 +18,7 @@
 
 import org.apache.commons.lang.StringUtils;
 
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
@@ -488,7 +489,7 @@
      */
     static Token[] lexx(String format) {
         char[] array = format.toCharArray();
-        java.util.ArrayList list = new java.util.ArrayList(array.length);
+        ArrayList list = new ArrayList(array.length);
 
         boolean inLiteral = false;
         StringBuffer buffer = null;
@@ -539,7 +540,7 @@
                 buffer = null; 
             }
         }
-        return (Token[]) list.toArray( new Token[0] );
+        return (Token[]) list.toArray( new Token[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