Community
Participate
Working Groups
CDT HEAD as of 20070131 Typing the following into a C++ header or source file template<class T> a NullPointerException occurs during auto-activation of content assist: java.lang.NullPointerException at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateScope.getParent(CPPTemplateScope.java:70) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics.getParentScope(CPPSemantics.java:1139) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics.lookup(CPPSemantics.java:1119) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics.prefixLookup(CPPSemantics.java:3337) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics.findBindings(CPPSemantics.java:3288) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics.findBindings(CPPSemantics.java:3279) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPScope.find(CPPScope.java:212) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamedTypeSpecifier.resolvePrefix(CPPASTNamedTypeSpecifier.java:107) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName.resolvePrefix(CPPASTName.java:89) at org.eclipse.cdt.internal.ui.text.contentassist.DOMCompletionContributor.contributeCompletionProposals(DOMCompletionContributor.java:92) at org.eclipse.cdt.internal.ui.text.contentassist.CCompletionProcessor2.computeCompletionProposals(CCompletionProcessor2.java:117)
Created attachment 58262 [details] proposed patch The NullPointerException at CPPTemplateScope.getParent() occurs due to the template's name being null. However, it is valid for the name to be null for a case such as this, since the template is empty. Also, the name is only used to handle a special case involving qualification, so simply checking for null and proceeding with the standard execution of the method should suffice.
Thanks, patch applied.