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 202520

Summary: IndexOutOfBoundsException: start=-1073741674 < 0
Product: php Reporter: maghiel <maghiel>
Component: Formatting & IndentationAssignee: Ondrej Brejla <obrejla>
Status: VERIFIED WORKSFORME    
Severity: normal CC: fsando, mil-ast, schkovich, sdedic, vriha
Priority: P3    
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 181317
Attachments: stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace

Description maghiel 2011-09-22 20:20:31 UTC
Build: NetBeans IDE Dev (Build 201109202329)
VM: Java HotSpot(TM) 64-Bit Server VM, 21.0-b17, Java(TM) SE Runtime Environment, 1.7.0-b147
OS: Windows 7

User Comments:
maghiel: Trying to generate getter and setter for 2 properties




Stacktrace: 
java.lang.IndexOutOfBoundsException: start=-1073741674 < 0
   at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:529)
   at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:549)
   at org.netbeans.lib.editor.util.CharSubSequence.checkIndexesValid(CharSubSequence.java:65)
   at org.netbeans.lib.editor.util.CharSubSequence.<init>(CharSubSequence.java:87)
   at org.netbeans.modules.editor.lib2.document.CharContent.subSequence(CharContent.java:95)
   at org.netbeans.lib.lexer.token.DefaultToken.toString(DefaultToken.java:199)
Comment 1 maghiel 2011-09-22 20:20:35 UTC
Created attachment 111063 [details]
stacktrace
Comment 2 Vladimir Riha 2011-09-27 09:19:35 UTC
Created attachment 111226 [details]
stacktrace

What caused it:
1) create new PHP class
2) define 2 variables inside class. Let's say second variable is defined at line X
3) use Enter to get to line X+2, press Alt+Insert and select constructor
4) Dialog is shown, don't check variables, but the whole class
=> Exception
Comment 3 Vladimir Riha 2011-09-27 09:22:34 UTC
Created attachment 111228 [details]
stacktrace
Comment 4 schkovich 2011-10-04 00:18:42 UTC
Created attachment 111439 [details]
stacktrace

alt+shift+f php file
Comment 5 Exceptions Reporter 2011-10-27 01:17:46 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=181317
Comment 6 mil-ast 2011-10-27 01:20:40 UTC
Created attachment 112477 [details]
stacktrace
Comment 7 mil-ast 2011-10-27 01:23:40 UTC
Created attachment 112478 [details]
stacktrace

$uploaddir = $_SERVER['']

set cursor in '', CTRL + SPACE, select 'DOCUMENT_ROOT', ENTER
Comment 8 Exceptions Reporter 2011-12-02 09:03:41 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=181317
Comment 9 Svata Dedic 2012-04-16 14:10:55 UTC
Caused by these calls (IMHO):

        at org.netbeans.lib.lexer.token.DefaultToken.toString(DefaultToken.java:224)
        at org.netbeans.modules.php.editor.indent.FormatVisitor.addFormatToken(FormatVisitor.java:1303)
        at org.netbeans.modules.php.editor.indent.FormatVisitor.visit(FormatVisitor.java:1023)


If I was wrong then please reassign back + better explain where the CSL infrastructure failure is - thanks.
Comment 10 Ondrej Brejla 2012-04-16 14:30:02 UTC
Vlado, can you still reproduce it? I tried you use case and it work properly for me.
Comment 11 Vladimir Riha 2012-04-17 06:16:27 UTC
Nope, all cases describes in comments are working w/o problem