Community
Participate
Working Groups
When entering an anomaly detail to specify a rule violation, the OK button is enabled but doesn't work. One can only cancel the dialog and then the system falls in an unstable state. - Anomaly properties are disabled - All context menus of Review Group, Reviews, Rule Sets, etc are gone - All Review Navigator are greyed out *except* Refresh Data - Need to refresh the Review Navigator (Refresh Data button) to reset things To reproduce: - Select an anomaly - In Property View (Detailed tab), expand "Anomaly Details" - Select Rule ID "Update..." - In "Enter Anomaly Details", expand "Extra Parameters" - Select a rule violation - Click "OK" Nothing happens. You can only "Cancel" and then the system became unstable. Exception Stack Trace: java.lang.ClassCastException: org.eclipse.mylyn.reviews.r4e.ui.internal.model.R4EUIRuleViolation cannot be cast to org.eclipse.mylyn.reviews.r4e.ui.internal.model.R4EUIRule at org.eclipse.mylyn.reviews.r4e.ui.internal.dialogs.NewAnomalyInputDialog.buttonPressed(NewAnomalyInputDialog.java:286) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:628) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3363) at org.eclipse.mylyn.reviews.r4e.ui.internal.dialogs.NewAnomalyInputDialog.pumpMessages(NewAnomalyInputDialog.java:926) at org.eclipse.mylyn.reviews.r4e.ui.internal.dialogs.NewAnomalyInputDialog.open(NewAnomalyInputDialog.java:915) at org.eclipse.mylyn.reviews.r4e.ui.internal.properties.tabbed.AnomalyTabPropertySection$7.handleEvent(AnomalyTabPropertySection.java:624) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3363) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
The ClassCastException occurred because the selected rule violation wasn't a really a rule but a rule *class*. No check is performed before casting hence the exception. A simple solution would be to perform a class check (instanceof) before casting. If the type is wrong then just skip the whole operation.
This casting exception occurs only in UNIX environment, does not happen in Window environment. We still need to fix it.
Added the missing class check before the cast. Fixed in commit 997e1818e159b301d24d9309e3bbb1da855013d9.
Fixed in commit 997e1818e159b301d24d9309e3bbb1da855013d9