Bye, bye, NPE

Session Type: 
Standard [25 minutes]

Schedule info

Despite all advances in the software field, the most common bug is still the most embarrassing bug that OOP has to offer: NullPointerException.

The main weapon in fighting NPEs is known for quite some time: annotating your types with either @Nullable or @NonNull. It has also been shown how appropriate defaults enable you to omit more than 2/3 of all required annotations without loss of precision. Still, null annotations haven't yet made their way into mainstream development with Java, and so we keep developing new NPEs every day.

This talk will present an initiative to enhance the Eclipse Java Compiler with the capability to perform comprehensive analysis of null problems in your code using null annotations. Current plans state that this support shall be released as part of Juno. The new analysis together with the corresponding new quick assists will allow you to adopt null annotations at any level and gradient: from making a few API contracts explicit and checkable up-to eventually providing guarantees that a fully annotated program will never throw NPE.

Until the Juno release the new functionality is made available as a separate download that has been developed using OT/J as the implementation language. A look behind the scenes will reveal how Object Teams has once again kept the promise of extreme modularity: We need tight integration for extending a complex application (the Eclipse Java Compiler) with a complex new feature (annotation based null analysis). OT/J is a champ for integration. We didn't want to compromise the separation of concerns and again OT/J is our friend: the new feature is a cleanly separated and concise module with all the benefits for development, building and deployment.