Bug 96448

Summary: Scanner.getCurrentTokenSourceString NegativeArraySizeException
Product: [Eclipse Project] JDT Reporter: Ron Gavlin <rgavlin>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: critical    
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Ron Gavlin CLA 2005-05-24 11:35:09 EDT
Eclipse 3.1M6.

Adding the following line of code to any Java source file breaks code completion.

private static String BAD = "\"";

OTOH, adding a leading character to the string contents as follows fixes the
problem.

private static String OK = "x\"";

Here's the .log report:

!MESSAGE The command for the key you pressed failed
!STACK 0
java.lang.NegativeArraySizeException
   at
org.eclipse.jdt.internal.compiler.parser.Scanner.getCurrentTokenSourceString(Scanner.java:501)
   at org.eclipse.jdt.internal.compiler.parser.Parser.consumeToken(Parser.java:6793)
   at
org.eclipse.internal.codeassist.impl.AssistParser.consumeToken(AssistParser.java:666)
   at
org.eclipse.internal.codeassist.complete.CompletionParser.consumeToken(CompletionParser.java:2235)
...
Comment 1 Olivier Thomann CLA 2005-05-24 14:46:54 EDT

*** This bug has been marked as a duplicate of 90414 ***