1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix for 192239, NPE in CPPClassTemplate.

This commit is contained in:
Markus Schorn 2007-06-12 16:15:15 +00:00
parent 9a64852657
commit 3ac39f0507

View file

@ -437,8 +437,16 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
* @see org.eclipse.cdt.core.dom.ast.ICompositeType#getKey()
*/
public int getKey() {
if( definition != null )
return getCompositeTypeSpecifier().getKey();
if( definition != null ) {
ICPPASTCompositeTypeSpecifier cts= getCompositeTypeSpecifier();
if (cts != null) {
return cts.getKey();
}
IASTNode n= definition.getParent();
if (n instanceof ICPPASTElaboratedTypeSpecifier) {
return ((ICPPASTElaboratedTypeSpecifier)n).getKind();
}
}
if( declarations != null && declarations.length > 0 ){
IASTNode n = declarations[0].getParent();