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 137591

Summary: java.lang.IllegalArgumentException: (endOffset=3249 - startOffset=3255) < (startGuardedLength=73 + endGuardedLength=50)
Product: editor Reporter: Karol Harezlak <kharezlak>
Component: Code foldingAssignee: Vitezslav Stejskal <vstejskal>
Status: VERIFIED FIXED    
Severity: blocker CC: ca-nb, ivansidorkin, psuchomel, sustaining
Priority: P1    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 128705    
Bug Blocks:    
Attachments: stack trace

Description Karol Harezlak 2008-06-18 16:07:33 UTC
Product Version: NetBeans IDE Dev (Build 080617)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-119
System: Mac OS X version 10.5.3 running on i386; MacRoman; en_US (nb)
Userdir: /Volumes/work/hgtrunk2/main/nbbuild/testuserdir

To reproduce:
- create new Java ME mobility project with HelloMidlet.
- in the HelloMidlet switch to the Flow View
- add WaitScreen component from the compoents palette
- switch to the Source view

Very often Netbeans throws during code generation java.lang.IllegalArgumentException: (endOffset=... - startOffset=...)
< (startGuardedLength=... + endGuardedLength=...) 
 
more info in the stack.txt
Comment 1 Karol Harezlak 2008-06-18 16:08:24 UTC
Created attachment 63009 [details]
stack trace
Comment 2 Karol Harezlak 2008-06-18 16:12:59 UTC
Most likely this issue is connected with this one 128705
Comment 3 Karol Harezlak 2008-06-19 10:36:24 UTC
I was testing this issue and it turned out it is big stopper for us we wont be able to release Mobility 6.5 M1 with this
issue because code generation of Visual Designer is seriously broken. Changing to P1.
Comment 4 Vitezslav Stejskal 2008-06-19 10:46:14 UTC
Well, if issue #128705 causes overlapping guarded sections, it is likely to be the cause of this problem as well. So,
I'd suggest you first fix #128705 and we will then see if something needs to be fixed in CustomFoldManager.
Comment 5 Karol Harezlak 2008-06-19 11:15:52 UTC
Right know I'm not able to reproduce issue #12870 because code generation fails almost every time. It's most important
for us to make Visual Designer usable again and fix this issue. Also it's just my speculation that those two issues are
related.
Comment 6 Vitezslav Stejskal 2008-06-19 11:25:56 UTC
How do I install J2ME compatible platform? The Mobile Application project wizard is asking for one...

The IAE is caused by CustomFoldManager trying to insert bad folds. The folds added by CustomFoldManager are those for
guarded sections. So your speculation seems correct. Anyway, if you tell me where to get J2ME platform I'll try the
steps and see if we can somehow make CFM more resilient. Thanks
Comment 7 Petr Suchomel 2008-06-19 11:32:43 UTC
If you have NetBeans installed, you have one under mobility8/WTK2.5.2, otherwise get the one at
http://java.sun.com/products/sjwtoolkit/download.html
Comment 8 Vitezslav Stejskal 2008-06-19 13:09:09 UTC
Thanks, I can reproduce it now.
Comment 9 Vitezslav Stejskal 2008-06-23 11:31:48 UTC
http://hg.netbeans.org/main/rev/a5481f23af77
Comment 10 Quality Engineering 2008-06-23 16:11:56 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #277 build
Changeset: http://hg.netbeans.org/main/rev/a5481f23af77
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #137591 (fixed): correct fold size computation; remove all marks in the modified area
Comment 11 Andrei Chistiakov 2008-06-24 14:42:58 UTC
Verified with NetBeans IDE Dev (Build 200806240008).
Comment 12 rbalada 2008-07-18 16:06:18 UTC
Lukasi,

during investigation of this issue was discovered, that porting fix for this issue may require also porting of a
changeset for issue 133350 "CustomFoldManager requires old Syntax/SyntaxSupport". This would switch editor.lib module
from use of Syntax/SyntaxSupport to use of lexer.

I would like to ask QE to estimate&confirm this change is safe for NB 6.1 Patch3, because it could cause further issues
with NB 6.1 release.

Thanks,
-R
Comment 13 rbalada 2008-07-21 14:30:59 UTC
Lukasi,

Could you please justify nomination for 61fixes3-candidate?

Some background info:
#1 During my discussion with vstejskal it turned out that this issue may not be present in NB 6.1 source base. Vita said
it was likely introduced in a code which was significantly changed in trunk (6.5) due to implementation the issue
133350, changeset http://hg.netbeans.org/main/rev/c3c8d46c3eb3 .

#2 The initial report says "Product Version: NetBeans IDE Dev (Build 080617)", which is very likely trunk (6.5) source base.
#3 I am unable to reproduce it on NetBeans 6.1 Patch 2 (using the "Visual Designer Custom Components" sample)

Comment 14 rbalada 2008-07-29 16:21:23 UTC
I've ported this bugfix into release61_fixes repository as http://hg.netbeans.org/release61_fixes/rev/1fc3409608ad
Comment 15 biodunolrj 2008-09-10 18:01:54 UTC
pls help find solution to this bug: section overlap as it is causing a lot of setback
Comment 16 rbalada 2008-09-10 19:52:17 UTC
biodunolrj,

would you please re-phrase your request? This issue is marked as VERIFIED FIXED. The same applies to issue 128705
"sections overlap". Both issues are in such a state that no one is going to work on them, unless you find regression or
reproducible case.

Did you find regression and/or reproducible case. Would you please shed some light on your request? Would you please
provide some details about your issue? Consider following issue reporting guideline available at
http://wiki.netbeans.org/IssueReportingGuidelines .