6612541: api/javax_swing/text/LabelView/index.html#getXXX[LabelView0004] fails since JDK 7 b20
authorgsm
Wed, 15 Jul 2009 19:05:18 +0400
changeset 3340 78a96d1fe557
parent 3243 584da5a15e55
child 3341 9d092207230a
6612541: api/javax_swing/text/LabelView/index.html#getXXX[LabelView0004] fails since JDK 7 b20 Reviewed-by: peterz
jdk/src/share/classes/javax/swing/text/GlyphView.java
--- a/jdk/src/share/classes/javax/swing/text/GlyphView.java	Sun Jul 12 06:07:50 2009 -0700
+++ b/jdk/src/share/classes/javax/swing/text/GlyphView.java	Wed Jul 15 19:05:18 2009 +0400
@@ -719,8 +719,9 @@
             checkPainter();
             int p0 = getStartOffset();
             int p1 = painter.getBoundedPosition(this, p0, pos, len);
-            return ((p1 > p0) && (getBreakSpot(p0, p1) != BreakIterator.DONE)) ?
-                    View.ExcellentBreakWeight : View.BadBreakWeight;
+            return p1 == p0 ? View.BadBreakWeight :
+                   getBreakSpot(p0, p1) != BreakIterator.DONE ?
+                            View.ExcellentBreakWeight : View.GoodBreakWeight;
         }
         return super.getBreakWeight(axis, pos, len);
     }