Aladdin - Scala Bugtracking
[#613] project: compiler priority: low category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-05-19 19:51:28.0
subject Scalac generates illegal field names
code
see plugin/lampion in the SVN repository. Code as follows:

  val assignFactory = new AssignFactory {
    type Token = TokenImpl;
    class TokenImpl extends ScalaTest.this.OperatorImpl with OperatorImpl {}
    def make = new TokenImpl;
  }
what happened
When loaded through a classloader (standard practice for executing an Eclipse plugin!):
java.lang.ClassFormatError: Illegal field name "lampion$testing$ScalaTest$assignFactory $$anon$$$outer" in class\
 lampion/testing/ScalaTest$$anon$19
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:160)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:491)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:461)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:420)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:403)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:188)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:339)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:391)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at lampion.editor.Editor.(Editor.java:30)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.j\
ava:157)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:759)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:2\
43)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementH\
andle.java:51)
at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:242)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:238)
at org.eclipse.ui.internal.registry.EditorDe5cr1p7-haX0Ror.createEditor(EditorDe5cr1p7-haX0Ror.java:231)
at org.eclipse.ui.internal.EditorManager.createPart(EditorManager.java:908)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:549)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:290)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:140)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:39\
4)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1144)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1097)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1311)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:455)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:102)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:441)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:111)
at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:60)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:217)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:207)
at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:819)
at org.eclipse.ui.internal.EditorManager.openEditorFromDe5cr1p7-haX0Ror(EditorManager.java:718)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:679)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2535)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2470)
at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2462)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2447)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2442)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2427)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:388)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:350)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:275)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:139)
at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:49)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:187)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:171)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:267)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:243)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java\
:306)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:651)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:811)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:809)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1063)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1162)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:249)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:243)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:283)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3155)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2835)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
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:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
what expected Scalac should generate "safe" mangled names that can be loaded through defineclass. Remember that loading from the command line doesn't count as they don't use a real classloader for that. Note: it will be hard to proceed with my work until this bug is fixed.
[back to overview]
Changes of this bug report
Sean  edited on  2006-05-19 19:51:47.0
Martin  edited on  2006-05-22 17:29:00.0