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 30348 - StringIndexOutOfBoundsException from java parser when mounting ANTLR
Summary: StringIndexOutOfBoundsException from java parser when mounting ANTLR
Status: RESOLVED DUPLICATE of bug 18582
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-25 21:31 UTC by dpenton
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

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 dpenton 2003-01-25 21:31:33 UTC
This exception is reported frequently in the
course of using the IDE. I do not see a particular
pattern to when it comes up, although I am sure
there is one.  Here is a stack trace:

Annotation: Parser error
java.lang.StringIndexOutOfBoundsException: String
index out of range: 34625
        at java.lang.String.<init>(String.java:197)
        at
java.lang.String.copyValueOf(String.java:2233)
        at
org.netbeans.modules.java.gj.V8TreeTranslator.getString(V8TreeTranslator.java:136)
        at
org.netbeans.modules.java.gj.V8TreeTranslator._case(V8TreeTranslator.java:491)
        at
org.netbeans.lib.javac.v8.tree.Tree$VarDef.visit(Tree.java:493)
        at
org.netbeans.modules.java.gj.V8TreeTranslator._case(V8TreeTranslator.java:303)
        at
org.netbeans.lib.javac.v8.tree.Tree$ClassDef.visit(Tree.java:407)
        at
org.netbeans.modules.java.gj.V8TreeTranslator._case(V8TreeTranslator.java:188)
        at
org.netbeans.lib.javac.v8.tree.Tree$TopLevel.visit(Tree.java:344)
        at
org.netbeans.modules.java.gj.V8TreeTranslator.process(V8TreeTranslator.java:94)
        at
org.netbeans.modules.java.gj.ParserEngine.completeRequest(ParserEngine.java:353)
        at
org.netbeans.modules.java.gj.ParserEngine.parseObject(ParserEngine.java:176)
        at
org.netbeans.modules.java.gj.JavaParserEngine.process(JavaParserEngine.java:72)
        at
org.netbeans.modules.java.parser.ParsingSupport$Processor.process(ParsingSupport.java:704)
        at
org.netbeans.modules.java.parser.ParsingSupport$Processor.parseLockModel(ParsingSupport.java:659)
        at
org.netbeans.modules.java.parser.ParsingSupport$Processor.run(ParsingSupport.java:590)
        at org.openide.util.Task.run(Task.java:136)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599)
==>
Comment 1 dpenton 2003-01-26 12:54:26 UTC
Mounting either the source directory or the jar for ANTLR 2.7.1 causes
endless string index exceptions from the java parser, rendering the
use of the ANTLR package impossible (for me).

I guess this is some kind of problem with parser related code, because
the ANTLR 2.7.1 source compiles fine.
Comment 2 Svata Dedic 2003-02-05 10:39:31 UTC
Please verify that all lines in the package are < 2048 characters
long; javac' parser we use has this limitation (it packs line:column
pair into a long value).
Comment 3 Kenneth Chenis 2003-02-14 15:55:52 UTC
I too get a very similar parsing error (my index is -32 
though) - If I disable "annotate errors" by setting the 
limit to 0, the problem goes away (of course, then the 
error annotation is disabled)   It only happens with 
certain files, but with them it happens all the time.

When it does, I have to close the editor window as it 
appears to be in an infinite loop.

There does not appear to be anything wrong with the 
source file - a rather simple ejb - I can send the source 
along if that would help debug/fix this problem.

Excerpt from ide.log:
System Info: 
  Product Version       = NetBeans IDE 3.4.1
  IDE Versioning        = IDE/1 spec=2.23.2 
impl=200301202341
  Operating System      = Windows XP version 5.1 running 
on x86
  Java; VM; Vendor      = 1.3.1_06; Java HotSpot(TM) 
Client VM 1.3.1_06-b01; Sun Microsystems Inc.
  Java Home             = C:\_System\jdk1.3.1\jre
  System Locale; Encod. = en_US; Cp1252
  Home Dir; Current Dir = C:\Documents and Settings\Ken; 

....


*********** Exception occurred ************ at Fri Feb 14 
10:14:17 EST 2003
Annotation: Parser error
java.lang.StringIndexOutOfBoundsException: String index 
out of range: -32
	at java.lang.String.<init>(String.java:241)
	at java.lang.String.copyValueOf(String.java:1999)
	at 
org.netbeans.modules.java.parser.DocumentModelBuilder.setB
odyBounds(DocumentModelBuilder.java:105)
	at 
org.netbeans.modules.java.gj.V8TreeTranslator._case
(V8TreeTranslator.java:437)
	at 
org.netbeans.lib.javac.v8.tree.Tree$MethodDef.visit
(Tree.java:460)
	at 
org.netbeans.modules.java.gj.V8TreeTranslator._case
(V8TreeTranslator.java:303)
	at 
org.netbeans.lib.javac.v8.tree.Tree$ClassDef.visit
(Tree.java:407)
	at 
org.netbeans.modules.java.gj.V8TreeTranslator._case
(V8TreeTranslator.java:188)
	at 
org.netbeans.lib.javac.v8.tree.Tree$TopLevel.visit
(Tree.java:344)
	at 
org.netbeans.modules.java.gj.V8TreeTranslator.process
(V8TreeTranslator.java:94)
	at 
org.netbeans.modules.java.gj.ParserEngine.completeRequest
(ParserEngine.java:353)
	at 
org.netbeans.modules.java.gj.ParserEngine.parseObject
(ParserEngine.java:176)
	at 
org.netbeans.modules.java.gj.JavaParserEngine.process
(JavaParserEngine.java:72)
	at 
org.netbeans.modules.java.parser.ParsingSupport$Processor.
process(ParsingSupport.java:704)
	at 
org.netbeans.modules.java.parser.ParsingSupport$Processor.
parseLockModel(ParsingSupport.java:659)
[catch] at 
org.netbeans.modules.java.parser.ParsingSupport$Processor.
run(ParsingSupport.java:590)
	at org.openide.util.Task.run(Task.java:136)
	at org.openide.util.RequestProcessor$Processor.run
(RequestProcessor.java:599)
==>
WARNING - ErrorManager detected cyclic exception nesting:
	java.lang.StringIndexOutOfBoundsException: String 
index out of range: -32
Be sure not to annotate an exception with itself, 
directly or indirectly.
Comment 4 Kenneth Chenis 2003-02-14 16:36:22 UTC
Ah, I found a line in the source that WAS larger then 
2048 - wrapped that one, and the problem is now gone ...
Comment 5 Tomas Hurka 2003-02-17 16:07:22 UTC
Ok, so this issue is duplicate of issue #18582

*** This issue has been marked as a duplicate of 18582 ***