Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362901 - Add @Nullable, @NonNull support
Summary: Add @Nullable, @NonNull support
Status: RESOLVED WONTFIX
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: 2.7.0   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 415558
  Show dependency tree
 
Reported: 2011-11-04 09:08 EDT by Ed Willink CLA
Modified: 2018-02-12 06:32 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 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.