This example project illustrates how the Property Checker can be used in your project.
It is organized as follows:
- The file
lattice_intervalcontains the definiton for a property qualifier hierarchy. - The package
qualcontains the annotation types used inlattice_interval. - The package
clientcontains a simple example project which uses this qualifier hierarchy.
To type-check this program using the Property Checker, run the following commands. The commands assume that the working directory contains the following:
- A directory
property-checkercontaing fully assembled the Property Checker (see the Property Checker's documention for how to build it). - A directory
property-checker-tutorialcontaing this example project.
If your local configuaration differs from this, adjust the command as needed.
cd property-checker-tutorial
./gradlew assemble
cd ..
property-checker/javac \
-cp property-checker/property-checker.jar:property-checker-tutorial/build/libs/property-checker-tutorial.jar \
-processor edu.kit.iti.checker.property.checker.PropertyChecker \
property-checker-tutorial/src/main/java/*/*.java \
-APropertyChecker_inDir=property-checker-tutorial/src/main/java \
-APropertyChecker_outDir=property-checker-out \
-APropertyChecker_lattices=property-checker-tutorial/lattice_interval \
-APropertyChecker_qualPkg=qual
The command is made up of the following parts:
-cpspecifies the compilation classpath, which must contain the Property Checker and thequalpackage from our project, hence bothproperty-checker.jarandproperty-checker-tutorial.jar. The correct version of the Checker Framework needed by the Property Checker is included inproperty-checker.jarand should not be included separately.-processorspecifies the checker(s) to use, in our case the Property Checker- The line after that gives the files which should be checked.
-APropertyChecker_inDirgives the root directory for our project's source code. This may seen redundant with the previous line, but it is necessary for the Property Checker to know not just the files it should check, but also the file/package structure of the project.-APropertyChecker_outDirgives the directory the JML translation should be written to.-APropertyChecker_latticesgives the files containing the definiton for the property qualifier hierarchy. If multiple hierarchies are specified, the files should be separated by,.-APropertyChecker_qualPkggives the fully qualified name of thequalpackage.