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 229782 - IllegalArgumentException: startOffset=14793 >= endOffset=14793
Summary: IllegalArgumentException: startOffset=14793 >= endOffset=14793
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-15 12:50 UTC by Exceptions Reporter
Modified: 2013-11-01 07:43 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 9812


Attachments
stacktrace (1.76 KB, text/plain)
2013-05-15 12:50 UTC, Exceptions Reporter
Details
stacktrace (1.80 KB, text/plain)
2013-06-24 18:38 UTC, mrpc
Details
stacktrace (1.75 KB, text/plain)
2013-06-24 19:56 UTC, mrpc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2013-05-15 12:50:11 UTC
This bug was originally marked as duplicate of bug 227538, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201305142300)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Windows 7

User Comments:
GUEST: It is occured when I'm trying to open or edit a jsp file

GUEST: It have occured for file editing




Stacktrace: 
java.lang.IllegalArgumentException: startOffset=14793 >= endOffset=14793
   at org.netbeans.api.editor.fold.Fold.<init>(Fold.java:137)
   at org.netbeans.api.editor.fold.FoldHierarchy$ApiPackageAccessorImpl.createFold(FoldHierarchy.java:371)
   at org.netbeans.modules.editor.fold.FoldOperationImpl.createFold(FoldOperationImpl.java:170)
   at org.netbeans.spi.editor.fold.FoldOperation.addToHierarchy(FoldOperation.java:204)
   at org.netbeans.modules.editor.fold.FoldOperationImpl$Refresher.run(FoldOperationImpl.java:659)
   at org.netbeans.modules.editor.fold.FoldOperationImpl.update(FoldOperationImpl.java:483)
Comment 1 Exceptions Reporter 2013-05-15 12:50:13 UTC
Created attachment 134469 [details]
stacktrace
Comment 2 Svata Dedic 2013-05-21 19:08:55 UTC
Please check if JspStructureScanner does not provide a range of zero length. The reported exception attempted to create a new Fold, which is done using positions provided in the supplied OffsetRange.
Comment 3 Exceptions Reporter 2013-06-01 21:40:25 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=9812
Comment 4 Exceptions Reporter 2013-06-20 18:55:59 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=9812
Comment 5 mrpc 2013-06-24 18:38:02 UTC
Created attachment 136237 [details]
stacktrace

Editing a php file. I pasted a line of code, started editing it and the error occured.
Comment 6 mrpc 2013-06-24 19:56:03 UTC
Created attachment 136239 [details]
stacktrace

Just started up after installation. There were 3 projects open already and 3 opened PHP files in the editor. error occured while "opening projects"
Comment 7 Exceptions Reporter 2013-07-05 07:56:31 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=9812
Comment 8 Exceptions Reporter 2013-07-05 07:59:32 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=9812
Comment 9 David Konecny 2013-07-09 04:47:25 UTC
From exception report comments it looks that this problem happens for many different editors - JSP, PHP, JS. Hence I'm passing the issue back to editing infrastructure to re-evaluate.

Btw. I do not think there were any changes in last few years in Folding support in the JSP editor.
Comment 10 Svata Dedic 2013-07-09 06:02:21 UTC
Please read comment #2 before reassinging back; the implementation in CSL ignored invalid fold input, which resulted in an unreliable behaviour: some OffsetRanges reported from StructureScanner turned into folds, while some (with zero length) did not.
Individual StructureScanners should be still corrected not to pass invalid data for folds.
Comment 11 Svata Dedic 2013-07-09 11:58:10 UTC
Fixed in hg.netbeans.org/jet-main/rev/9cf2e5db4779


Still StructureScanner impls should be checked not to pass invalid data.
Comment 12 Quality Engineering 2013-07-12 02:36:08 UTC
Integrated into 'main-silver', will be available in build *201307112300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/9cf2e5db4779
User: Svata Dedic <sdedic@netbeans.org>
Log: #229782: folds that have zero length are ignored in updates
Comment 13 Marian Mirilovic 2013-10-31 09:08:13 UTC
Jirka P., 
why is this issue marked as 74Patch candidate ? I assume this was already fixed in July ...
Comment 14 Svata Dedic 2013-11-01 07:43:32 UTC
According to hg (http://hg.netbeans.org/releases/file/af66ebf05f5a/editor.fold/src/org/netbeans/modules/editor/fold/FoldOperationImpl.java, lines ~ 564-574) the 7.4 release already contains changeset attached to this defect.