[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| RE: [cdt-dev] Bug 142464 : NullPointerExcepetion	inCElementAdaptorFactory. | 
Hi Janees,
 
I am currently starting to do the same thing for CDT 
4.0, see also
and I ran into the very same problem 
:)
AFAIK, the adapter factory cannot be disabled by 
another plugin.
I don't know if a committer is willing to apply your 
patch for 3.1, but I would
certainly support this as it is quite a trivial 
fix.
 
Toni
  
  
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