commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r600607 - /commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/MultiFormatTest.java
Date Mon, 03 Dec 2007 17:21:51 GMT
Author: mbenson
Date: Mon Dec  3 09:21:50 2007
New Revision: 600607

URL: http://svn.apache.org/viewvc?rev=600607&view=rev
Log:
account for unavailability of NumberFormat.getIntegerInstance(...) pre JDK 1.4

Modified:
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/MultiFormatTest.java

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/MultiFormatTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/MultiFormatTest.java?rev=600607&r1=600606&r2=600607&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/MultiFormatTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/MultiFormatTest.java Mon
Dec  3 09:21:50 2007
@@ -86,7 +86,14 @@
         format = new MultiFormat.Builder().add(
                 new GuardedFormat(DateFormat.getDateInstance(DateFormat.SHORT,
                         Locale.US), new Class[] { Date.class })).add(
-                NumberFormat.getIntegerInstance(Locale.US)).toMultiFormat();
+                getIntegerNumberFormat(Locale.US)).toMultiFormat();
+    }
+
+    private NumberFormat getIntegerNumberFormat(Locale locale) {
+        NumberFormat result = NumberFormat.getInstance(locale);
+        result.setMaximumFractionDigits(0);
+        result.setParseIntegerOnly(true);
+        return result;
     }
 
     public void testFormatNumber() {



Mime
View raw message