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 172884 - javax.swing.text.BadLocationException: Invalid offset=18827 not within <0, 18826>
Summary: javax.swing.text.BadLocationException: Invalid offset=18827 not within <0, 18...
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: issues@editor
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-23 14:03 UTC by mslama
Modified: 2010-02-03 21:50 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 159008


Attachments
stacktrace (3.72 KB, text/plain)
2009-11-30 00:43 UTC, dustin_mccartney
Details
stacktrace (2.85 KB, text/plain)
2009-12-02 09:15 UTC, Alexander Simon
Details
stacktrace (3.45 KB, text/plain)
2009-12-09 08:14 UTC, manuelcarrizo
Details
stacktrace (2.69 KB, text/plain)
2009-12-15 10:50 UTC, manuelcarrizo
Details
stacktrace (2.69 KB, text/plain)
2009-12-16 05:42 UTC, Alexandr Scherbatiy
Details
stacktrace (2.69 KB, text/plain)
2009-12-17 03:04 UTC, Alexandr Scherbatiy
Details
stacktrace (2.69 KB, text/plain)
2009-12-17 03:42 UTC, Alexandr Scherbatiy
Details
stacktrace (4.76 KB, text/plain)
2009-12-18 10:30 UTC, molerat
Details
stacktrace (2.03 KB, text/plain)
2010-01-06 13:39 UTC, manuelcarrizo
Details
stacktrace (2.03 KB, text/plain)
2010-01-12 14:04 UTC, misterm
Details
stacktrace (3.63 KB, text/plain)
2010-01-26 03:11 UTC, Karol Harezlak
Details
stacktrace (3.79 KB, text/plain)
2010-01-26 09:51 UTC, Vladimir Voskresensky
Details
stacktrace (5.93 KB, text/plain)
2010-01-29 10:39 UTC, Vladimir Kvashin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mslama 2009-09-23 14:03:17 UTC
Build: NetBeans IDE Dev (Build 200908022240)
VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Linux, 2.6.24-24-generic, i386
User comments: edit one function....

Stacktrace: 
javax.swing.text.BadLocationException: Invalid offset=18827 not within <0, 18826>
        at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1367)
        at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1362)
        at org.netbeans.editor.Utilities.getRowStart(Utilities.java:154)
        at org.netbeans.editor.Utilities.getRowStart(Utilities.java:137)
        at org.netbeans.modules.showtodos.TodoSourceParsing.parse(TodoSourceParsing.java:73)
        at org.netbeans.modules.showtodos.HighlightTodos.getHighlights(HighlightTodos.java:97)
        at
org.netbeans.modules.editor.lib2.highlighting.CompoundHighlightsContainer.updateCache(CompoundHighlightsContainer.java:301)
        at
org.netbeans.modules.editor.lib2.highlighting.CompoundHighlightsContainer.getHighlights(CompoundHighlightsContainer.java:170)
        at org.netbeans.editor.HighlightingDrawLayer.processOffset(HighlightingDrawLayer.java:618)
        at org.netbeans.editor.HighlightingDrawLayer.isActive(HighlightingDrawLayer.java:344)
        at org.netbeans.editor.DrawEngine.updateOffsetReached(DrawEngine.java:432)
Comment 1 Jiri Kovalsky 2009-11-27 05:30:25 UTC
Reassigning to "contrib" product for evaluation. Still looking for responsible owner.
Comment 2 Jiri Kovalsky 2009-11-27 05:31:16 UTC
Michel, you did some commits to this module. Can you please fix this exception? Thanks a lot!
Comment 3 Michel Graciano 2009-11-27 07:13:18 UTC
Yes, I will take a look at this. This happens some times but I just can't solve it yet. Thanks for the report. Just to be clear, probably I will take a look at this next week.
Comment 4 dustin_mccartney 2009-11-30 00:43:43 UTC
Created attachment 91848 [details]
stacktrace
Comment 5 Alexander Simon 2009-12-02 09:15:09 UTC
Created attachment 91996 [details]
stacktrace
Comment 6 manuelcarrizo 2009-12-09 08:14:33 UTC
Created attachment 92343 [details]
stacktrace

Used autocompletition of #endif in recently opened empty file
Comment 7 manuelcarrizo 2009-12-15 10:50:21 UTC
Created attachment 92623 [details]
stacktrace

Removing lines of a file
Comment 8 Alexandr Scherbatiy 2009-12-16 05:42:42 UTC
Created attachment 92665 [details]
stacktrace
Comment 9 Alexandr Scherbatiy 2009-12-17 03:04:45 UTC
Created attachment 92696 [details]
stacktrace

- Copy the code to the JavaFX editor:
----------------------------------------------------------------------------------
    abstract class MyCustomNode extends CustomNode {

        public var onMouseClickedEvents:( function (s : MouseEvent): Void)[];

        override var onMouseClicked =  function (s: MouseEvent): Void {
            for(event in onMouseClickedEvents){ event(s); }
        }

    }
----------------------------------------------------------------------------------
The exception pops up.
Comment 10 Alexandr Scherbatiy 2009-12-17 03:42:45 UTC
Created attachment 92701 [details]
stacktrace

I see too match .BadLocationException using the JavaFX editor.
Comment 11 Exceptions Reporter 2009-12-17 03:42:58 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=159008
Comment 12 Michel Graciano 2009-12-17 06:58:35 UTC
Well, some errors here are not related with showtodos plugin. The lastest, about JavaFX, the plugin is not even installed. How to proceed with it?
Comment 13 Jiri Kovalsky 2009-12-17 07:06:18 UTC
Please fix only the part in showtodos module and then we can reassign it to JavaFX team.
Comment 14 molerat 2009-12-18 10:30:57 UTC
Created attachment 92766 [details]
stacktrace

I  typed "renderer.draw", pressed ctrl+space, choosed option "drawString(String, int, int, int)" and pressed enter. Everything happened as it should plus  i got exception in IDE.
Comment 15 manuelcarrizo 2010-01-06 13:39:01 UTC
Created attachment 93106 [details]
stacktrace

Editing .cpp file
Comment 16 misterm 2010-01-12 14:04:40 UTC
Created attachment 93233 [details]
stacktrace
Comment 17 Karol Harezlak 2010-01-26 03:11:39 UTC
Created attachment 93548 [details]
stacktrace

While  editing JavaFX code.
Comment 18 Alexandr Scherbatiy 2010-01-26 03:44:05 UTC
I know that the issue is not really the P1 issue.

But it has 11 attached  stacktraces from different modules.
Could the issue be fixed in the first place?
Comment 19 Vladimir Voskresensky 2010-01-26 09:51:16 UTC
Created attachment 93568 [details]
stacktrace
Comment 20 Vladimir Kvashin 2010-01-29 10:39:35 UTC
Created attachment 93659 [details]
stacktrace
Comment 21 Vitezslav Stejskal 2010-02-01 08:40:06 UTC
Some of the recent exceptions come from org.netbeans.modules.editor.url.HighlightURLs.getHighlights(HighlightURLs.java:105). The exceptions from 6.8 builds usually come from org.netbeans.editor.CodeFoldingSideBar.traverseForward(CodeFoldingSideBar.java:332). I'll have a look.
Comment 22 Vitezslav Stejskal 2010-02-02 06:55:35 UTC
http://hg.netbeans.org/jet-main/rev/a2773547af97
Comment 23 Quality Engineering 2010-02-03 21:50:29 UTC
Integrated into 'main-golden', will be available in build *201002040200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/a2773547af97
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #172884: attempting to fix BadLocationExceptions thrown from highlighting layers; also adding more consistency checks for cache update boundaries