Bug 68602 - [1.5] AST converter fails on local types
Summary: [1.5] AST converter fails on local types
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-25 09:23 EDT by Martin Aeschlimann CLA
Modified: 2005-01-11 11:02 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 Martin Aeschlimann CLA 2004-06-25 09:23:42 EDT
20040625

TypeDeclarationStatement fail to translate with an 3.0 AST.
(ScopeAnalyzerTest.createAST creates a 3.0 AST of the type created by:
		buf.append("package test1.ae;\n");
		buf.append("public class E {\n");
		buf.append("    public static class A {\n");
		buf.append("        public class A1 {\n");
		buf.append("            public int foo() {\n");
		buf.append("                return 1;\n");		
		buf.append("            }\n");			
		buf.append("        }\n");
		buf.append("        public class A2 {\n");
		buf.append("        }\n");		
		buf.append("        public int foo() {\n");
		buf.append("            return 2;\n");		
		buf.append("        }\n");
		buf.append("    }\n");
		buf.append("}\n");		
		buf.append("class F {\n");
		buf.append("    public int goo(int param0) {\n");
		buf.append("        class C extends E.A {\n");
		buf.append("            A1 b;\n");
		buf.append("            public int foo() {\n");
		buf.append("                return 3;\n");		
		buf.append("            }\n");
		buf.append("        }\n");		
		buf.append("        return 4;\n");
		buf.append("    }\n");			
		buf.append("}\n");

java.lang.UnsupportedOperationException: Operation only supported in JLS2 AST
	at java.lang.Throwable.<init>(Throwable.java)
	at java.lang.Throwable.<init>(Throwable.java:73)
	at org.eclipse.jdt.core.dom.ASTNode.supportedOnlyIn2(ASTNode.java:1775)
	at
org.eclipse.jdt.core.dom.TypeDeclarationStatement.getTypeDeclaration(TypeDeclarationStatement.java:247)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2328)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:626)
	at
org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:436)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2519)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1280)
	at org.eclipse.jdt.core.dom.ASTParser.convert(ASTParser.java:710)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:681)
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574)
	at
org.eclipse.jdt.ui.tests.core.ScopeAnalyzerTest.createAST(ScopeAnalyzerTest.java:769)
	at
org.eclipse.jdt.ui.tests.core.ScopeAnalyzerTest.testTypeDeclarations1(ScopeAnalyzerTest.java)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
	at java.lang.reflect.Method.invoke(Method.java:386)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.extensions.TestSetup.run(TestSetup.java:23)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
	at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:30)
	at
org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:92)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:106)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2749)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2434)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
	at
org.eclipse.pde.internal.junit.runtime.UITestApplication.run(UITestApplication.java:33)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
	at java.lang.reflect.Method.invoke(Method.java:386)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
	at org.eclipse.core.launcher.Main.run(Main.java:644)
	at org.eclipse.core.launcher.Main.main(Main.java:628)
Comment 1 Olivier Thomann CLA 2004-06-28 22:43:16 EDT
Fixed and released in stream 1.5.
Regression test added.