Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Bug 142464 : NullPointerExcepetion in CElementAdaptorFactory.


While trying to integrate Common Navigator and CDT, CElementAdaptoryFactory throws null pointer exception.
 
This happens when CommonNavigator tries to adapt CModel to IProject, it checks if there is an adapter for CModel to IProject, The adapter manager will return CElementAdaptorFactory as oe.cdt.ui says all ICElements are adaptable to IProject using this factory.

On adapting CModel to IProject, CElementAdaptorFactory calls CElementAdaptorFactory.getProject(ICElement) which returns ICElement.GetCProject().getProject(); But CModel.GetCProject() is null for CModel; hence the above call throws an exception.

One solution is to check for null before calling getProject();

Question: Is there a way to exclude CModel to IProject adapter through plugin ?

I have attached a patch for the said solution.

Thanks and Regards,
Janees


Back to the top