1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 15:15:25 +02:00

Apply patch for bug 150955 - ADAPTER IS NULL warnings

This commit is contained in:
Martin Oberhuber 2006-07-19 07:35:27 +00:00
parent 4269bd09fa
commit 6bb6da14b2

View file

@ -44,6 +44,7 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.ui.progress.DeferredTreeContentManager;
import org.eclipse.ui.progress.PendingUpdateAdapter;
/**
@ -181,14 +182,23 @@ public class SystemViewLabelAndContentProvider extends LabelProvider
{
SystemBasePlugin.logWarning("ERROR: null passed to getAdapter in SystemViewLabelAndContentProvider");
}
else
{
if (!(o instanceof IAdaptable))
adapter = (ISystemViewElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemViewElementAdapter.class);
else
if (o instanceof IAdaptable)
{
adapter = (ISystemViewElementAdapter)((IAdaptable)o).getAdapter(ISystemViewElementAdapter.class);
}
else
{
adapter = (ISystemViewElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemViewElementAdapter.class);
}
if (adapter == null)
SystemBasePlugin.logWarning("ADAPTER IS NULL FOR ELEMENT OF TYPE: " + o.getClass().getName());
{
if (!(o instanceof PendingUpdateAdapter))
{
SystemBasePlugin.logWarning("ADAPTER IS NULL FOR ELEMENT OF TYPE: " + o.getClass().getName());
}
}
}
if ((adapter!=null) && (viewer != null))
{