jdk/src/share/classes/javax/swing/text/View.java
changeset 18122 6b948cce3b5b
parent 17689 c6db20805a87
child 20126 e09648d4170c
--- a/jdk/src/share/classes/javax/swing/text/View.java	Thu Jun 06 17:06:22 2013 +0400
+++ b/jdk/src/share/classes/javax/swing/text/View.java	Thu Jun 06 17:59:37 2013 +0400
@@ -1174,7 +1174,7 @@
         // formed by added elements (i.e. they will be updated
         // by initialization.
         index0 = Math.max(index0, 0);
-        index1 = getViewIndex(elem.getDocument().getLength(), Position.Bias.Forward);
+        index1 = Math.max((getViewCount() - 1), 0);
         for (int i = index0; i <= index1; i++) {
             if (! ((i >= hole0) && (i <= hole1))) {
                 v = getView(i);