--- a/jdk/src/share/classes/sun/swing/SwingUtilities2.java Tue Jun 22 12:06:33 2010 +0400
+++ b/jdk/src/share/classes/sun/swing/SwingUtilities2.java Tue Jun 22 14:36:46 2010 +0400
@@ -438,8 +438,12 @@
// c may be null here.
String clipString = "...";
availTextWidth -= SwingUtilities2.stringWidth(c, fm, clipString);
+ if (availTextWidth <= 0) {
+ //can not fit any characters
+ return clipString;
+ }
+
boolean needsTextLayout;
-
synchronized (charsBufferLock) {
int stringLength = syncCharsBuffer(string);
needsTextLayout =