8078483: Apparent endless loop running JEditorPanePaintTest
authorssadetsky
Tue, 12 May 2015 09:22:53 +0300
changeset 30926 59dd8fec081b
parent 30925 82638cf1cd30
child 30927 463e3064cd46
8078483: Apparent endless loop running JEditorPanePaintTest Reviewed-by: serb, alexsch
jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Tue May 12 09:18:31 2015 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Tue May 12 09:22:53 2015 +0300
@@ -936,8 +936,9 @@
             ((AbstractDocument)doc).readLock();
         }
         try {
-            if ((d.width > (i.left + i.right)) && (d.height > (i.top + i.bottom))) {
-                rootView.setSize(d.width - i.left - i.right, d.height - i.top - i.bottom);
+            if ((d.width > (i.left + i.right + caretMargin)) && (d.height > (i.top + i.bottom))) {
+                rootView.setSize(d.width - i.left - i.right -
+                        caretMargin, d.height - i.top - i.bottom);
             }
             else if (d.width == 0 || d.height == 0) {
                 // Probably haven't been layed out yet, force some sort of