Bug 77235 - [recovery] ArrayIndexOutOfBounds in Parser in reconciler
Summary: [recovery] ArrayIndexOutOfBounds in Parser in reconciler
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 major (vote)
Target Milestone: 3.1 M3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-28 15:50 EDT by Douglas Pollock CLA
Modified: 2004-11-04 06:49 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 Douglas Pollock CLA 2004-10-28 15:50:54 EDT
I200410260800, GTK+ 2.4.9, KDE 3.3.0, Linux 2.6.8.1 
 
This happened to me after I changed the "class" definition to a "cl" definition 
at the top of the file, and then hovered over the class name.  There was an 
index out of bounds, and now I can't even save the file anymore. 
 
Unfortunately, I accidentally deleted the original exception, but this is one 
of the follow on exceptions.  The text of the exception is the same (i.e., 
"-1"), but I can't be sure the trace is the same. 
 
I'm not sure if this is reproducible. 
 
 
java.lang.ArrayIndexOutOfBoundsException: -1 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.pushOnEnumConstantPartStack(Parser.java:8829) 
 at 
org.eclipse.jdt.internal.compiler.parser.RecoveredBlock.add(RecoveredBlock.java:157) 
 at 
org.eclipse.jdt.internal.compiler.parser.RecoveredMethod.add(RecoveredMethod.java:214) 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.consumeAllocationHeader(Parser.java:1019) 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.consumeRule(Parser.java:5115) 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8381) 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8546) 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8511) 
 at 
org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(SourceElementParser.java:1509) 
 at 
org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:117) 
 at 
org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:203)
Comment 1 Douglas Pollock CLA 2004-10-28 15:53:04 EDT
Yes, it's reproducible.  The original trace is: 
 
Exception in thread "org.eclipse.jdt.internal.ui.text.JavaReconciler" 
java.lang.ArrayIndexOutOfBoundsException: -1 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.pushOnEnumConstantPartStack(Parser.java:8829) 
 at 
org.eclipse.jdt.internal.compiler.parser.RecoveredBlock.add(RecoveredBlock.java:157) 
 at 
org.eclipse.jdt.internal.compiler.parser.RecoveredMethod.add(RecoveredMethod.java:214) 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.consumeAllocationHeader(Parser.java:1019) 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.consumeRule(Parser.java:5115) 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8381) 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8546) 
 at 
org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8511) 
 at 
org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(SourceElementParser.java:1509) 
 at 
org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:117) 
 at 
org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:203) 
 at 
org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:553) 
 at 
org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:978) 
 at 
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:60) 
 at 
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:700) 
 at 
org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:739) 
 at 
org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1104) 
 at 
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:91) 
 at 
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:133) 
 at 
org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86) 
 at 
org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:96) 
 at 
org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:75) 
 at 
org.eclipse.jdt.internal.ui.text.JavaReconciler.process(JavaReconciler.java:318) 
 at 
org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:204) 
Comment 2 Philipe Mulet CLA 2004-10-28 16:12:29 EDT
Can you please attach an exact testcase ?
Comment 3 Douglas Pollock CLA 2004-10-28 16:14:39 EDT
1.) Open Workbench.java 
2.) Change "public final class Workbench" to "public final cl Workbench" 
3.) Hover over "Workbench". 
 
Comment 4 David Audel CLA 2004-10-29 05:38:51 EDT
Enum constant recovery does not use a stack anymore.

Fixed.
Comment 5 Frederic Fusier CLA 2004-11-04 06:49:06 EST
Verified for 3.1 M3 with build I200411040010 + jdt.core HEAD