Extends the Java 1.4 frontend
Non-null types is a type-based approach to detect possible null pointer violations in code statically at compile time. Fähndrich and Leino showed how an object-oriented language such as Java or C# could be extended with non-null types. We have extended a Java compiler, in a modular way, to include non-null types. This is an example of how a large JastAdd project can be extended in an easy and declarative way. We have also implemented an inference algorithm to retrofit legacy code to include non-null types.
This project builds on the JastAdd Extensible Java Compiler. To run it, you need to download JastAddJ-src.jar and unpack NonNullTypes-src.jar and/or NonNullTypeInference-src.jar in the JastAddJ folder. Then you can build the tools by running ant in their respetive folders.
There are also executable jars if you are more interested in the tools than their implementations: JavaNonNullChecker.jar and JavaNonNullInferencer.jar.
The following paper describes how JastAddJ is extended with NonNull type checking and inferencing:
T. Ekman, G. Hedin:Pluggable checking and inferencing of non-null types for Java. Journal of Object Technology, Vol. 6, No. 9, pages 455-475. Special Issue: TOOLS EUROPE 2007, October 2007.
The work by Fähndrich and Leino is available in:
Declaring and Checking Non-Null Types in an Object-Oriented Language,
Manuel Fähndrich and Rustan Leino,
Proceedings of the 18th ACM Conference on Object-Oriented Programming Systems, Languages,
and Applications, Anaheim, CA, October 2003,
Available in pdf
ant |
generate all java files and compile them |
ant test |
run all test cases |
ant clean |
remove all generated files and all the class files for both generated and handwritten java files |
ant gen |
generate all java files |
ant cleanGen |
remove all generated files and their class files. |
ant |
generate all java files and compile them |
ant test |
run all test cases |
ant clean |
remove all generated files and all the class files for both generated and handwritten java files |
ant gen |
generate all java files |
ant cleanGen |
remove all generated files and their class files. |