Bug 97459 - CCE during reconcile and AST creation
Summary: CCE during reconcile and AST creation
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-31 09:25 EDT by Dani Megert CLA
Modified: 2005-06-10 09:39 EDT (History)
0 users

See Also:


Attachments
New grammar file (82.42 KB, text/plain)
2005-05-31 13:42 EDT, Olivier Thomann CLA
no flags Details
Apply on HEAD (1.82 KB, patch)
2005-05-31 13:50 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2005-05-31 09:25:43 EDT
3.1 RC1

Here's the test case from bug 97402:

public class Foo {
	private static void foo() {
		 @interface Bar {
			public String bar = "Hu";

		}
	}
}

!ENTRY org.eclipse.jface 4 2 2005-05-31 15:24:09.723
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.ast.LocalDeclaration
	at
org.eclipse.jdt.internal.compiler.parser.Parser.consumeFieldDeclaration(Parser.java:3163)
	at org.eclipse.jdt.internal.compiler.parser.Parser.consumeRule(Parser.java:4741)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8462)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8713)
	at
org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.parseStatements(MethodDeclaration.java:114)
	at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.parseMethod(TypeDeclaration.java:839)
	at
org.eclipse.jdt.internal.compiler.parser.Parser.getMethodBodies(Parser.java:7792)
	at
org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(SourceElementParser.java:1339)
	at
org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:130)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:233)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:488)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:232)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:218)
	at org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:173)
	at
org.eclipse.jdt.internal.core.JavaElement.getChildrenOfType(JavaElement.java:187)
	at org.eclipse.jdt.internal.core.CompilationUnit.getTypes(CompilationUnit.java:813)
	at
org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil.getMainType(JavaElementUtil.java:85)
	at
org.eclipse.jdt.internal.corext.refactoring.RefactoringAvailabilityTester.isMoveInnerAvailable(RefactoringAvailabilityTester.java:520)
	at
org.eclipse.jdt.ui.actions.ConvertNestedToTopAction.selectionChanged(ConvertNestedToTopAction.java:88)
	at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchSelectionChanged(SelectionDispatchAction.java:210)
	at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.selectionChanged(SelectionDispatchAction.java:205)
	at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1038)
	at org.eclipse.core.runtime.Platform.run(Platform.java:775)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
	at
org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1784)
	at
org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1027)
	at
org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1053)
	at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:209)
	at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:204)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:364)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2929)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2562)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1694)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1658)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:366)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:375)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:162)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)
Comment 1 Olivier Thomann CLA 2005-05-31 12:50:16 EDT
We missed a NestedType call in the grammar when consuming annotation type member
declarations.
Comment 2 Olivier Thomann CLA 2005-05-31 13:32:26 EDT
I do have a fix for it, but I cannot simply attach the patch as it contains
binary files.
Would be a good RC2 candidate.
Comment 3 Olivier Thomann CLA 2005-05-31 13:42:20 EDT
Created attachment 22076 [details]
New grammar file
Comment 4 Olivier Thomann CLA 2005-05-31 13:50:08 EDT
Created attachment 22078 [details]
Apply on HEAD
Comment 5 Olivier Thomann CLA 2005-05-31 13:50:35 EDT
The last attachment is the corresponding regression test in AnnotationTest.test148
Comment 6 Philipe Mulet CLA 2005-06-01 04:14:49 EDT
+1 for RC2
Comment 7 Olivier Thomann CLA 2005-06-01 08:09:28 EDT
Fixed and released in HEAD.
Regression test added in AnnotationTest.test148
Comment 8 Frederic Fusier CLA 2005-06-07 13:35:20 EDT
Verified for 3.1 RC2 using build N20050607-0010 + JDT/Core HEAD
Comment 9 David Audel CLA 2005-06-10 09:39:24 EDT
Verified for 3.1 RC2 using build I20050610-0010