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 214197 - javax.swing.text.BadLocationException: Wrong (offset+length)=2362 > getLength()=2361
Summary: javax.swing.text.BadLocationException: Wrong (offset+length)=2362 > getLength...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-14 11:35 UTC by Martin Janicek
Modified: 2013-06-10 14:18 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 189494


Attachments
stacktrace (3.50 KB, text/plain)
2012-06-14 11:35 UTC, Martin Janicek
Details
stacktrace (3.50 KB, text/plain)
2013-01-02 22:53 UTC, markiewb
Details
stacktrace (3.49 KB, text/plain)
2013-01-08 19:20 UTC, choces
Details
stacktrace (3.49 KB, text/plain)
2013-03-06 13:57 UTC, Martin Janicek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Janicek 2012-06-14 11:35:19 UTC
This issue was reported manually by pjiricka.
It already has 1 duplicates 


Build: NetBeans IDE 7.2 Beta (Build 201204260929)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.2-b06, Java(TM) SE Runtime Environment, 1.6.0_27-b07
OS: Linux

User Comments:
mjanicek: Using hint changing the call for NbBundle.getMessage to the annotation @Message




Stacktrace: 
javax.swing.text.BadLocationException: Wrong (offset+length)=2362 > getLength()=2361
   at org.netbeans.editor.BaseDocument.handleRemove(BaseDocument.java:921)
   at org.netbeans.editor.BaseDocument$FilterBypassImpl.remove(BaseDocument.java:2404)
   at javax.swing.text.DocumentFilter.remove(DocumentFilter.java:51)
   at org.openide.text.CloneableEditorSupport$DocFilter.remove(CloneableEditorSupport.java:3021)
   at org.netbeans.editor.BaseDocument.remove(BaseDocument.java:901)
   at org.netbeans.api.java.source.ModificationResult.processDocumentLocked(ModificationResult.java:403)
Comment 1 Martin Janicek 2012-06-14 11:35:28 UTC
Created attachment 120841 [details]
stacktrace
Comment 2 Milutin Kristofic 2012-06-14 11:50:16 UTC
It looks it was called in read-only file or in a guarded block.
Comment 3 frederic.deniger 2012-11-20 09:02:03 UTC
In my case, this error happens in a editable block.
Comment 4 markiewb 2013-01-02 22:53:16 UTC
Created attachment 129832 [details]
stacktrace

Used "Use NBBundle.Message" hint to convert @ActionRegistration(displayName="#xxx")
Comment 5 Exceptions Reporter 2013-01-02 22:53:21 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=189494
Comment 6 markiewb 2013-01-02 22:53:54 UTC
I can confirm this issue too. The whole file was editable. No guarding blocks.
Comment 7 choces 2013-01-08 19:20:21 UTC
Created attachment 130013 [details]
stacktrace
Comment 8 Martin Janicek 2013-03-06 13:57:17 UTC
Created attachment 132265 [details]
stacktrace
Comment 9 Quality Engineering 2013-06-10 02:21:46 UTC
Integrated into 'main-golden', will be available in build *201306100004* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7c9786937812
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #214197: when diffing resources, ensure content is taken from the document if it exists, as that is what we have passed to the hint originally, and also its the place where the content will be committed to.
Comment 10 Jan Lahoda 2013-06-10 14:18:43 UTC
Should be fixed by the above changeset.