summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2004-03-08 23:27:04 +0000
committerMark Wielaard <mark@klomp.org>2004-03-08 23:27:04 +0000
commitf3602802525fc8eafffec329a3490f4730cbff1c (patch)
treedaa4c96d4560052d712feea60f4199a2e721bb73
parentbfaed8e1befc4351199d75068dbb7ca7c4001720 (diff)
downloadclasspath-f3602802525fc8eafffec329a3490f4730cbff1c.tar.gz
2004-03-08 Dalibor Topic <robilad@kaffe.org>
* java/text/AttributedString.java (addAttribute(AttributedCharacterIterator.Attribute,Object,int,int)): Use HashMap instead of Hashtable since value can be null, and you can not store a null value in a Hashtable.
-rw-r--r--ChangeLog7
-rw-r--r--java/text/AttributedString.java11
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 9e571c6d0..e3d4a734e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-08 Dalibor Topic <robilad@kaffe.org>
+
+ * java/text/AttributedString.java
+ (addAttribute(AttributedCharacterIterator.Attribute,Object,int,int)):
+ Use HashMap instead of Hashtable since value can be null, and
+ you can not store a null value in a Hashtable.
+
2004-03-08 Guilhem Lavaux <guilhem@kaffe.org>
* java/text/DateFormatSymbols.java: Fixed copyright notice.
diff --git a/java/text/AttributedString.java b/java/text/AttributedString.java
index d689d87ac..a8eede813 100644
--- a/java/text/AttributedString.java
+++ b/java/text/AttributedString.java
@@ -1,5 +1,5 @@
/* AttributedString.java -- Models text with attributes
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,6 +39,7 @@ exception statement from your version. */
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 @@ addAttribute(AttributedCharacterIterator.Attribute attrib, Object value)
* 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 @@ addAttribute(AttributedCharacterIterator.Attribute attrib, Object value,
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);
}
/*************************************************************************/