[
https://issues.jboss.org/browse/FURNACE-104?page=com.atlassian.jira.plugi...
]
George Gastaldi commented on FURNACE-104:
-----------------------------------------
Fixed by handling {{Optional}} objects separately
ClassCastException when method returns java.util.Optional
---------------------------------------------------------
Key: FURNACE-104
URL:
https://issues.jboss.org/browse/FURNACE-104
Project: Forge: Furnace
Issue Type: Feature Request
Components: ClassLoader Adapter
Affects Versions: 2.23.0.Final
Environment: Eclipse
Reporter: George Gastaldi
Assignee: George Gastaldi
Fix For: 2.23.1.Final
When declaring an API that returns a {{java.util.Optional}} object, the following error
is thrown:
{code}
java.lang.ClassCastException:
org.javassist.tmp.java.lang.reflect.Member_$$_javassist_eca8918e-7b7f-417e-a7d0-76b7ad842368
cannot be cast to java.util.Optional
at
org.jboss.forge.addon.ui.context.UISelection_$$_javassist_71d3f1cb-f8e7-4108-92f7-51f1dd0f8d3e.getSelectedRegionFor(UISelection_$$_javassist_71d3f1cb-f8e7-4108-92f7-51f1dd0f8d3e.java)
at
org.jboss.forge.addon.ui.example.commands.ShowSelectedRegionCommand.execute(ShowSelectedRegionCommand.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at
org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87)
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)
at
org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103)
at
org.jboss.forge.addon.ui.example.commands.ShowSelectedRegionCommand_$$_javassist_ddbfd754-b96b-495f-ac6e-ca1184ff58ab.execute(ShowSelectedRegionCommand_$$_javassist_ddbfd754-b96b-495f-ac6e-ca1184ff58ab.java)
at
org.jboss.forge.addon.ui.impl.controller.SingleCommandControllerImpl.execute(SingleCommandControllerImpl.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at
org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:123)
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)
at
org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:96)
at
org.jboss.forge.addon.ui.controller.CommandController_$$_javassist_d61043ab-f45c-4ed0-b9c7-6c5898baad65.execute(CommandController_$$_javassist_d61043ab-f45c-4ed0-b9c7-6c5898baad65.java)
at
org.jboss.tools.forge.ui.internal.ext.wizards.ForgeWizard$1.run(ForgeWizard.java:113)
at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:696)
at
org.jboss.tools.forge.ui.internal.ext.wizards.ForgeWizard.performFinish(ForgeWizard.java:97)
at
org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:204)
at
org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:102)
at
org.jboss.tools.forge.ui.internal.ext.dialog.UICommandListDialog$1$1.handleElementSelected(UICommandListDialog.java:233)
at
org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.handleSelection(QuickAccessContents.java:322)
at
org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.access$0(QuickAccessContents.java:312)
at
org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents$6.mouseUp(QuickAccessContents.java:461)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4481)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1329)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3819)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3430)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)