OSDN Git Service

2005-04-19 vid Gilbert <david.gilbert@object-refinery.com>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Apr 2005 05:05:32 +0000 (05:05 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Apr 2005 05:05:32 +0000 (05:05 +0000)
* java/awt/Font.java (decode): Handle null argument and allow
space as delimiter.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98373 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/awt/Font.java

index 1aa3fc0..378723b 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-19  vid Gilbert <david.gilbert@object-refinery.com>
+
+       * java/awt/Font.java (decode): Handle null argument and allow
+       space as delimiter.
+
 2005-04-19  Robert Schuster <thebohemian@gmx.net>
 
        * java/beans/EventHandler.java: Reworked documentation.
index c432977..ec74e14 100644 (file)
@@ -209,14 +209,21 @@ private static final long serialVersionUID = -4206021311591459213L;
   * The style should be one of BOLD, ITALIC, or BOLDITALIC.  The default
   * style if none is specified is PLAIN.  The default size if none
   * is specified is 12.
+  * 
+  * @param fontspec  a string specifying the required font (<code>null</code> 
+  *                  permitted, interpreted as 'Dialog-PLAIN-12').
+  * 
+  * @return A font.
   */
   public static Font decode (String fontspec)
 {
+  if (fontspec == null) 
+    fontspec = "Dialog-PLAIN-12";
   String name = null;
   int style = PLAIN;
   int size = 12;
 
-  StringTokenizer st = new StringTokenizer(fontspec, "-");
+  StringTokenizer st = new StringTokenizer(fontspec, "- ");
   while (st.hasMoreTokens())
     {
       String token = st.nextToken();