[hg] main-silver: #218601 - IndexOutOfBoundsException: Invalid l...

  • From: Miloslav Metelka < >
  • To: ,
  • Subject: [hg] main-silver: #218601 - IndexOutOfBoundsException: Invalid l...
  • Date: Wed, 23 Jan 2013 13:13:05 -0800

changeset d4e2880e9909 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/d4e2880e9909
description:
        #218601 - IndexOutOfBoundsException: Invalid line index=212 >= 
lineCount=212.

diffstat:

 editor.lib2/src/org/netbeans/modules/editor/lib2/view/ViewBuilder.java |  7 
++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (18 lines):

diff --git 
a/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ViewBuilder.java 
b/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ViewBuilder.java
--- a/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ViewBuilder.java
+++ b/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ViewBuilder.java
@@ -310,8 +310,13 @@
             // Either endAffectedOffset points to begining of paragraph or 
inside it
             endCreationOffset = endPView.getStartOffset();
             if (endCreationOffset < endAffectedOffset) { // Inside paragraph
-                endCreationOffset += endPView.getLength();
                 endCreationIndex++;
+                if (endCreationIndex < docView.getViewCount()) {
+                    endPView = docView.getParagraphView(endCreationIndex);
+                    endCreationOffset = endPView.getStartOffset();
+                } else {
+                    endCreationOffset = docView.getDocument().getLength();
+                }
             }
             modOffset = endModOffset = Integer.MIN_VALUE; // No mod
             matchOffset = endCreationOffset;

[hg] main-silver: #218601 - IndexOutOfBoundsException: Invalid l...

Miloslav Metelka 01/23/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close