This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 194282 - [70cat] ArrayIndexOutOfBoundsException: 6032
Summary: [70cat] ArrayIndexOutOfBoundsException: 6032
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Diff (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-12 19:22 UTC by javydreamercsw
Modified: 2011-01-14 06:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 175705


Attachments
stacktrace (5.59 KB, text/plain)
2011-01-12 19:22 UTC, javydreamercsw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description javydreamercsw 2011-01-12 19:22:43 UTC
Build: NetBeans IDE Dev (Build 201101100000)
VM: Java HotSpot(TM) Client VM, 17.1-b03, Java(TM) SE Runtime Environment, 1.6.0_22-b04
OS: Windows XP

User Comments:
javydreamercsw: Formating a huge file 4000+ lines of code




Stacktrace: 
java.lang.ArrayIndexOutOfBoundsException: 6032
   at org.netbeans.lib.editor.util.GapList.get(GapList.java:462)
   at org.netbeans.modules.editor.lib2.view.EditorBoxView.getView(EditorBoxView.java:203)
   at org.netbeans.modules.diff.builtin.visualizer.editable.DiffViewManager$2.run(DiffViewManager.java:576)
   at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1419)
   at org.netbeans.modules.diff.builtin.visualizer.editable.DiffViewManager.getHeight(DiffViewManager.java:569)
   at org.netbeans.modules.diff.builtin.visualizer.editable.DiffViewManager.updateDifferences(DiffViewManager.java:174)
Comment 1 javydreamercsw 2011-01-12 19:22:47 UTC
Created attachment 104935 [details]
stacktrace
Comment 2 Miloslav Metelka 2011-01-13 09:35:22 UTC
Diff module should not operate directly with views since the view hierarchy lock is not acquired in this way:

        editorPane.getDocument().render(new Runnable () {
            @Override
            public void run() {
                try {
                    View rootView = Utilities.getDocumentView(editorPane);
                    int lineNumber = Utilities.getLineOffset((BaseDocument) editorPane.getDocument(), editorPane.getDocument().getLength());
                    if (lineNumber > 0) --lineNumber;
                    View view = rootView.getView(lineNumber);
                    Rectangle rec;
                    if (view != null && (rec = editorPane.modelToView(view.getEndOffset() - 1)) != null) {
                        height[0] = (int) (rec.getY() + rec.getHeight());
                    }
                } catch (BadLocationException ex) {
                    //
                }
            }
        });

Instead please use editorPane.modelToView() / viewToModel() methods.
Comment 3 Ondrej Vrabec 2011-01-13 10:28:29 UTC
fix: #69ceb559b63a - http://hg.netbeans.org/core-main/rev/78f15a0d6684
Comment 4 Quality Engineering 2011-01-14 06:06:09 UTC
Integrated into 'main-golden', will be available in build *201101140000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/78f15a0d6684
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: Issue #194282 - [70cat] ArrayIndexOutOfBoundsException: 6032