I have a label provider for my model tree view:
public class ModelTreeLabelProvider implements ILabelProvider {
@Inject
IWorkbench workbench;
@Override
public Image getImage(Object element) {
return workbench.getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
}
[...]
}
It does work nice and dandy, but on application exit I get an InjectionException. I assume because at that time the Workbench no longer exists.
Actually I no longer use this class when the application is shutting down, so it is not a problem as is, just clutters up my log.
How to get rid of this error?
The first few lines of the stack trace:
org.eclipse.e4.core.di.InjectionException: org.eclipse.e4.core.di.InjectionException: Unable to process "ModelTreeLabelProvider.workbench": no actual value was found for the argument "IWorkbench".
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:66)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:977)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:939)
at org.eclipse.e4.core.internal.di.InjectorImpl.uninject(InjectorImpl.java:182)
uninjecttrying to run a@PreDestroyannotated method