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 160441

Summary: javax.swing.text.BadLocationException: Offset 7783 with bias Forward is outside of the view, children = 77 covering offsets <0, 5398>, docLen=5397
Product: obsolete Reporter: Sergey Petrov <sj-nb>
Component: visualwebAssignee: Peter Zavadsky <pzavadsky>
Status: NEW ---    
Severity: blocker CC: jomello_br, kvaso, marco_bresciani, mslama, ouribeb930, rrm6ii1, tomasbabic, zaiboot
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
URL: http://statistics.netbeans.org/exceptions/detail.do?id=147700
Issue Type: DEFECT Exception Reporter: 147700
Attachments: stacktrace

Description Sergey Petrov 2009-03-17 11:21:24 UTC
Build: NetBeans IDE Dev (Build 200903121546)
VM: OpenJDK 64-Bit Server VM, 1.6.0_0-b12, IcedTea6 1.3.1 (6b12-0ubuntu6.1) Runtime Environment, 1.6.0_0-b12
OS: Linux, 2.6.27-13-generic, amd64

User Comments:
marfous: 1, create web app with JavaServer Faces
2, add some label and text field
3, rightclick on both of them and choose Add Binding Attribute
4, click into JSP file and press CTRL + click on textField1
-> exception appears

sergeyp: create sample TravelCenter application,
open Page1
go to java code
add '1' before mthod declaration and after '**/' in the same line.
go to designer.
press link pointing to the error.

GUEST: saving and working with jsp pages

jonathanramsey: I had just used the Remove unused import feature to remove an unused import from a JSF page bean. When I flipped back to the design view, I got this error.



Stacktrace: 
javax.swing.text.BadLocationException: Offset 7783 with bias Forward is outside of the view, children = 77 covering offsets <0, 5398>, docLen=5397
        at org.netbeans.lib.editor.view.GapBoxView.modelToView(GapBoxView.java:1511)
        at org.netbeans.editor.view.spi.LockView.modelToView(LockView.java:423)
        at javax.swing.plaf.basic.BasicTextUI$RootView.modelToView(BasicTextUI.java:1513)
        at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:1051)
        at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:1026)
        at javax.swing.text.JTextComponent.modelToView(JTextComponent.java:1417)
Comment 1 Sergey Petrov 2009-03-17 11:21:35 UTC
Created attachment 78287 [details]
stacktrace
Comment 2 Vitezslav Stejskal 2009-03-20 11:08:45 UTC
My guess is that sometimes e.getEditorPane().getDocument() != getDocument() and then further down the offset where to
scroll is computed from a different document instance than the one that is used in the ePane. Hence ePane.modelToView
crashes.
Comment 3 mslama 2009-03-20 13:38:29 UTC
Sergey as I said in issue #121560 I cannot find Travel Center sample. Please add more details.
Comment 4 Sergey Petrov 2009-03-20 13:49:54 UTC
Yes, it's in visual webplugin,
and have full path 'Samples|Java Web (Visual JSF)|Corporate Travel Center).
Comment 5 mslama 2009-03-24 13:38:54 UTC
Model/model navigation in visualweb is broken. Please first make it work as expected and then if any reproducible
problem persists assign it back to platform/text. I tried to reproduce with dev build as described above:
1. First problem: When I create sample projects there is a lot of errors in 'Page1'.
2. Thanks to problem 1 I am able to reproduce problem 2: When I create another compilation error in 'Page1' navigation
from Design to Source using error link does not work. It navigates me to incorrect link or I get AIOOBE.