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.
Build: NetBeans IDE Dev (Build 2013-03-14 09:46:40 WEB-MAIN bacf3f326fcd by Padraig Doran) VM: Java HotSpot(TM) Client VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_17-b02 OS: Windows 7 User Comments: padraigdoran: mistaken extra parentesis here if (!isset($subject_id))) GUEST: <Please provide a description of the problem or the steps to reproduce> Stacktrace: java.lang.IllegalArgumentException: (endOffset=19219 - startOffset=19218) < (startGuardedLength=1 + endGuardedLength=1) at org.netbeans.api.editor.fold.Fold.<init>(Fold.java:131) 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)
Created attachment 132664 [details] stacktrace
Reproduced
The root cause is that PHP reports 'code block' fold, which is defined as surrounded by 2 chars (i.e. {}), but the reported block is just 1 character long. The previous implementation had silently filtered such invalid data, hiding the error. I would prefer not hiding the error out again. Please see the attached proposed patch for a simple fix for this case. I recommend also not to create folds for single-statement if-else branches; or more precise for single-line branches as done in <= 7.3.
Created attachment 132666 [details] Strawman's fix of the issue
This bug already has 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=22969
Created attachment 132683 [details] stacktrace editing a php file.
Created attachment 132708 [details] stacktrace Had just typed for ($item = 0; $item < $this->rssItemCount; $i)
Fixed in web-main #2517e6bb3263
Integrated into 'main-golden', will be available in build *201303182300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/2517e6bb3263 User: Ondrej Brejla <obrejla@netbeans.org> Log: #227538 - IllegalArgumentException: (endOffset=19219 - startOffset=19218) < (startGuardedLength=1 + endGuardedLength=1)
Not fixed. Still getting exceptions (reported them: "It has now been added to the database with id #665717. It has been classified as a duplicate of report #22969") I did a build from here, which is later than the fixed changeset: changeset: 248393:c36b59f8d48f tag: tip user: Ondrej Brejla <obrejla@netbeans.org> date: Tue Mar 19 07:57:26 2013 +0100 summary: Fixed failing tests.
Sorry, but I'm not able to reproduce that in todays dev build with your example. Can you provide exact steps, how to do that? Thanks in advance. Then simply reopen. Product Version: NetBeans IDE Dev (Build 20130319-c36b59f8d48f) Java: 1.6.0_26; Java HotSpot(TM) Client VM 20.1-b02 Runtime: Java(TM) SE Runtime Environment 1.6.0_26-b03 System: Linux version 3.5.0-25-generic running on i386; UTF-8; cs_CZ (nb)
I am also not be able to reproduce this issue in todays dev build Product Version: NetBeans IDE Dev (Build 201303182300) Java: 1.7.0_17; Java HotSpot(TM) Client VM 23.7-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b02 System: Linux version 3.5.0-25-generic running on i386; UTF-8; en_US (nb)
Fixed in web-main #310f68bfa393
Integrated into 'main-golden', will be available in build *201303222300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/310f68bfa393 User: Ondrej Brejla <obrejla@netbeans.org> Log: #227538 - IllegalArgumentException: (endOffset=19219 - startOffset=19218) < (startGuardedLength=1 + endGuardedLength=1)