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 98533 - StringOutOfBoundsException appears while editing #include directive
Summary: StringOutOfBoundsException appears while editing #include directive
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-21 18:46 UTC by Alexander Pepin
Modified: 2007-04-23 16:58 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 Alexander Pepin 2007-03-21 18:46:00 UTC
Steps to reproduce:
- open any existing project
- open any header or source file
- type following include directive:
    #include "f.h"
- when Completion list appears press backspace several times to delete the file
name.
Result: When the last letter ("f") is deleted an Exception window appears with
the message:
java.lang.StringIndexOutOfBoundsException: String index out of range: 974
	at java.lang.String.<init>(String.java:212)
	at
org.netbeans.modules.cnd.completion.cplusplus.ext.CsmCompletionTokenProcessor.token(CsmCompletionTokenProcessor.java:449)
	at org.netbeans.editor.SyntaxSupport.tokenizeText(SyntaxSupport.java:407)
	at
org.netbeans.modules.cnd.completion.cplusplus.ext.CsmCompletionQuery.query(CsmCompletionQuery.java:142)
	at
org.netbeans.modules.cnd.completion.cplusplus.ext.CsmCompletionQuery.query(CsmCompletionQuery.java:103)
	at
org.netbeans.modules.cnd.completion.cplusplus.CsmCompletionProvider$Query.query(CsmCompletionProvider.java:106)
	at
org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:195)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Comment 1 soldatov 2007-03-22 17:08:22 UTC
Type in editor: #include "stdio.h>
press "left arrows" key 8 times
==>
java.lang.StringIndexOutOfBoundsException: String index out of range: 12
	at java.lang.String.<init>(String.java:206)
	at
org.netbeans.modules.cnd.completion.cplusplus.ext.CsmCompletionTokenProcessor.token(CsmCompletionTokenProcessor.java:449)
	at org.netbeans.editor.SyntaxSupport.tokenizeText(SyntaxSupport.java:407)
	.............
Comment 2 Vladimir Voskresensky 2007-03-26 10:36:51 UTC
fixed:
- correctly produce tokens for #include directives. Updated this part and
provided comments

cvs log:
Checking in CCSyntax.java;
/cvs/cnd/core/src/org/netbeans/modules/cnd/editor/cplusplus/CCSyntax.java,v  <--
 CCSyntax.java
new revision: 1.1.2.8; previous revision: 1.1.2.7
done

Comment 3 Alexander Pepin 2007-04-23 16:58:46 UTC
verified in build 20070423