David Gilbert wrote:
I committed this patch attached to PR29010, after testing it:

2006-09-11  Cameron McCormack  <[EMAIL PROTECTED]>

    Fixes PR29010
    * java/text/AttributedString.java
    (AttributedString(AttributedCharacterIterator, int, int,
    AttributedCharacterIterator.Attribute[])): Fixed check for defined
    attribute.

Mauve tests will be committed shortly. I've assumed that the fix is small enough not to require FSF paperwork.

Regards,

Dave

Sorry, I attached the wrong patch file!

Regards,

Dave

Index: java/text/AttributedString.java
===================================================================
RCS file: /sources/classpath/classpath/java/text/AttributedString.java,v
retrieving revision 1.16
diff -u -r1.16 AttributedString.java
--- java/text/AttributedString.java     18 Jun 2006 00:54:47 -0000      1.16
+++ java/text/AttributedString.java     11 Sep 2006 10:25:51 -0000
@@ -1,5 +1,5 @@
 /* AttributedString.java -- Models text with attributes
-   Copyright (C) 1998, 1999, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2004, 2005, 2006, Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -206,9 +206,10 @@
               (AttributedCharacterIterator.Attribute)obj;
 
             // Make sure the attribute is defined.
-            int rl = aci.getRunLimit(attrib);
-            if (rl == -1)
+            Object attrib_obj = aci.getAttribute(attrib);
+            if (attrib_obj == null)
               continue;
+            int rl = aci.getRunLimit(attrib);
             if (rl > end)
               rl = end;
             rl -= begin;
@@ -220,8 +221,7 @@
 
             // If the attribute run starts before the beginning index, we
             // need to junk it if it is an Annotation.
-            Object attrib_obj = aci.getAttribute(attrib);
-           rs -= begin;
+            rs -= begin;
             if (rs < 0)
               {
                 if (attrib_obj instanceof Annotation)

Reply via email to