Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345227

Summary: Potential NPE in NamesAreUniqueValidationHelper#createDuplicateNameError()
Product: [Modeling] TMF Reporter: Karsten Thoms <karsten.thoms>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED INVALID QA Contact:
Severity: minor    
Priority: P3    
Version: 1.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Karsten Thoms CLA 2011-05-10 02:58:51 EDT
In this method the name feature is resolved by calling getNameFeature(). The default implementation will use 
   SimpleAttributeResolver.NAME_RESOLVER.getAttribute(object)
This can return null when the object does not have a 'name' feature, but the IQualifiedNameProvider resolved a name from another feature.

When calling the acceptor with a null feature, this will result in a NPE. The situation should be handled more gracefully.
Comment 1 Sven Efftinge CLA 2012-11-21 04:57:18 EST
the parameter 'feature' is declared as nullable, so any implementation should be able to handle that.
	 * @param feature the feature or <code>null</code> if the complete instance should be annotated.