Access Keys:
Skip to content (Access Key - 0)

Preventing bugs with pluggable type-checking for Java

Abstract

Type-checking helps to detect and prevent errors. However, it doesn't detect and prevent enough errors! Java types are incapable of expressing important information, such as whether a variable may be null, whether a value is intended to be side-effected, or whether a String is interned. As a result, a Java program can suffer from null pointer exceptions, incorrect mutations, errors in equality testing, and many other types of problems.

I will present practical tools that you can use at compile time to detect such errors, prevent them, or verify their absence. A programmer can write type qualifiers in a Java program (e.g., List<@NonNull Object>) and use a compiler plugin to check the program for errors or verify their absence. The tools are in wide use, and programmers find them easy to use and useful in finding and preventing bugs. Furthermore, our Checker Framework makes it easy for programmers to write their own custom pluggable type-checkers to detect other errors.

The tools make optional use of an extension to the Java annotation system (named JSR 308) that is planned for inclusion in Java 7. Your programs remain completely compatible with previous compilers and JVMs.

The talk will include demonstrations of the tools in action. The tools are freely available from http://pag.csail.mit.edu/jsr308/ .

Speaker

View talk on Parleys.com


Adaptavist Theme Builder Powered by Atlassian Confluence
Free theme builder license