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.
NetBeans IDE Dev (Build 200701211900) 1.5.0_11; Java HotSpot(TM) Client VM 1.5.0_11-b03 Linux version 2.6.12-10-686 running on i386 en_US (nb); UTF-8 I opened attached file. No syntax coloring presented (see attached screenthot) and I got BadLocationException (see attached stack-trace) WARNING [org.netbeans.modules.editor.lib2.highlighting.CompoundHighlightsContainer]: Can't create document position: offset = 166, document.lenght = 0 javax.swing.text.BadLocationException: Invalid offset=166, docLength=0 at org.netbeans.editor.DocumentContent.checkOffset(DocumentContent.java:281)
Created attachment 37559 [details] Java file
Created attachment 37560 [details] exception stack-trace
Created attachment 37561 [details] screenshot of broken syntax coloring
I am getting this exception every-time I move cursor into Editor area ;( After a while closing and reopening file helped - now the syntax coloring works and no exception rises.
I'll have a look. Once you get the exception, the safest thing to do is to close and reopen the file, otherwise the exception is very likely to be triggered again by any repaint operation.
Actually, have you got a reproducible usecase or was it just a random failure? It's some sort of a synchronization problem and I can't reliably reproduce it. Thanks.
Vita, I haven't found reproducible scenario, it happened to me just with this file and only once.
*** Issue 92978 has been marked as a duplicate of this issue. ***
Hopefully fixed now. I was quite successfull in reproducing the problem with ehucka's steps from issue #92978. It also helped to have several java sources ready in the project and keep opening one after each other until one of them wasn't highlighted properly. After that when moving a cursor in this file the exceptions occured. The essential thing was to have the IDE under a load (eg. by parsing rt.jar) when opening the files. Checking in lib/bridge/src/org/netbeans/modules/editor/oldlibbridge/HighlightingDrawLayer.java; /cvs/editor/lib/bridge/src/org/netbeans/modules/editor/oldlibbridge/HighlightingDrawLayer.java,v <-- HighlightingDrawLayer.java new revision: 1.4; previous revision: 1.3 done Checking in libsrc/org/netbeans/editor/BaseTextUI.java; /cvs/editor/libsrc/org/netbeans/editor/BaseTextUI.java,v <-- BaseTextUI.java new revision: 1.83; previous revision: 1.82 done
*** Issue 93067 has been marked as a duplicate of this issue. ***
verified in NB Dev(200702141900)