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 231749

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: 201361
Attachments: stacktrace

Description cwt137 2013-06-25 04:14:19 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: PHP Doc Class Completion (incl. Namespace) - exception occured on hitting enter

cwt137: Was creating a return inside a class and got this error




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.model.impl.VariousUtils.getRelatives(VariousUtils.java:1368)
   at org.netbeans.modules.php.editor.model.impl.VariousUtils.getAllNames(VariousUtils.java:1336)
   at org.netbeans.modules.php.editor.model.impl.VariousUtils.getPreferredName(VariousUtils.java:1322)
   at org.netbeans.modules.php.editor.PHPCompletionItem.getInsertPrefix(PHPCompletionItem.java:327)
Comment 1 cwt137 2013-06-25 04:14:21 UTC
Created attachment 136245 [details]
stacktrace
Comment 2 Ondrej Brejla 2013-06-25 08:17:40 UTC
Fixed in web-main #30b82c335156
Comment 3 Quality Engineering 2013-06-26 02:29:18 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.