Project

General

Profile

Bug #10252

Updated by Viktoria Kopach over 4 years ago

1. На узле проекта создаем атрибут "attr1", тип ENUM_DEFINITION, список значений пустой. И создаем атрибут "attr2", тип ENUM_DEFINITION, список значений заполняем, он НЕ пустой. 
 2. На проекте открываем настройки -> вкладка "Mandatory Attributes". Открываем список "Type". 
 Видим, что в списке есть "@attr1". 

 Ожидается, что пустого ENUM в списке доступных типов не будет, как это реализовано для обычных атрибутов в узлах проекта. 

 3. Выбираем в этом списке "@attr1", возникает сообщение об ошибке: 
 <pre> 
 An error has occurred. See error log for more details. 
 java.lang.String cannot be cast to com.unitesk.requality.core.attribute.AppliedEnumValue 
 </pre> 

 Тест ошибки из Error log: 
 <pre> 
 eclipse.buildId=4.6.3.M20170301-0400 
 java.version=1.8.0_242 
 java.vendor=AdoptOpenJDK 
 BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=ru_RU 
 Framework arguments:    -product com.unitesk.requality.product.product -perspective com.unitesk.requality.main.perspective -perspective com.unitesk.requality.main.perspective 
 Command-line arguments:    -os win32 -ws win32 -arch x86 -product com.unitesk.requality.product.product -perspective com.unitesk.requality.main.perspective -perspective com.unitesk.requality.main.perspective 

 org.eclipse.jface 
 Error 
 Fri Apr 10 14:59:15 MSK 2020 
 Problems occurred when invoking code from plug-in: "org.eclipse.jface". 

 java.lang.ClassCastException: java.lang.String cannot be cast to com.unitesk.requality.core.attribute.AppliedEnumValue 
	 at com.unitesk.requality.eclipse.views.projectSettings.ReqAttrsProperties$9.update(ReqAttrsProperties.java:325) 
	 at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:141) 
	 at org.eclipse.jface.viewers.AbstractTableViewer.doUpdateItem(AbstractTableViewer.java:389) 
	 at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:474) 
	 at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) 
	 at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50) 
	 at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173) 
	 at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2170) 
	 at org.eclipse.jface.viewers.AbstractTableViewer.internalRefreshAll(AbstractTableViewer.java:676) 
	 at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:614) 
	 at org.eclipse.jface.viewers.StructuredViewer.lambda$1(StructuredViewer.java:1542) 
	 at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1458) 
	 at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1419) 
	 at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1542) 
	 at org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:535) 
	 at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1503) 
	 at com.unitesk.requality.eclipse.views.projectSettings.ReqAttrsProperties.initTypedEditor(ReqAttrsProperties.java:554) 
	 at com.unitesk.requality.eclipse.views.projectSettings.ReqAttrsProperties$7.widgetSelected(ReqAttrsProperties.java:292) 
	 at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249) 
	 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
	 at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418) 
	 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079) 
	 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236) 
	 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824) 
	 at org.eclipse.jface.window.Window.runEventLoop(Window.java:818) 
	 at org.eclipse.jface.window.Window.open(Window.java:794) 
	 at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:157) 
	 at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) 
	 at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565) 
	 at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397) 
	 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
	 at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418) 
	 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079) 
	 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236) 
	 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824) 
	 at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121) 
	 at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) 
	 at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022) 
	 at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150) 
	 at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693) 
	 at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) 
	 at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610) 
	 at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) 
	 at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138) 
	 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:388) 
	 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) 
	 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:498) 
	 at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673) 
	 at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610) 
	 at org.eclipse.equinox.launcher.Main.run(Main.java:1519) 

 </pre> 

 4. При этом если выбрать сначала непустой ENUM-тип "attr2", а потом снова "attr1", то такой проблемы не будет, но значение по умолчанию останется от "attr2". И после нажатия кнопки со стрелочкой "влево" значение в поле "Type" изменится на "attr2". В итоге обязательный атрибут будет создаваться по нему, а не по "attr1".

Back