Bug 128823 - ArrayIndexOutOfBoundsException in log
Summary: ArrayIndexOutOfBoundsException in log
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.2 M6   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-21 11:08 EST by John Arthorne CLA
Modified: 2006-03-28 10:17 EST (History)
0 users

See Also:


Attachments
Log file (42.50 KB, text/plain)
2006-02-21 11:09 EST, John Arthorne CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2006-02-21 11:08:25 EST
Build: I20060216-1200

I found a number of ArrayIndexOutOfBoundsExceptions in my log file from yesterday. Sorry, I'm not sure what I was doing at the time. Hopefully the info in the log is enough...
Comment 1 John Arthorne CLA 2006-02-21 11:09:05 EST
Created attachment 35077 [details]
Log file

Sample stack trace:

java.lang.ArrayIndexOutOfBoundsException
	at org.eclipse.jdt.core.dom.ASTRecoveryPropagator.visitNode(ASTRecoveryPropagator.java:164)
	at org.eclipse.jdt.core.dom.DefaultASTVisitor.visit(DefaultASTVisitor.java:166)
	at org.eclipse.jdt.core.dom.ReturnStatement.accept0(ReturnStatement.java:133)
Comment 2 David Audel CLA 2006-02-22 09:47:42 EST
Fixed and test added
  ASTConverterTestAST3_2#test0634()

The problem is in ASTRecoveryPropagator#visitNode(ASTNode node)

  ...
  if(this.replacedTokensFlagged != null) {
    for (int i = 0; i <= this.data.removedTokensPtr; i++) { 
    // should be
    // for (int i = 0; i <= this.data.replacedTokensPtr; i++) { 
      if(this.data.replacedTokensStart[i] >= start &&
          this.data.replacedTokensEnd[i] <= end) {
        return true;
      }
    }
  }
  ...
Comment 3 Olivier Thomann CLA 2006-03-28 10:17:10 EST
Verified using I20060328-0010 for 3.2M6 by checking the source code.