javaswtjface

why do we get AssertionFailedError?


I have the following piece of code:

        TableViewer tv = new TableViewer(attributeTable);
        tv.setContentProvider(new BOAttributeTableContentProvider());
        tv.setLabelProvider(new BOAttributeTableLabelProvider());

where while setting the label provider i am getting AssertionFailedError. can anybody tell me what wrong i am doing here? or in which case it throws this error?

error Log:

org.eclipse.jface.util.Assert$AssertionFailedException: null argument;
    at org.eclipse.jface.util.Assert.isNotNull(Assert.java:150)
    at org.eclipse.jface.util.Assert.isNotNull(Assert.java:126)
    at org.eclipse.jface.viewers.StructuredViewer.disassociate(StructuredViewer.java:615)
    at org.eclipse.jface.viewers.TableViewer.internalRefreshAll(TableViewer.java:904)
    at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:818)
    at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:807)
    at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1388)
    at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1323)
    at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1386)
    at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1345)
    at org.eclipse.jface.viewers.ContentViewer.setLabelProvider(ContentViewer.java:281)
    at org.eclipse.jface.viewers.StructuredViewer.setLabelProvider(StructuredViewer.java:2003)
    at org.eclipse.jface.viewers.TableViewer.setLabelProvider(TableViewer.java:1086)
    at com.misys.bankfusion.bpdesigner.boeditor.pages.BOAttributesPage.populateAttributeTableContents(BOAttributesPage.java:458)
    at com.misys.bankfusion.bpdesigner.boeditor.pages.BOAttributesPage.access$000(BOAttributesPage.java:128)
    at com.misys.bankfusion.bpdesigner.boeditor.pages.BOAttributesPage$1.setToModel(BOAttributesPage.java:341)
    at com.trapedza.bankfusion.editor.AbstractEditorDelegate.updateData(AbstractEditorDelegate.java:173)
    at com.trapedza.bankfusion.editor.AbstractEditorDelegate$1.dialogFieldChanged(AbstractEditorDelegate.java:181)
    at com.trapedza.bankfusion.utils.dialogs.internal.DialogField.dialogFieldChanged(DialogField.java:132)
    at com.trapedza.bankfusion.utils.dialogs.internal.ListBoxDialogField.doModifySelection(ListBoxDialogField.java:51)
    at com.trapedza.bankfusion.utils.dialogs.internal.ComboDialogField$2.widgetSelected(ComboDialogField.java:153)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    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)

Solution

  • Constructor that you are using (TableViewer) or two setters (setContentProvider, setLabelProvider) have guarding assert statements which are throwing these exceptions. Author of the code had an idea to protect its code from irregular parameters that you are using when invoking her/his code.