You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2007/12/03 18:21:51 UTC
svn commit: r600607 -
/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/MultiFormatTest.java
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() {