ABSTRACT
We have created a system that enables programmers to add custom type qualifiers to the Java language in a backward-compatible way. The system allows programmers to write type qualifiers in their programs and to create compiler plug-ins that enforce the semantics of these qualifiers at compile time. The system builds on existing Java tools and APIs, and on JSR 308.
As an example, we introduce a plug-in to Sun's Java compiler that uses our system to type-check the NonNull qualifier. Programmers can use the @NonNull annotation to prohibit an object reference from being null; then, by invoking a Java compiler with the NonNull plug-in, they can check for NonNull errors at compile time and rid their programs of null-pointer exceptions.
- Gilad Bracha. JSR 175: A metadata facility for the Java programming language. http://jcp.org/en/jsr/detail?id=175, September 30, 2004.Google Scholar
- Joe Darcy. JSR 269: Pluggable annotation processing API. http://jcp.org/en/jsr/detail?id=269, May 17, 2006. Public review version.Google Scholar
- Michael D. Ernst and Danny Coward. JSR 308: Annotations on Java types. http://pag.csail.mit.edu/jsr308/, October 17, 2006.Google Scholar
- Telmo Luis Correa Jr., Jaime Quinonez, and Michael D. Ernst. Tools for enforcing and inferring reference immutability in Java. In OOPSLA Companion, October 2007. Google ScholarDigital Library
- Matthew S. Tschantz and Michael D. Ernst. Javari: Adding reference immutability to Java. In OOPSLA, pages 211--230, October 2005. Google ScholarDigital Library
- Yoav Zibin, Alex Potanin, Mahmood Ali, Shay Artzi, Adam Kiezun, and Michael D. Ernst. Object and reference immutability using Java generics. In ESEC/FSE, September 2007. Google ScholarDigital Library
Index Terms
- Compile-time type-checking for custom type qualifiers in Java
Recommendations
Compile-time type-checking for custom type qualifiers in Java
OOPSLA '07: Companion to the 22nd ACM SIGPLAN conference on Object-oriented programming systems and applications companionWe have created a system that enables programmers to add custom type qualifiers to the Java language in a backward-compatible way. The system allows programmers to write type qualifiers in their programs and to create compiler plug-ins that enforce the ...
Practical pluggable types for java
ISSTA '08: Proceedings of the 2008 international symposium on Software testing and analysisThis paper introduces the Checker Framework, which supports adding pluggable type systems to the Java language in a backward-compatible way. A type system designer defines type qualifiers and their semantics, and a compiler plug-in enforces the ...
Compile-time type-checking for custom type qualifiers in Java
OOPSLA Companion '08: Companion to the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applicationsThe Checker Framework enables adding custom type qualifiers to the Java language in a backward-compatible way. The Checker Framework allows programmers to write type qualifiers in their programs and to create compiler plug-ins that enforce the semantics ...
Comments