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 138353 - javax.swing.text.BadLocationException: docLength=371: Invalid offset+length=420
Summary: javax.swing.text.BadLocationException: docLength=371: Invalid offset+length=420
Status: VERIFIED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All Linux
: P2 blocker (vote)
Assignee: martin_adamek
URL: http://statistics.netbeans.org/except...
Keywords: RANDOM
: 142038 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-26 12:46 UTC by Lukas Jungmann
Modified: 2008-10-30 14:25 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 67184


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2008-06-26 12:46:05 UTC
Build: NetBeans IDE Dev (Build 200806180005)
VM: Java HotSpot(TM) Client VM, 11.0-b11, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b23
OS: Windows 2000, 5.0, x86
User comments: Happened when pressing shift-tab while editing the "resources.groovy" file
STACKTRACE: (first 10 lines)
javax.swing.text.BadLocationException: docLength=371:  Invalid offset+length=420
        at org.netbeans.editor.DocumentContent.checkBounds(DocumentContent.java:340)
        at org.netbeans.editor.DocumentContent.getString(DocumentContent.java:168)
        at javax.swing.text.AbstractDocument.getText(AbstractDocument.java:757)
        at org.netbeans.modules.groovy.editor.AstPath.<init>(AstPath.java:77)
        at org.netbeans.modules.groovy.editor.parser.GroovyOccurrencesFinder.run(GroovyOccurrencesFinder.java:142)
        at org.netbeans.modules.groovy.editor.parser.GroovyOccurrencesFinder.run(GroovyOccurrencesFinder.java:79)
        at
org.netbeans.modules.gsfret.editor.semantic.MarkOccurrencesHighlighter.processImpl(MarkOccurrencesHighlighter.java:187)
        at org.netbeans.modules.gsfret.editor.semantic.MarkOccurrencesHighlighter.run(MarkOccurrencesHighlighter.java:127)
        at org.netbeans.modules.gsfret.editor.semantic.MarkOccurrencesHighlighter.run(MarkOccurrencesHighlighter.java:83)
        at org.netbeans.napi.gsfret.source.Source$CompilationJob.run(Source.java:1272)

another steps:
-have a groovy script
-repeatably type, delete (using backspace) and invoke CC in: "def r = new groovy.xml"

=> BLE
Comment 1 martin_adamek 2008-06-26 14:25:05 UTC
Hmm, I am not able to reproduce this, would need better steps to reproduce...
Comment 2 Lukas Jungmann 2008-06-26 14:31:38 UTC
try this:

-open some longer groovy script/class
-put the cursor at the end
-press and hold backspace (as you would like to delete everything char by char)
Comment 3 martin_adamek 2008-06-26 14:41:31 UTC
That doesn't help. I am still not able to reproduce. Maybe I'll need to try on something else than Mac?
Comment 4 martin_adamek 2008-07-22 09:11:51 UTC
Are you still able to reproduce this? If not, let's close it and reopen once it will appear again.
Comment 5 Lukas Jungmann 2008-07-23 12:36:36 UTC
yes, I'm still able to reproduce this or at least something similar. Just happend to me in the latest build, here's
actual stacktrace:

javax.swing.text.BadLocationException: docLength=19:  Invalid offset+length=21
	at org.netbeans.editor.DocumentContent.checkBounds(DocumentContent.java:340)
	at org.netbeans.editor.DocumentContent.getString(DocumentContent.java:168)
	at javax.swing.text.AbstractDocument.getText(AbstractDocument.java:757)
	at org.netbeans.modules.groovy.editor.AstPath.<init>(AstPath.java:77)
	at org.netbeans.modules.groovy.editor.completion.CodeCompleter.getPathFromRequest(CodeCompleter.java:597)
	at org.netbeans.modules.groovy.editor.completion.CodeCompleter.complete(CodeCompleter.java:2071)
	at
org.netbeans.modules.gsfret.editor.completion.GsfCompletionProvider$JavaCompletionQuery.addCodeCompletionItems(GsfCompletionProvider.java:565)
	at
org.netbeans.modules.gsfret.editor.completion.GsfCompletionProvider$JavaCompletionQuery.resolveCompletion(GsfCompletionProvider.java:551)
	at
org.netbeans.modules.gsfret.editor.completion.GsfCompletionProvider$JavaCompletionQuery.run(GsfCompletionProvider.java:387)
	at
org.netbeans.modules.gsfret.editor.completion.GsfCompletionProvider$JavaCompletionQuery.run(GsfCompletionProvider.java:219)
	at org.netbeans.napi.gsfret.source.Source.runUserActionTask(Source.java:467)
	at
org.netbeans.modules.gsfret.editor.completion.GsfCompletionProvider$JavaCompletionQuery.query(GsfCompletionProvider.java:292)
	at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:218)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Comment 6 martin_adamek 2008-07-29 12:14:36 UTC
*** Issue 142038 has been marked as a duplicate of this issue. ***
Comment 7 martin_adamek 2008-07-29 15:00:03 UTC
Blind fix.
http://hg.netbeans.org/main/rev/47c384ada8ed
Comment 8 Quality Engineering 2008-07-30 04:12:10 UTC
Integrated into 'main-golden', available in build *200807300201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/47c384ada8ed
User: Martin Adamek <martin_adamek@netbeans.org>
Log: #138353: javax.swing.text.BadLocationException: docLength=371:  Invalid offset+length=420
Comment 9 Lukas Jungmann 2008-08-07 14:05:07 UTC
this really seems to be fixed... v.