Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345227 - Potential NPE in NamesAreUniqueValidationHelper#createDuplicateNameError()
Summary: Potential NPE in NamesAreUniqueValidationHelper#createDuplicateNameError()
Status: CLOSED INVALID
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-10 02:58 EDT by Karsten Thoms CLA
Modified: 2012-11-21 04:57 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.