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 164342 - [67cat] javax.swing.text.BadLocationException: Invalid offset=7012, docLength=6998
Summary: [67cat] javax.swing.text.BadLocationException: Invalid offset=7012, docLength...
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Miloslav Metelka
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks: 174597 174688
  Show dependency tree
 
Reported: 2009-05-03 17:41 UTC by brettryan
Modified: 2009-11-05 23:50 UTC (History)
32 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 150519


Attachments
stacktrace (2.52 KB, text/plain)
2009-05-03 17:41 UTC, brettryan
Details
stacktrace (4.88 KB, text/plain)
2009-05-19 16:00 UTC, lhochet
Details
stacktrace (2.88 KB, text/plain)
2009-05-30 19:50 UTC, smsmithee
Details
stacktrace (5.08 KB, text/plain)
2009-08-14 14:47 UTC, Milos Kleint
Details
stacktrace (2.88 KB, text/plain)
2009-08-27 14:36 UTC, denbo
Details
stacktrace (2.62 KB, text/plain)
2009-09-17 09:32 UTC, Michal Mocnak
Details
pom file (6.82 KB, text/xml)
2009-10-01 15:52 UTC, Michal Mocnak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description brettryan 2009-05-03 17:41:13 UTC
This issue was originally marked as duplicate of issue 114828, that is already fixed. This issue is still valid, so this seems to be another issue, but it might be related.

Build: NetBeans IDE Dev (Build 200905021401)
VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_07-b06-57, Java(TM) SE Runtime Environment, 1.6.0_07-b06-153
OS: Mac OS X, 10.5.6, x86_64

User Comments:
brettryan: Trying to add error page to web.xml
1. Created page, saved and deployed
2. Opened web.xml
3. Chose `Pages' tab
4. Clicked `Add' under "Error Pages".
5. Entered page by browsing `/error/403.html' and entered `403' as error code.
6. Cicked `Accept', and error raised.

GUEST: N�o sei bem quando o erro ocorreu, somente percebi quando cliquei no bot�o "Adicionar elemento servlet...".



Stacktrace: 
javax.swing.text.BadLocationException: Invalid offset=7012, docLength=6998
        at org.netbeans.editor.DocumentContent.checkOffset(DocumentContent.java:326)
        at org.netbeans.editor.DocumentContent.createPosition(DocumentContent.java:117)
        at javax.swing.text.AbstractDocument.createPosition(AbstractDocument.java:816)
        at org.netbeans.api.editor.fold.Fold.updateGuardedStartPos(Fold.java:411)
        at org.netbeans.api.editor.fold.Fold.insertUpdate(Fold.java:444)
        at org.netbeans.api.editor.fold.FoldHierarchy$ApiPackageAccessorImpl.foldInsertUpdate(FoldHierarchy.java:413)
Comment 1 brettryan 2009-05-03 17:41:19 UTC
Created attachment 81435 [details]
stacktrace
Comment 2 Vitezslav Stejskal 2009-05-18 14:06:19 UTC
Is this reliably reproducible? I tried the steps in my dev build and got no exception.
Comment 3 lhochet 2009-05-19 16:00:21 UTC
Build: NetBeans IDE Dev (Build 200905180201)
VM: Java HotSpot(TM) Client VM, 14.0-b13, Java(TM) SE Runtime Environment, 1.6.0_14-ea-b04
OS: Windows Vista, 6.0, x86

User Comments: 
attemting to add an annotation to a simple type in a XML Schema using the schema view

Stacktrace: 
javax.swing.text.BadLocationException: Invalid offset=2747, docLength=2734
        at org.netbeans.editor.DocumentContent.checkOffset(DocumentContent.java:326)
        at org.netbeans.editor.DocumentContent.createPosition(DocumentContent.java:117)
        at javax.swing.text.AbstractDocument.createPosition(AbstractDocument.java:816)
        at org.netbeans.api.editor.fold.Fold.updateGuardedStartPos(Fold.java:411)
        at org.netbeans.api.editor.fold.Fold.insertUpdate(Fold.java:444)
        at org.netbeans.api.editor.fold.FoldHierarchy$ApiPackageAccessorImpl.foldInsertUpdate(FoldHierarchy.java:413)
Comment 4 lhochet 2009-05-19 16:00:32 UTC
Created attachment 82408 [details]
stacktrace
Comment 5 smsmithee 2009-05-30 19:50:27 UTC
This issue was originally marked as duplicate of issue 114828, that is already resolved. This issue is still valid, so this seems to be another issue, but it might be related.

Build: NetBeans IDE Dev (Build 200905271401)
VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Windows XP, 5.1, x86

User Comments: 
Used Java Hint to remove an explicit version from the maven compiler plugin

Stacktrace: 
javax.swing.text.BadLocationException: Invalid offset=1963, docLength=1949
        at org.netbeans.editor.DocumentContent.checkOffset(DocumentContent.java:326)
        at org.netbeans.editor.DocumentContent.createPosition(DocumentContent.java:117)
        at javax.swing.text.AbstractDocument.createPosition(AbstractDocument.java:816)
        at org.netbeans.api.editor.fold.Fold.updateGuardedStartPos(Fold.java:411)
        at org.netbeans.api.editor.fold.Fold.insertUpdate(Fold.java:444)
        at org.netbeans.api.editor.fold.FoldHierarchy$ApiPackageAccessorImpl.foldInsertUpdate(FoldHierarchy.java:413)
Comment 6 smsmithee 2009-05-30 19:50:31 UTC
Created attachment 83016 [details]
stacktrace
Comment 7 Exceptions Reporter 2009-05-31 08:41:40 UTC
This issue already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=150519
Comment 8 David Strupl 2009-06-08 13:59:11 UTC
Marek, these are yours now ...
Comment 9 Exceptions Reporter 2009-06-21 15:36:05 UTC
This issue already has 14 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=150519
Comment 10 Exceptions Reporter 2009-07-02 13:33:26 UTC
This issue already has 21 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=150519
Comment 11 Exceptions Reporter 2009-07-08 09:20:43 UTC
This issue already has 23 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=150519
Comment 12 Milos Kleint 2009-08-14 14:46:59 UTC
This issue was originally marked as duplicate of issue 114828, that is already resolved. This issue is still valid, so this seems to be another issue, but it might be related.

Build: NetBeans IDE Dev (Build 090814)
VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Linux, 2.6.29.6-desktop-1mnb, i386

User Comments: 
updating the pom.xml file by using a code generator with is using xam model as the base.

Stacktrace: 
javax.swing.text.BadLocationException: Invalid offset=2621, docLength=2619
        at org.netbeans.editor.DocumentContent.checkOffset(DocumentContent.java:326)
        at org.netbeans.editor.DocumentContent.createPosition(DocumentContent.java:117)
        at javax.swing.text.AbstractDocument.createPosition(AbstractDocument.java:816)
        at org.netbeans.api.editor.fold.Fold.updateGuardedStartPos(Fold.java:411)
        at org.netbeans.api.editor.fold.Fold.insertUpdate(Fold.java:444)
        at org.netbeans.api.editor.fold.FoldHierarchy$ApiPackageAccessorImpl.foldInsertUpdate(FoldHierarchy.java:413)
Comment 13 Milos Kleint 2009-08-14 14:47:05 UTC
Created attachment 86250 [details]
stacktrace
Comment 14 Exceptions Reporter 2009-08-25 11:41:35 UTC
This issue already has 51 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=150519
Comment 15 Vitezslav Stejskal 2009-08-25 14:32:46 UTC
It would be great to have reliable steps to reproduce this.
Comment 16 denbo 2009-08-27 14:36:53 UTC
Build: NetBeans IDE Dev (Build 200908022240)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33
OS: Windows Vista, 6.0, x86

User Comments: 
In a Maven pom.xml file (created by NB) clicked on hint (lightbulb with yellow warning sign) in gutter, selected "Remove explicit version declaration." 
The respective line was the <version>2.2</version> one.

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-resources-plugin</artifactId>
	<version>2.2</version>
	<configuration>
		<encoding>${project.build.sourceEncoding}</encoding>
	</configuration>
</plugin>

Stacktrace: 
javax.swing.text.BadLocationException: Invalid offset=3659, docLength=3647
        at org.netbeans.editor.DocumentContent.checkOffset(DocumentContent.java:326)
        at org.netbeans.editor.DocumentContent.createPosition(DocumentContent.java:117)
        at javax.swing.text.AbstractDocument.createPosition(AbstractDocument.java:816)
        at org.netbeans.api.editor.fold.Fold.updateGuardedStartPos(Fold.java:411)
        at org.netbeans.api.editor.fold.Fold.insertUpdate(Fold.java:444)
        at org.netbeans.api.editor.fold.FoldHierarchy$ApiPackageAccessorImpl.foldInsertUpdate(FoldHierarchy.java:413)
Comment 17 denbo 2009-08-27 14:36:59 UTC
Created attachment 86734 [details]
stacktrace
Comment 18 Michal Mocnak 2009-09-17 09:32:34 UTC
Build: NetBeans IDE Dev (Build 200909170201)
VM: Java HotSpot(TM) 64-Bit Server VM, 14.1-b02-92, Java(TM) SE Runtime Environment, 1.6.0_15-b03-226
OS: Mac OS X, 10.5.8, x86_64

User Comments: 


Stacktrace: 
javax.swing.text.BadLocationException: Invalid offset=6853, docLength=6844
        at org.netbeans.editor.DocumentContent.checkOffset(DocumentContent.java:326)
        at org.netbeans.editor.DocumentContent.createPosition(DocumentContent.java:117)
        at javax.swing.text.AbstractDocument.createPosition(AbstractDocument.java:816)
        at org.netbeans.api.editor.fold.Fold.updateGuardedStartPos(Fold.java:411)
        at org.netbeans.api.editor.fold.Fold.insertUpdate(Fold.java:444)
        at org.netbeans.api.editor.fold.FoldHierarchy$ApiPackageAccessorImpl.foldInsertUpdate(FoldHierarchy.java:413)
Comment 19 Michal Mocnak 2009-09-17 09:32:41 UTC
Created attachment 87821 [details]
stacktrace
Comment 20 Michal Mocnak 2009-10-01 15:52:04 UTC
Attaching the pom.xml which causes the problem.
Comment 21 Michal Mocnak 2009-10-01 15:52:46 UTC
Created attachment 88684 [details]
pom file
Comment 22 Miloslav Metelka 2009-10-02 17:11:36 UTC
http://hg.netbeans.org/jet-main/rev/9a063e673faf
Comment 23 Quality Engineering 2009-10-05 08:48:31 UTC
Integrated into 'main-golden', will be available in build *200910030241* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/9a063e673faf
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #164342 - [67cat] javax.swing.text.BadLocationException: Invalid offset=7012, docLength=6998 - improved checking for empty folds during removeUpdate().
Comment 24 Quality Engineering 2009-10-07 00:05:26 UTC
Integrated into 'main-golden', will be available in build *200910061401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/9a063e673faf
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #164342 - [67cat] javax.swing.text.BadLocationException: Invalid offset=7012, docLength=6998 - improved checking for empty folds during removeUpdate().
Comment 25 Nikita Krjukov 2009-10-23 12:41:42 UTC
Does anybody going to verify the issue? I'd like to apply the changes to release67_fixes branch. But it requires the
issue is verified. 
The patch to NetBeans 6.7.1 is very important for our team because we use it as a base for our GF ESB product. 
Comment 26 Jiri Prox 2009-10-23 16:13:21 UTC
verified in 6.8 beta
Comment 27 Sergey Lunegov 2009-10-26 11:40:36 UTC
Changed status whiteboard.
Comment 28 pgebauer 2009-10-26 12:28:05 UTC
Changed the status whiteboard to the correct value.
Comment 29 pgebauer 2009-10-29 12:28:17 UTC
The fix has been ported into the release67_fixes repository.
http://hg.netbeans.org/release67_fixes/rev/c0c40d67e0a7
Comment 30 Peter Pis 2009-10-31 11:46:51 UTC
Verified on 6.7 with appropriate patch.