Bug 6431 - ArrayIndexOutOfBoundsException in the SourceIndexer requestor
Summary: ArrayIndexOutOfBoundsException in the SourceIndexer requestor
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-29 11:46 EST by Olivier Thomann CLA
Modified: 2002-01-11 09:22 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2001-11-29 11:46:58 EST
I compiled the following code and I got the stack trace below.
Version used: Latest contents of JDTCORE HEAD on build 1127.

[package p;

public class A {

	protected void foo() {
	}
	
	protected A a;
	
	public class F {
	public class D {
	public class B {
		
		public void bar() {
			foo();
			class C {
				void bar() {
					foo();
				}
			}
			new C().bar();
		}
		
		public Object bar2() {
			foo();
			return (new A() {
				Object foo2() {
					foo();
					return null;
				}
			}).foo2();
		}

	}
	}
	}
}]

java.lang.ArrayIndexOutOfBoundsException: 5
	at 
org.eclipse.jdt.internal.core.search.indexing.SourceIndexerRequestor.popTypeName
(SourceIndexerRequestor.java:243)
	at 
org.eclipse.jdt.internal.core.search.indexing.SourceIndexerRequestor.exitClass(S
ourceIndexerRequestor.java:204)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:926)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser$LocalDeclarationVisitor.vi
sit(SourceElementParser.java:63)
	at 
org.eclipse.jdt.internal.compiler.ast.LocalTypeDeclaration.traverse(LocalTypeDec
laration.java:23)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.visitIfNeeded(SourceElemen
tParser.java:1199)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:746)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:915)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:919)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:919)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:919)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:581)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.endParse(SourceElementPars
er.java:328)
	at 
org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java(Compiled 
Code))
	at 
org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:6651)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(Sourc
eElementParser.java:971)
	at 
org.eclipse.jdt.internal.core.search.indexing.SourceIndexer.indexFile(SourceInde
xer.java:66)
	at 
org.eclipse.jdt.internal.core.search.indexing.AbstractIndexer.index(AbstractInde
xer.java(Compiled Code))
	at 
org.eclipse.jdt.internal.core.index.impl.Index.add(Index.java(Compiled Code))
	at 
org.eclipse.jdt.internal.core.search.indexing.AddCompilationUnitToIndex.execute(
AddCompilationUnitToIndex.java:54)
	at 
org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:2
66)
	at java.lang.Thread.run(Thread.java:498)
java.lang.ArrayIndexOutOfBoundsException: 5
	at 
org.eclipse.jdt.internal.core.search.indexing.SourceIndexerRequestor.popTypeName
(SourceIndexerRequestor.java:243)
	at 
org.eclipse.jdt.internal.core.search.indexing.SourceIndexerRequestor.exitClass(S
ourceIndexerRequestor.java:204)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:926)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser$LocalDeclarationVisitor.vi
sit(SourceElementParser.java:59)
	at 
org.eclipse.jdt.internal.compiler.ast.AnonymousLocalTypeDeclaration.traverse(Ano
nymousLocalTypeDeclaration.java:124)
	at 
org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.traverse(Qua
lifiedAllocationExpression.java:259)
	at 
org.eclipse.jdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:254)
	at 
org.eclipse.jdt.internal.compiler.ast.ReturnStatement.traverse(ReturnStatement.j
ava:237)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.visitIfNeeded(SourceElemen
tParser.java:1199)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:746)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:915)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:919)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:919)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:919)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.notifySourceElementRequest
or(SourceElementParser.java:581)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.endParse(SourceElementPars
er.java:328)
	at 
org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java(Compiled 
Code))
	at 
org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:6651)
	at 
org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(Sourc
eElementParser.java:971)
	at 
org.eclipse.jdt.internal.core.search.indexing.SourceIndexer.indexFile(SourceInde
xer.java:66)
	at 
org.eclipse.jdt.internal.core.search.indexing.AbstractIndexer.index(AbstractInde
xer.java(Compiled Code))
	at 
org.eclipse.jdt.internal.core.index.impl.Index.add(Index.java(Compiled Code))
	at 
org.eclipse.jdt.internal.core.search.indexing.AddCompilationUnitToIndex.execute(
AddCompilationUnitToIndex.java:54)
	at 
org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:2
66)
	at java.lang.Thread.run(Thread.java:498)
Comment 1 Philipe Mulet CLA 2001-11-29 11:51:49 EST
Fix is:

public void popTypeName(){
	try {
	enclosingTypeNames[--depth] = null;
	} catch (ArrayIndexOutOfBoundsException e) {
		e.printStackTrace();
	}
}
Comment 2 Philipe Mulet CLA 2001-11-29 11:55:00 EST
Fixed