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 213179

Summary: javax.swing.text.BadLocationException: Wrong insert position 4377
Product: java Reporter: Exceptions Reporter <exceptions_reporter>
Component: SourceAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED WORKSFORME    
Severity: normal CC: netacq_server, sdedic
Priority: P3    
Version: 7.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 188566
Bug Depends on: 227677    
Bug Blocks:    
Attachments: stacktrace

Description Exceptions Reporter 2012-05-29 15:54:18 UTC
This issue was reported manually by sdedic.
It already has 2 duplicates 


Build: NetBeans IDE 7.1 RC2 (Build 201111302200)
VM: Java HotSpot(TM) 64-Bit Server VM, 21.0-b17, Java(TM) SE Runtime Environment, 1.7.0-b147
OS: Windows 7

User Comments:
netacq_server: While visually editing a component that is not the entire form, used Navigator to remove some components, then tried to rename the in-edit contorl (JPanel).

GUEST: Worked with Swing editor in Design mode. Erased JTree, moved and resized JTable component.
JTable element had two user defined rows with single, string column.




Stacktrace: 
javax.swing.text.BadLocationException: Wrong insert position 4377
   at org.netbeans.editor.BaseDocument.handleInsertString(BaseDocument.java:767)
   at org.netbeans.editor.BaseDocument$FilterBypassImpl.insertString(BaseDocument.java:2347)
   at javax.swing.text.DocumentFilter.insertString(DocumentFilter.java:100)
   at org.openide.text.CloneableEditorSupport$DocFilter.insertString(CloneableEditorSupport.java:2981)
   at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:751)
   at org.netbeans.api.java.source.ModificationResult.processDocumentLocked(ModificationResult.java:400)
Comment 1 Exceptions Reporter 2012-05-29 15:54:24 UTC
Created attachment 120004 [details]
stacktrace
Comment 2 Tomas Pavek 2012-08-27 08:53:28 UTC
Not a bug in GUI builder, but either in java source or the implementation of java source queries.

java.io.IOException
        at org.netbeans.api.java.source.ModificationResult.processDocument(ModificationResult.java:391)
        at org.netbeans.api.java.source.ModificationResult.commit2(ModificationResult.java:333)
        at org.netbeans.api.java.source.ModificationResult.access$000(ModificationResult.java:95)
        at org.netbeans.api.java.source.ModificationResult$2.run(ModificationResult.java:241)
        at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:317)
        at org.openide.text.NbDocument.runAtomic(NbDocument.java:422)
        at org.netbeans.api.java.source.ModificationResult.commit(ModificationResult.java:238)
        at org.netbeans.api.java.source.ModificationResult.commit(ModificationResult.java:201)
        at org.netbeans.modules.java.source.queriesimpl.QueriesControllerImpl.runUpdate(QueriesControllerImpl.java:109)
        at org.netbeans.modules.java.source.queries.api.Updates.update(Updates.java:157)
...

I guess it's hard to find out what was wrong without a reproducible case, unless the bug was known otherwise. We have only two reports from 7.1, nothing from 7.2, so maybe it was fixed.
Comment 3 David Strupl 2012-11-15 13:20:58 UTC
Yes, closing as works for me.