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
+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>
* gnu/gcj/convert/Output_UTF8.java (write): Don't exit loop unless
public MessageFormat (String pattern)
{
+ locale = Locale.getDefault();
applyPattern (pattern);
}
public final StringBuffer format (Object obj, StringBuffer sbuf,
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,