6612541: api/javax_swing/text/LabelView/index.html#getXXX[LabelView0004] fails since JDK 7 b20
Reviewed-by: peterz
--- 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);
}