Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] CPPMethodTemplate.getClassOwner() results injava.lang.ClassCastException

This bug was fixed a year ago in CDT 5.0.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=203967 

Markus.

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Nayna Jain
> Sent: Wednesday, April 08, 2009 2:05 PM
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] CPPMethodTemplate.getClassOwner() results 
> injava.lang.ClassCastException
> Importance: Low
> 
> Hi all,
> 
> While browsing the C++ Class, there was a method template 
> defined inside it.
> 
> I could get function Declarator for ti.
> 
> Using that function Declaration I extracted binding for it 
> which was CPPMethodTemplate
> 
> Now I had to get the class of which this method is a member.
> 
> So I tried  ((CPPMethod)binding).getClassOwner().
> 
> But it returned me  java.lang.ClassCastException:
> org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateScope 
> incompatible with org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope.
> 
> When I tried to look at CPPMethodTemplate.java file.
> 
> Then the code in it for this method is as follows :
> 
> public ICPPClassType getClassOwner() throws DOMException{
>       ICPPClassScope scope = (ICPPClassScope)getScope();
>       return scope.getClassType();
> }
> 
> Can someone please help me explaining what is wrong here and 
> how to resolve this exception.
> 
> Thanks & Regards,
> Nayna Jain
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 


Back to the top