Release 3.12.0 of the Checker Framework

5 views
Skip to first unread message

Suzanne Millstein

unread,
Apr 1, 2021, 3:06:02 PM4/1/21
to Checker Framework discussion
We have released a new version of the Checker Framework.
The Checker Framework lets you create and/or run pluggable type checkers, in order to detect and prevent bugs in your code.

You can find documentation and download links at:
http://CheckerFramework.org/

Changes for Checker Framework version 3.12.0:

**User-visible changes:**

New FAQ item "How should I annotate code that uses generics?" gives examples of annotations on type variables, together with their meaning.

`-Ainfer=ajava` uses ajava files (rather than jaif files or stub files) internally during whole-program inference.

The Optional Checker supports a new annotation `@OptionalBottom` that stands for (only) the `null` value.

The `value` element/argument to `@EnumVal` is now required.  Previously it defaulted to an empty array.

**Implementation details:**

A precondition or normal postcondition annotation's `value` element must have type `String[]`, not `String`.  A conditinoal postcondition annotation's `expression` element must have type `String[]`, not `String`.  These changes will not affect users (any programmer-written annotation that was legal before will still be legal), but it may affect checker implementations.

`JavaExpressionParseUtil`:
`JavaExpressionParseUtil#parse` no longer viewpoint-adapts Java expressions. It just converts the expression `String` to a `JavaExpression`.  To that end, `JavaExpressionParseUtil.JavaExpressionContext` has been removed and `JavaExpressionParseUtil#parse` no longer takes a context object.  Most calls to `JavaExpressionParseUtil#parse` should be replaced with a call to one of the methods in `StringToJavaExpressions`.

Renamed `AnnotatedTypeComparer` to `DoubleAnnotatedTypeScanner`. In the new class, the method `compare` was renamed `defaultAction`. The method `combineRs` was replaced by `reduce`.

Removed methods:
 * `AnnotationUtils.getElementValueArrayOrSingleton`
 * `DependentTypesHelper.standardizeNewClassTree`: use `atExpression` instead
 * `DependentTypesHelper.standardizeString`: override one of the methods explained in the Javadoc of `convertAnnotationMirror`

Method renamings:
 * `DefaultQualifierForUseTypeAnnotator.getSupportAnnosFromDefaultQualifierForUses` => `getDefaultQualifierForUses`
 * In `DependentTypesHelper`:
    * `check*` => `check*ForErrorExpressions`
    * `viewpointAdaptConstructor` => `atConstructorInvocation`
    * `viewpointAdaptMethod` => `atMethodInvocation`
    * `viewpointAdaptTypeVariableBounds` => `atParameterizedTypeUse`
    * `standardizeClass` =>  `atTypeDecl`
    * `standardizeExpression` => `atExpression`
    * `standardizeFieldAccess` => `atFieldAccess`
    * `standardizeReturnType` => `atReturnType`
    * `standardizeVariable` => `atVariableDeclaration`

Deprecated some overloads in `AnnotationUtils` that take a `CharSequence`
(use an overload that takes an `ExecutablElement`):
 * `getElementValueArray`
 * `getElementValueClassName`
 * `getElementValueClassNames`
 * `getElementValueEnumArray`
 * `getElementValueEnum`
 * `getElementValue`
 * `getElementValuesWithDefaults`

Deprecated methods in `AnnotationUtils`:
 * `areSameByClass`: use `areSameByName`
 * `getElementValuesWithDefaults`: use a `getElementValue*` method

Removed deprecated `PluginUtil` class.

**Closed issues:**
#1376, #3740, #3970, #4041, #4254, #4346, #4355, #4358, #4372, #4381, #4384, #4417, #4449, #4452, #4480.
Reply all
Reply to author
Forward
0 new messages