changeset 1519:b624f8613cc6

6612541: api/javax_swing/text/LabelView/index.html#getXXX[LabelView0004] fails since JDK 7 b20 Reviewed-by: peterz
author gsm
date Wed, 15 Jul 2009 19:05:18 +0400
parents 913ad033bb37
children f727cac13697
files src/share/classes/javax/swing/text/GlyphView.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/swing/text/GlyphView.java	Sun Jul 12 06:07:50 2009 -0700
+++ b/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);
     }