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

Bug 362901

Summary: Add @Nullable, @NonNull support
Product: [Modeling] EMF Reporter: Ed Willink <ed>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3    
Version: 2.7.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Bug Depends on:    
Bug Blocks: 415558    

Description Ed Willink CLA 2011-11-04 09:08:52 EDT
JDT M4 will have @Nullable, @NonNull.

Please add them to EMF.
Comment 1 Ed Willink CLA 2013-08-21 06:59:55 EDT
From playing around with adding @NonNull myself it looks the following are easy and safe:

In generated code:

all List-returning getXXX methods return @NonNull

static constants such as eINSTANCE are @NonNull

all createXXX methods return @NonNull

EcoreSwitch cases have an @NonNull argument

In support code

all URI create methods return @NonNull and many other methods too.

Moving on to @NonNull/@Nullable for arguments requires more careful consideration, but if the declarations are accurate it should only break code that has requested to be broken by enabling the analysis.
Comment 2 Ed Merks CLA 2018-02-12 06:32:44 EST
No, this is too much noise of questionable value.