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 192012 - [70cat] java.lang.StringIndexOutOfBoundsException when trying to use AutoComplete in array using Nightly Dev : 201011150001
Summary: [70cat] java.lang.StringIndexOutOfBoundsException when trying to use AutoComp...
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: issues@php
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-16 15:24 UTC by Sc0tTyXL
Modified: 2011-01-15 12:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sc0tTyXL 2010-11-16 15:24:19 UTC
Product Version = NetBeans IDE Dev (Build 201011150001)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_22
Runtime = Java HotSpot(TM) Client VM 17.1-b03

I got this exception :

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(String.java:686)
	at org.netbeans.modules.php.editor.indent.TokenFormatter$1.run(TokenFormatter.java:1223)
	at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:314)
	at org.netbeans.modules.php.editor.indent.TokenFormatter.reformat(TokenFormatter.java:346)
	at org.netbeans.modules.php.editor.indent.PHPFormatter.reformat(PHPFormatter.java:129)
	at org.netbeans.modules.csl.core.GsfReformatTask$1.run(GsfReformatTask.java:105)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:154)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:138)
	at org.netbeans.modules.parsing.impl.TaskProcessor$1.call(TaskProcessor.java:199)
	at org.netbeans.modules.parsing.impl.TaskProcessor$1.call(TaskProcessor.java:196)
	at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:167)
	at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:323)
	at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:66)
	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:196)
Caused: org.netbeans.modules.parsing.spi.ParseException
	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:204)
	at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106)
[catch] at org.netbeans.modules.csl.core.GsfReformatTask.reformat(GsfReformatTask.java:95)
	at org.netbeans.modules.editor.indent.TaskHandler$MimeItem.runTask(TaskHandler.java:548)
	at org.netbeans.modules.editor.indent.TaskHandler.runTasks(TaskHandler.java:316)
	at org.netbeans.modules.editor.indent.IndentImpl.reformat(IndentImpl.java:325)
	at org.netbeans.modules.editor.indent.api.Reformat.reformat(Reformat.java:154)
	at org.netbeans.lib.editor.codetemplates.CodeTemplateInsertHandler.run(CodeTemplateInsertHandler.java:369)
	at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:344)
	at org.netbeans.lib.editor.codetemplates.CodeTemplateInsertHandler.insertTemplate(CodeTemplateInsertHandler.java:282)
	at org.netbeans.lib.editor.codetemplates.CodeTemplateInsertHandler.processTemplate(CodeTemplateInsertHandler.java:251)
	at org.netbeans.lib.editor.codetemplates.CodeTemplateManagerOperation.insert(CodeTemplateManagerOperation.java:242)
	at org.netbeans.lib.editor.codetemplates.api.CodeTemplate.insert(CodeTemplate.java:107)
	at org.netbeans.modules.csl.editor.completion.GsfCompletionItem$DelegatedItem.defaultSubstituteText(GsfCompletionItem.java:359)
	at org.netbeans.modules.csl.editor.completion.GsfCompletionItem$DelegatedItem.substituteText(GsfCompletionItem.java:329)
	at org.netbeans.modules.csl.editor.completion.GsfCompletionItem.defaultAction(GsfCompletionItem.java:479)
	at org.netbeans.modules.csl.editor.completion.GsfCompletionItem$DelegatedItem.defaultAction(GsfCompletionItem.java:118)
	at org.netbeans.modules.editor.completion.CompletionLayout$CompletionPopup$1.mouseClicked(CompletionLayout.java:340)
	at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
	at java.awt.Component.processMouseEvent(Component.java:6270)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6032)
	at java.awt.Container.processEvent(Container.java:2041)
	at java.awt.Component.dispatchEventImpl(Component.java:4630)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
	at java.awt.Container.dispatchEventImpl(Container.java:2085)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:138)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

While performing this action :    

    /**
     * Loads a ProjectUser by ID and User
     * @param Integer $id
     * @param Consultant $con
     * @return ProjectUser 
     */
    public static function GetByIdAndUser( $id, $con ) {

        $class = new ProjectUser();
        
        $class->GetBy( Array( 'id' => $id, 'user_id' => $con-> ) );
        
        return $class;
    }

when i try to use auto complete on $con-> , i selected GetID() and when i pressed enter the exception occured.
Comment 1 Sc0tTyXL 2010-11-16 16:33:38 UTC
The same exception occured when i wanted to use AutoComplete in the folowing code

        // Check if user is allowed to view the page
        if ( Authentication::GetUser()-> ) {
            return 'ERROR :: ' . Messages::GetMessage( 'CommonWrongUserType' );
        }
Comment 2 Sc0tTyXL 2011-01-15 12:00:02 UTC
For some reason it has put the wrong build version in the name.
THis is with buil 201101140000
Comment 3 Sc0tTyXL 2011-01-15 12:04:16 UTC
Hmm you ca