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 235494 - IllegalArgumentException: startOffset=0 >= endOffset=0
Summary: IllegalArgumentException: startOffset=0 >= endOffset=0
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: All All
: P1 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords: 7.4_HR_FIX
Depends on:
Blocks:
 
Reported: 2013-09-04 11:04 UTC by KhArtNJava
Modified: 2013-09-11 13:40 UTC (History)
13 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 203566


Attachments
stacktrace (1.70 KB, text/plain)
2013-09-04 11:04 UTC, KhArtNJava
Details

Note You need to log in before you can comment on or make changes to this bug.
Description KhArtNJava 2013-09-04 11:04:56 UTC
This bug was originally marked as duplicate of bug 234289, 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 201309040001)
VM: Java HotSpot(TM) Client VM, 23.25-b01, Java(TM) SE Runtime Environment, 1.7.0_25-b17
OS: Windows Server 2008

User Comments:
GUEST: pressed return after a foreach declaration

GUEST: paste code:

<div id="sidebar">
   <ul>
      <?php
      if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('homepage-sidebar') ) :
      endif; ?>
   </ul>
</div>

GUEST: <Please provide a description of the problem or the steps to reproduce>f sdf asdf

GUEST: pressing space inside an if statemetn

GUEST: x

GUEST: copy and try pasting

unai: typing some php code (control structures -- alternate delimiters syntax)

GUEST: IllegalArgumentException: (endOffset=2185 - startOffset=2184) < (startGuardedLength=1 + endGuardedLength=1)

GUEST: Error appear

GUEST: writing js

GUEST: else

GUEST: open js file in subdirectory of a html5 project... .

GUEST: this error message popup whenever  I start NetBean

wayneseymour: I was in an HTML5 project that I've been working in for a few hours.
I am currently debugging the project in the latest Google Chrome browser with the Netbeans connector.
I was trying to type a multi-line javascript comment and when I did, the exception was raised.

GUEST: restarted IDE, started filling report

turneliusz: Opening file

GUEST: Dont KNow about the issue, but occurring while saving file.

KhArtNJava: dsfsdf

GUEST: This just appear.

GUEST: Nothing special. I use Netbeans PHP 7.4 beta on Windows 7, create a project from wordpress latest source. Review the source , open /index.php, wp-blog-header.php, wp-load.php,wp-settings.php and other files( those then was closed), last action was double click template-loader.php in skin twenty twelve, the after opened few seconds later it error popup.

Hung

GUEST: exception by php code:
if ( dynamic_sidebar('example_widget_area_name') ) : else : endif;

just when i comment/uncomment line

GUEST: something weird

GUEST: sent report of problem and added new line before "foreach():" block

GUEST: opening js file

petah: Just typing

GUEST: error

GUEST: Typing.

rodrigorsantos: <Please provide a description of the problem or the steps to reproduce>

integrapp: Shows persistent error while opening a cloned file which has been renamed

GUEST: This error popped up 8 billion times. Make it go away!!!!!

GUEST: foreach

GUEST: I don't know what it is and what do the error. But I take error popup

GUEST: after auto completion of foreach loop, this error starts showing up, After this when i try to do Source -> Format, it also does not work.

GUEST: The error occures with netbease 7.3 too. It only happens when I open a specific js file.. Nothing spezial to my knowlage...

GUEST: just pasted small php code in editor

GUEST: It just showed this error.

GUEST: Opened file. Same file as wordpress 3.6 - /wp-includes/template-loader.php

d-man97: Happens repeatedly: when opening this file, scrolling in the file, switching tabs back to this file. Can barely edit the file.

GUEST: Editing PHP file

GUEST: I wrote this php code:
foreach($msg as $loginInformation):
and when IDE add "endforeach;" line, then I got this error window.

ps.
sorry for my english

GUEST: php edited "foreach():" block

GUEST: <Please provide a description of the problem or the steps to reproduce>
Just repeatedly pasting (replacing) a string in a yaml document




Stacktrace: 
java.lang.IllegalArgumentException: startOffset=0 >= endOffset=0
   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:172)
   at org.netbeans.spi.editor.fold.FoldOperation.addToHierarchy(FoldOperation.java:204)
   at org.netbeans.modules.editor.fold.FoldOperationImpl$Refresher.run(FoldOperationImpl.java:697)
   at org.netbeans.modules.editor.fold.FoldOperationImpl.update(FoldOperationImpl.java:489)
Comment 1 KhArtNJava 2013-09-04 11:04:58 UTC
Created attachment 139649 [details]
stacktrace
Comment 2 Exceptions Reporter 2013-09-05 05:40:42 UTC
This bug already has 50 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=203566
Comment 3 Svata Dedic 2013-09-05 06:45:45 UTC
All the reports come originate from PHP code folding. Issues logged from builds >= Aug 25 contain additional info - fold offsets and portion of the source text, with folded area marked by ###...###. Maybe the context will be useful.

In general creating a fold of zero length is illegal at all, the upper layer in the API could ignore such folds, but I'm not sure it is desirable. 

Please evaluate.
Comment 4 Ondrej Brejla 2013-09-05 08:26:29 UTC
Really don't know how it can happen, but it seems that form PHP folding scanner are returned offset ranges of 0 or 1 length. So I can check it and don't allow such a suspicious offset rangse.

But from code snippets in logs I'm not able to reproduce that. It would be great to have a file where the problem can be reproduced certainly.
Comment 5 Ondrej Brejla 2013-09-05 08:33:16 UTC
Fixed in web-main #9c2bde1186d7

Please verify, thanks (but not sure how, if it's not certainly reproducible ;). Fix just checks offset ranges lengths.
Comment 6 Tomas Mysik 2013-09-09 10:10:24 UTC
The fix seems OK to me.
Comment 7 Vladimir Riha 2013-09-11 11:51:12 UTC
Cannot reproduce, verified in trunk. Please continue with integration


Product Version: NetBeans IDE Dev (Build 201309110001)
Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 8 Ondrej Brejla 2013-09-11 13:40:46 UTC
Transplanted, thanks.