Fix NPE in the Annotation Table of the Task Architecture
Stack Trace
!ENTRY org.eclipse.jface 4 2 2019-09-14 16:07:23.534
!MESSAGE Problems occurred when invoking code from plug-in:
“org.eclipse.jface”.
!STACK 0
java.lang.NullPointerException
at
org.fortiss.af3.platform.model.allocation.impl.MemoryAllocationTableStaticImpl.getMessageSizeByPorts(MemoryAllocationTableStaticImpl.java:131)
at
org.fortiss.af3.platform.model.allocation.impl.MemoryAllocationTableStaticImpl.getMessageSize(MemoryAllocationTableStaticImpl.java:94)
at
org.fortiss.af3.task.model.allocation.impl.TaskMemoryAllocationTableImpl.getMessageSize(TaskMemoryAllocationTableImpl.java:93)
at
org.fortiss.af3.platform.model.annotation.impl.MessageSizeStaticImpl.getDerivedValue(MessageSizeStaticImpl.java:48)
at
org.fortiss.af3.platform.model.annotation.impl.MessageSizeImpl.getDerivedValue(MessageSizeImpl.java:100)
at
org.fortiss.af3.platform.annotation.valueprovider.MessageSizeValueProvider.canEdit(MessageSizeValueProvider.java:39)
at
org.fortiss.af3.platform.annotation.valueprovider.MessageSizeValueProvider.canEdit(MessageSizeValueProvider.java:1)
at
org.fortiss.tooling.base.annotation.valueprovider.DerivedAnnotationValueProviderBase.canEdit(DerivedAnnotationValueProviderBase.java:1)
at
org.fortiss.tooling.base.annotation.AnnotationEntry.canEdit(AnnotationEntry.java:147)
at
org.fortiss.tooling.base.ui.annotation.labelprovider.AnnotationLabelProvider.getAnnotatationBackgroundColor(AnnotationLabelProvider.java:118)
at
org.fortiss.tooling.base.ui.annotation.labelprovider.AnnotationLabelProvider.getBackground(AnnotationLabelProvider.java:106)
at
org.eclipse.jface.viewers.ColumnLabelProvider.update(ColumnLabelProvider.java:40)
at
org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144)
at
org.eclipse.jface.viewers.AbstractTableViewer.doUpdateItem(AbstractTableViewer.java:394)
at
org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:421)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:176)
at
org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2103)
at
org.eclipse.jface.viewers.AbstractTableViewer.internalRefreshAll(AbstractTableViewer.java:677)
at
org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:615)
at
org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:607)
at
org.eclipse.jface.viewers.StructuredViewer.lambda$2(StructuredViewer.java:1452)
at
org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1391)
at
org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1352)
at
org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1452)
at
org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:526)
at
org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1411)
at
org.fortiss.tooling.base.ui.annotation.view.generic.GenericAnnotationView.update(GenericAnnotationView.java:270)
at
org.fortiss.tooling.base.ui.annotation.view.AnnotationViewPartBase.update(AnnotationViewPartBase.java:291)
at
org.fortiss.tooling.base.ui.annotation.view.AnnotationViewPartBase.update(AnnotationViewPartBase.java:241)
at
org.fortiss.tooling.base.ui.annotation.view.generic.GenericAnnotationView.update(GenericAnnotationView.java:277)
at
org.fortiss.tooling.base.ui.annotation.view.AnnotationViewPartBase$1$1.run(AnnotationViewPartBase.java:177)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5113)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4666)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:635)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:559)
at
org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at
org.fortiss.af3.rcapplication.AF3Application.start(AF3Application.java:49)
at
org.eclipse.equinox.internal.apEclipseAppHandle.run(EclipseAppHandle.java:203)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
at org.eclipse.equinox.launcher.Main.main(Main.java:1441)
Probable cause.
The NPE is caused by the TypeSize annotation that requires information about its parent memory allocation table. Since the NPE does not occur from the table view (tab in the Task Architecture editor) the parent table is probably not resolved correctly.
Testing
- Load the ACC example.
- If required create the port allocation such that the task ports are mapped to components port (find one component port whose type is an Enumeration such as ACCMode).
- Open the annotation view at the bottom.
- Open the task architecture and observe that the above exception does not occur.
- Open the property section of the task architecture and enter “0” in the enumeration field.
- Go back to the annotation view of the Task Architecture, navigate to an enum port, and notice the smaller bit-size value that is auto-derived (default 32).
(from redmine: issue id 3822, created on 2019-09-14, closed on 2019-10-01)
- Uploads: