diff --git a/bundles/org.eclipse.jdt.doc.user/whatsNew/jdt_whatsnew.html b/bundles/org.eclipse.jdt.doc.user/whatsNew/jdt_whatsnew.html index 1d0592c..9ceb58c 100644 --- a/bundles/org.eclipse.jdt.doc.user/whatsNew/jdt_whatsnew.html +++ b/bundles/org.eclipse.jdt.doc.user/whatsNew/jdt_whatsnew.html @@ -205,6 +205,51 @@ + + Null type annotations + + With the advent of "type annotations" as introduced in Java 8 via JSR 308, JDT takes null pointer analysis to the next level. +

+ This feature requires a set of null annotations declared with @Target({TYPE_USE}), + which JDT ships as version 2.0.0 of the + org.eclipse.jdt.annotation bundle. +

+

+ With these annotations, nullness can be considered as an intrinsic part of the type system, + allowing the compiler to perform null type checking along with each task of type checking. + This is a major step towards systematically detecting all possible NullPointerExceptions + in a program. +

+

+ The most obvious benefit is in annotating type arguments of generic types: +

+

+ +

+

+ For a comprehensive description of type annotation based null analysis see the online help. +

+

+ While potentially, the new approach could lead to an explosion of the number of annotations, + also @NonNullByDefault has become much more powerful, such that programs not using + any null values can be fully checked with just a single annotation: +

+

+ +

+

+ The switch from declaration annotations (Java 5) to null type annotations (Java 8) + brings a few unavoidable incompatibilities. Developers already using null annotations + are advised to carefully read the compatibility notes. + Even for those not planning to migrate to null type annotations, the section on + project configuration + has essential information. +

+ + + ECJ requires 1.6 JRE