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 229780 - javax.swing.text.BadLocationException: Invalid offset=320 not within <0, 317>
Summary: javax.swing.text.BadLocationException: Invalid offset=320 not within <0, 317>
Status: RESOLVED INCOMPLETE
Alias: None
Product: groovy
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-15 12:35 UTC by pfabier
Modified: 2013-07-25 09:07 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 200666


Attachments
stacktrace (3.20 KB, text/plain)
2013-05-15 12:35 UTC, pfabier
Details
stacktrace (4.12 KB, text/plain)
2013-06-21 12:32 UTC, Martin Kanak
Details
stacktrace (1.13 KB, text/plain)
2013-07-09 09:56 UTC, misterm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pfabier 2013-05-15 12:35:15 UTC
This issue was reported manually by jhavlin.
It already has 1 duplicates 


Build: NetBeans IDE 7.2 (Build 201207171143)
VM: Java HotSpot(TM) 64-Bit Server VM, 22.1-b02, Java(TM) SE Runtime Environment, 1.7.0_03-b05
OS: Windows 7

User Comments:
pfabier: Impossible to stop "Background scanning of projects"




Stacktrace: 
javax.swing.text.BadLocationException: Invalid offset=320 not within <0, 317>
   at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1345)
   at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1340)
   at org.netbeans.editor.Utilities.getRowStart(Utilities.java:198)
   at org.netbeans.editor.Utilities.getRowStart(Utilities.java:181)
   at org.netbeans.modules.groovy.editor.api.StructureAnalyzer.addFolds(StructureAnalyzer.java:346)
   at org.netbeans.modules.groovy.editor.api.StructureAnalyzer.addFolds(StructureAnalyzer.java:371)
Comment 1 pfabier 2013-05-15 12:35:17 UTC
Created attachment 134467 [details]
stacktrace
Comment 2 Jaroslav Havlin 2013-05-15 12:39:21 UTC
This bug contains exception reports extracted from bug 218281.
StructureAnalyzer.addFolds probably doesn't handle BadLocationException correctly.
Please evaluate. Thank you.
Comment 3 Martin Janicek 2013-06-10 09:27:15 UTC
It would be great to have a reproducible test case. pfabier, do you know what code have you been editing when the exception occurs?
Comment 4 Martin Kanak 2013-06-21 12:32:00 UTC
Created attachment 136137 [details]
stacktrace

I have PHP file with following structure:
<?php

?>
|

Place cursor instead of | and try to make comment with comment button or via CTRL+SHIFT+C and this exception appears => expected behaviour after the pushing comment button is that nothing will be happened
Comment 5 Exceptions Reporter 2013-06-21 12:32:03 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=200666
Comment 6 misterm 2013-07-09 09:56:39 UTC
Created attachment 136859 [details]
stacktrace

.
Comment 7 Martin Janicek 2013-07-25 09:07:10 UTC
After separating PHP part and showtodos part, only one report remains from groovy area (from NB 7.2). It's not simple to fix the problem without reproducible test case, so closing the issue as INCOMPLETE for now.

Please if anyone will get into this again (using groovy support), attach the source code you were editing when the exception occurs and reopen the issue. Thanks in advance!