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 231750

Summary: StringIndexOutOfBoundsException: String index out of range: -1
Product: php Reporter: cwt137
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 201307
Attachments: stacktrace

Description cwt137 2013-06-25 04:35:21 UTC
Build: NetBeans IDE Dev (Build 2013-06-25_00-03-56)
VM: OpenJDK Client VM, 23.7-b01, OpenJDK Runtime Environment, 1.7.0_21-b02
OS: Linux

User Comments:
GUEST: was typing "!is_array" inside of an if statement:

if(!is_ar$billingStreet2)

GUEST: PHP -> CTRL+spacebar -> crash

cwt137: Trying to do an auto complete on a class defined by use.




Stacktrace: 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
   at java.lang.String.substring(String.java:1871)
   at org.netbeans.modules.php.editor.model.impl.VariousUtils.getRelativesToUses(VariousUtils.java:1350)
   at org.netbeans.modules.php.editor.PHPCompletionItem$NamespaceItem.isSmart(PHPCompletionItem.java:1324)
   at org.netbeans.modules.php.editor.PHPCompletionItem$NamespaceItem.getSortPrioOverride(PHPCompletionItem.java:1271)
   at org.netbeans.modules.csl.editor.completion.GsfCompletionItem$DelegatedItem.getSortPriority(GsfCompletionItem.java:126)
   at org.netbeans.modules.editor.completion.CompletionItemComparator.compare(CompletionItemComparator.java:81)
Comment 1 cwt137 2013-06-25 04:35:22 UTC
Created attachment 136246 [details]
stacktrace
Comment 2 Ondrej Brejla 2013-06-25 08:17:45 UTC
Fixed in web-main #30b82c335156
Comment 3 Quality Engineering 2013-06-26 02:33:49 UTC
Integrated into 'main-golden', will be available in build *201306252301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/30b82c335156
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #231749 - StringIndexOutOfBoundsException: String index out of range: -1

Fixes issue #231750 too.