blob: d9e4814c468a91568a6a923d38170c012ebf09c3 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
<title>Checker Framework Tutorial</title>
<link href="webpages/bootstrap/css/bootstrap.css" rel="stylesheet" type=
"text/css">
<script type="text/javascript" src=
"webpages/bootstrap/js/bootstrap.min.js">
</script>
<link href="webpages/css/main.css" rel="stylesheet" type="text/css">
<link rel="icon" type="image/png" href=
"https://checkerframework.org/favicon-checkerframework.png">
</head>
<body>
<div class="top_liner"></div>
<div class="navbar navbar-inverse navbar-fixed-top" style=
"border-bottom: 1px solid #66d;">
<div class="navbar-inner">
<div class="contained">
<ul class="nav">
<li class="heading">Checker Framework:</li>
<li><a href="https://checkerframework.org/">Main Site</a></li>
<li><a href=
"https://checkerframework.org/manual/">
Manual</a></li>
<li><a href=
"https://groups.google.com/forum/#!forum/checker-framework-discuss">
Discussion List</a></li>
<li><a href=
"https://github.com/typetools/checker-framework/issues">Issue
Tracker</a></li>
<li><a href=
"https://github.com/typetools/checker-framework">Source
Code</a></li>
<li class="active"><a href=
"https://checkerframework.org/tutorial/">Tutorial</a></li>
</ul>
</div>
</div>
</div><img src="https://checkerframework.org/CFLogo.png" alt="Checker Framework logo">
<div class="page-header short" style=
"border-bottom: 1px solid #EEE; border-top: none;">
<h1>Checker Framework Tutorial</h1>
</div>
<div id="introduction">
<div class="page-header short" style="border-top: none;">
<h2>Introduction</h2>
</div>
<div class="section">
<p>The Checker Framework enhances Java's type system to make it more
powerful and useful. This lets software developers detect and
prevent errors in their Java programs. The Checker Framework
includes compiler plug-ins ("checkers") that find bugs or verify
their absence. It also permits software developers to write their
own compiler plug-ins.</p>
<p>In this tutorial, you will learn to use the Checker Framework to
prevent null pointer exceptions, to prevent SQL injection attacks,
and to improve code quality. In this tutorial, you will learn to use the Checker
Framework from the command line.
The Checker
Framework can also be used with other <a href=
"https://checkerframework.org/manual/#external-tools">tools</a>
such as Maven or InteliJ IDEA, and you could follow
the command-line version of the tutorial using one of those tools.</p>
</div>
</div>
<div id="commandlinetutorial">
<div class="page-header short">
<h2>Using the Checker Framework from the command line</h2>
</div>
<div class="section">
<ol>
<li><a href=
"https://checkerframework.org/manual/#installation">
Install the Checker Framework</a> and then return to this page.<br/>
As described in the installation instructions,
<a href="https://checkerframework.org/manual/#javac-installation">set
the alias
<code>javacheck</code></a> to the Checker Framework compiler.</li>
<li><a href="sourcefiles.zip">Download</a> and unzip the source
files for the tutorial, then enter the <code>src</code> directory:
<code>cd src</code></li>
<li><a href="webpages/get-started-cmd.html">Getting Started</a>, a
simple example use of the Nullness Checker</li>
<li><a href="webpages/user-input-cmd.html">Validating User
Input</a>, an example using the Regex Checker</li>
<li><a href="webpages/security-error-cmd.html">Finding a Security
Error</a>, a complex example using the Tainting Checker</li>
<li><a href="webpages/encryption-checker-cmd.html">Writing an
Encryption Checker</a>, an example of writing your own type
checker</li>
</ol>
</div>
</div>
<div id="resources">
<div class="page-header short">
<h2>Resources</h2>
</div>
<div class="section">
<ul>
<li><a href=
"https://checkerframework.org/manual/">
The Checker Framework Manual</a></li>
<li><a href="https://checkerframework.org/">The Checker Framework
homepage</a></li>
<li>There is also a
A <a href="https://github.com/glts/safer-spring-petclinic/wiki">Nullness
Checker tutorial</a> by David B&uuml;rgin, last updated in April 2016.
The tutorial doesn't work because the setup instructions are out of
date, but some people find it helpful to read through the steps.</li>
</ul>
</div>
</div>
<div class="bottom_liner"></div>
<!-- LocalWords: Plugin plugin VM SDK plugins quals classpath
-->
<!-- LocalWords: NullnessChecker plugin's hg
-->
</body>
</html>