classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Small patch for java/text/AttributedString.java


From: Dalibor Topic
Subject: Small patch for java/text/AttributedString.java
Date: Wed, 21 Jan 2004 14:14:01 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

Hi all,

the attached patch fixes a small problem in AttributedString that prevented FOP from working with it on kaffe.

OK to check in?

2004-01-21  Dalibor Topic <address@hidden>


* libraries/javalib/java/text/AttributedString.java (addAttribute(AttributedCharacterIterator.Attribute,Object,int,int)):
        Use HashMap instead of Hashtable since value can be null, and
        we can not store a null value in a Hashtable.

cheers,
dalibor topic
--- /var/tmp/PROJECTS/classpath//./java/text/AttributedString.java      Tue Jan 
22 23:27:01 2002
+++ java/text/AttributedString.java     Mon Dec  8 17:03:29 2003
@@ -39,6 +39,7 @@
 package java.text;
 
 import java.util.Iterator;
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.HashSet;
 import java.util.Map;
@@ -329,7 +330,7 @@
   * of the string.
   *
   * @param attrib The attribute to add.
-  * @param value The value of the attribute.
+  * @param value The value of the attribute, which may be null.
   * @param begin_index The beginning index of the subrange.
   * @param end_index The ending index of the subrange.
   *
@@ -342,10 +343,10 @@
   if (attrib == null)
     throw new IllegalArgumentException("null attribute");
 
-  Hashtable ht = new Hashtable();
-  ht.put(attrib, value);
+  HashMap hm = new HashMap();
+  hm.put(attrib, value);
 
-  addAttributes(ht, begin_index, end_index);
+  addAttributes(hm, begin_index, end_index);
 }
 
 /*************************************************************************/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]