MessageFormat.java (MessageFormat(String)): Set the default locale.
1999-09-16 Bryce McKinlay <bryce@albatross.co.nz> * java/text/MessageFormat.java (MessageFormat(String)): Set the default locale. * java/text/NumberFormat.java: Check that object is a Number. If not, throw IllegialArgumentException. From-SVN: r29574
This commit is contained in:
parent
00ec6daa3c
commit
5ab00e275b
3 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
1999-09-16 Bryce McKinlay <bryce@albatross.co.nz>
|
||||||
|
* java/text/MessageFormat.java (MessageFormat(String)): Set the
|
||||||
|
default locale.
|
||||||
|
* java/text/NumberFormat.java: Check that object is a Number. If
|
||||||
|
not, throw IllegialArgumentException.
|
||||||
|
|
||||||
1999-09-21 Tom Tromey <tromey@cygnus.com>
|
1999-09-21 Tom Tromey <tromey@cygnus.com>
|
||||||
|
|
||||||
* gnu/gcj/convert/Output_UTF8.java (write): Don't exit loop unless
|
* gnu/gcj/convert/Output_UTF8.java (write): Don't exit loop unless
|
||||||
|
|
|
@ -400,6 +400,7 @@ public class MessageFormat extends Format
|
||||||
|
|
||||||
public MessageFormat (String pattern)
|
public MessageFormat (String pattern)
|
||||||
{
|
{
|
||||||
|
locale = Locale.getDefault();
|
||||||
applyPattern (pattern);
|
applyPattern (pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,11 @@ public abstract class NumberFormat extends Format implements Cloneable
|
||||||
public final StringBuffer format (Object obj, StringBuffer sbuf,
|
public final StringBuffer format (Object obj, StringBuffer sbuf,
|
||||||
FieldPosition pos)
|
FieldPosition pos)
|
||||||
{
|
{
|
||||||
return format(((Number) obj).doubleValue(), sbuf, pos);
|
if (obj instanceof Number)
|
||||||
|
return format(((Number) obj).doubleValue(), sbuf, pos);
|
||||||
|
else
|
||||||
|
throw new IllegalArgumentException
|
||||||
|
("Cannot format given Object as a Number");
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract StringBuffer format (double number,
|
public abstract StringBuffer format (double number,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue