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.
This bug was originally marked as duplicate of bug 186474, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE Dev (Build 201102200501) VM: Java HotSpot(TM) Client VM, 17.1-b03, Java(TM) SE Runtime Environment, 1.6.0_22-b04 OS: Linux User Comments: aldobrucale: ctrl-z in xml document (spring file in javase project) aldobrucale: ctrl-z in xml Stacktrace: javax.swing.text.BadLocationException: Invalid offset=3689, docLen=3685 at org.netbeans.modules.editor.lib2.view.EditorView.checkBounds(EditorView.java:539) at org.netbeans.modules.editor.lib2.view.EditorView.modelToView(EditorView.java:250) at javax.swing.plaf.basic.BasicTextUI$RootView.modelToView(BasicTextUI.java:1497) at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:1035) at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:1010) at javax.swing.text.JTextComponent.modelToView(JTextComponent.java:1400)
Created attachment 106264 [details] stacktrace
Unfortunately this indicates that views update in insertUpdate/removeUpdate did not update last view's end offset properly and so Rectangle rec2 = component.modelToView(view.getEndOffset() - 1); picks a wrong offset. Is this a reproducible problem or random?
It happens randomly, but it does happen once in a while. I was undoing a long list of changes, keeping ctrl-z pressed: may be a threading problem? Is there any runtime flag I may set to facilitate debugging if it happens again?
Yes, it was a race condition. I believe that the changes in issue 195432 should eliminate this problem as well so I mark it as duplicate. If the problem would persist even in 7.0 RC1 please reopen the issue. Thanks. *** This bug has been marked as a duplicate of bug 195432 ***