Releases: typetools/checker-framework
Checker Framework 3.10.0
Version 3.10.0, February 1, 2021
User-visible changes:
Moved utility classes from checker-qual.jar
to the new checker-util.jar
.
Also, added util
to the end of all the packages of the utility classes.
In Maven Central, checker.jar
no longer contains duplicates of qualifiers in checker-qual.jar
, but rather uses a Maven dependency. A fat jar file with all the dependencies (like the old checker.jar
) is available in Maven Central with the classifier "all".
When supplying the -Ainfer=...
command-line argument, you must also supply -Awarns
.
Replaced several error message keys:
contracts.precondition.expression.parameter.name
contracts.postcondition.expression.parameter.name
contracts.conditional.postcondition.expression.parameter.name
method.declaration.expression.parameter.name
by new message keys:expression.parameter.name.invalid
expression.parameter.name.shadows.field
Implementation details:
Deprecated ElementUtils.enclosingClass
; use ElementUtils.enclosingTypeElement
.
Removed classes (use SourceChecker
instead):
BaseTypeContext
CFContext
BaseContext
Removed methods:
SourceChecker.getContext()
: it returned the receiverSourceChecker.getChecker()
: it returned the receiverAnnotatedTypeFactory.getContext()
: usegetChecker()
- methods on
TreePath
s from class 'TreeUtils; use the versions in
TreePathUtil`.
Moved class:
org.checkerframework.framework.util.PurityUnqualified
toorg.checkerframework.framework.qual.PurityUnqualified
Renamed methods:
AnnotatedTypeMirror.directSuperTypes
=>directSupertypes
(note capitalization) for consistency withjavax.lang.model.util.Types
AnnotatedTypeMirror.removeAnnotation(Class)
=>removeAnnotationByClass
MethodCall.getParameters
=>getArguments
MethodCall.containsSyntacticEqualParameter
=>containsSyntacticEqualArgument
ArrayAccess.getReceiver
=>getArray
Checker Framework 3.9.1
Version 3.9.1, January 13, 2021
Implementation details:
Copied methods on TreePath
s from class 'TreeUtilsto new class
TreePathUtil`.
(The methods in TreePath will be deleted in the next release.)
TreeUtils.enclosingClass
=>TreePathUtil.enclosingClass
TreeUtils.enclosingMethod
=>TreePathUtil.enclosingMethod
TreeUtils.enclosingMethodOrLambda
=>TreePathUtil.enclosingMethodOrLambda
TreeUtils.enclosingNonParen
=>TreePathUtil.enclosingNonParen
TreeUtils.enclosingOfClass
=>TreePathUtil.enclosingOfClass
TreeUtils.enclosingOfKind
=>TreePathUtil.enclosingOfKind
TreeUtils.enclosingTopLevelBlock
=>TreePathUtil.enclosingTopLevelBlock
TreeUtils.enclosingVariable
=>TreePathUtil.enclosingVariable
TreeUtils.getAssignmentContext
=>TreePathUtil.getAssignmentContext
TreeUtils.inConstructor
=>TreePathUtil.inConstructor
TreeUtils.isTreeInStaticScope
=>TreePathUtil.isTreeInStaticScope
TreeUtils.pathTillClass
=>TreePathUtil.pathTillClass
TreeUtils.pathTillOfKind
=>TreePathUtil.pathTillOfKind
Checker Framework 3.9.0
Version 3.9.0, January 4, 2021
New scripts checker/bin/wpi.sh
and checker/bin/wpi-many.sh
run whole-program inference, without modifying the source code of the target programs.
The -Ainfer
command-line argument now infers
- method preconditions (
@RequiresQualifiers
,@RequiresNonNull
) - method postconditions (
@EnsuresQualifiers
,@EnsuresNonNull
) @MonotonicNonNull
The Called Methods Checker supports the -AdisableReturnsReceiver command-line option.
The Format String Checker recognizes Error Prone's @FormatMethod
annotation.
Use of @SuppressWarnings("fbc")
to suppress initialization warnings is deprecated.
Implementation details:
Class renamings:
StubParser
=>AnnotationFileParser
Receiver
=>JavaExpression
- also related class and method renamings
- In the Dataflow Framework:
ThisLiteralNode
=>ThisNode
ExplicitThisLiteralNode
=>ExplicitThisNode
ImplicitThisLiteralNode
=>ImplicitThisNode
Method deprecations:
- Deprecated
AnnotatedTypeFactory.addAliasedAnnotation
; useaddAliasedTypeAnnotation
Closed issues:
#765, #2452, #2953, #3377, #3496, #3499, #3826, #3956, #3971, #3974, #3994, #4004, #4005, #4018, #4032, #4068, #4070.
Checker Framework 3.8.0
Version 3.8.0, December 1, 2020
The Initialized Fields Checker warns when a field is not initialized by a constructor. This is more general than the Initialization Checker, which only checks that @NonNull
fields are initialized.
The manual describes how to modify an sbt build file to run the Checker Framework.
The -AwarnUnneededSuppressions command-line option warns only about suppression strings that contain a checker name.
The -AwarnUnneededSuppressionsExceptions=REGEX command-line option partially disables -AwarnUnneededSuppressions. Most users don't need this.
Implementation details:
Added classes SubtypeIsSubsetQualifierHierarchy
and SubtypeIsSupersetQualifierHierarchy
.
Moved the contractsUtils
field from the visitor to the type factory.
Class renamings:
ContractsUtils
=>ContractsFromMethod
Method renamings:
ElementUtils.getVerboseName
=>ElementUtils.getQualifiedName
ElementUtils.getSimpleName
=>ElementUtils.getSimpleSignature
Field renamings:
AnnotatedTypeMirror.actualType
=>AnnotatedTypeMirror.underlyingType
Added a formal parameter to methods in MostlyNoElementQualifierHierarchy
:
leastUpperBoundWithElements
greatestLowerBoundWithElements
Removed a formal parameter from methods in BaseTypeVisitor
:
checkPostcondition
checkConditionalPostcondition
In Analysis.runAnalysisFor()
, changed boolean
parameter to enum BeforeOrAfter
.
Removed org.checkerframework.framework.util.AnnotatedTypes#getIteratedType
; use AnnotatedTypeFactory#getIterableElementType(ExpressionTree)
instead.
Closed issues:
#3287, #3390, #3681, #3839, #3850, #3851, #3862, #3871, #3884, #3888, #3908, #3929, #3932, #3935.
Checker Framework 3.7.1
Version 3.7.1, November 2, 2020
The Constant Value Checker supports two new annotations: @EnumVal
and @MatchesRegex
.
The Nullness Checker supports annotation org.jspecify.annotations.NullnessUnspecified
.
Implementation details:
AnnotatedIntersectionType#directSuperTypes now returns List<? extends AnnotatedTypeMirror>.
The @RelevantJavaTypes
annotation is now enforced: a checker issues a warning if the programmer writes a type annotation on a type that is not listed.
Deprecated CFAbstractTransfer.getValueWithSameAnnotations(), which is no longer used. Added new methods getWidenedValue() and getNarrowedValue().
Renamed TestUtilities.assertResultsAreValid() to TestUtilities.assertTestDidNotFail().
Renamed BaseTypeValidator.isValidType() to BaseTypeValidator.isValidStructurally().
New method BaseTypeVisitor#visitAnnotatedType(List, Tree) centralizes checking of user-written type annotations, even when parsed in declaration locations.
Closed issues:
#868, #1908, #2075, #3349, #3362, #3569, #3614, #3637, #3709, #3710, #3711, #3720, #3730, #3742, #3760, #3770, #3775, #3776, #3792, #3793, #3794, #3819, #3831.
Checker Framework 3.7.0
Version 3.7.0, October 1, 2020
The new Called Methods Checker tracks methods that have definitely been called on an object. It automatically supports detecting mis-uses of the builder pattern in code that uses Lombok or AutoValue.
Accumulation analysis is now supported via a generic Accumulation Checker. An accumulation analysis is a restricted form of typestate analysis that does not require a precise alias analysis for soundness. The Called Methods Checker is an accumulation analysis.
The Nullness Checker supports annotations org.codehaus.commons.nullanalysis.NotNull
, org.codehaus.commons.nullanalysis.Nullable
, and org.jspecify.annotations.Nullable
.
The Signature Checker supports annotations @CanonicalName
and @CanonicalNameOrEmpty
.
The Signature Checker treats jdk.jfr.Unsigned
as an alias for its own @Unsigned
annotation.
The shorthand syntax for the -processor command-line argument applies to
utility checkers, such as the Constant Value Checker.
Implementation details:
A checker implementation may override AnnotatedTypeFactory.getWidenedAnnotations
to provide special behavior for primitive widening conversions.
Deprecated org.checkerframework.framework.util.MultiGraphQualifierHierarchy
and org.checkerframework.framework.util.GraphQualifierHierarchy
. Removed AnnotatedTypeFactory#createQualifierHierarchy(MultiGraphFactory)
and AnnotatedTypeFactory#createQualifierHierarchyFactory
.
See Javadoc of MultiGraphQualifierHierarchy for instructions on how to use the new classes and methods.
Renamed methods:
NumberUtils.isFloatingPoint => TypesUtils.isFloatingPoint
NumberUtils.isIntegral => TypesUtils.isIntegralPrimitiveOrBoxed
NumberUtils.isPrimitiveFloatingPoint => TypeKindUtils.isFloatingPoint
NumberUtils.isPrimitiveIntegral => TypeKindUtils.isIntegral
NumberUtils.unboxPrimitive => TypeKindUtils.primitiveOrBoxedToTypeKind
TypeKindUtils.widenedNumericType => TypeKindUtils.widenedNumericType
TypesUtils.isFloating => TypesUtils.isFloatingPrimitive
TypesUtils.isIntegral => TypesUtils.isIntegralPrimitive
The CFStore copy constructor now takes only one argument.
Closed issues:
#352, #354, #553, #722, #762, #2208, #2239, #3033, #3105, #3266, #3275, #3408, #3561, #3616, #3619, #3622, #3625, #3630, #3632, #3648, #3650, #3667, #3668, #3669, #3700, #3701.
Checker Framework 3.6.0
Version 3.6.0, August 3, 2020
The Interning Checker supports method annotations @EqualsMethod and @CompareToMethod. Place them on methods like equals(), compareTo(), and compare() to permit certain uses of == on non-interned values.
Added an overloaded version of NullnessUtil.castNonNull that takes an error message.
Added a new option -Aversion
to print the version of the Checker Framework.
New CFGVisualizeLauncher command-line arguments:
--outputdir
: directory in which to write output files--string
: print the control flow graph in the terminal
All CFGVisualizeLauncher command-line arguments now start with--
instead of-
.
Implementation details:
commonAssignmentCheck() now takes an additional argument. Type system authors must update their overriding implementations.
Renamed GenericAnnotatedTypeFactory#addAnnotationsFromDefaultQualifierForUse to #addAnnotationsFromDefaultForType and BaseTypeValidator#shouldCheckTopLevelDeclaredType to #shouldCheckTopLevelDeclaredOrPrimitiveType
Removed org.checkerframework.framework.test.FrameworkPer(Directory/File)Test classes. Use CheckerFrameworkPer(Directory/File)Test instead.
Closed issues:
#1395, #2483, #3207, #3223, #3224, #3313, #3381, #3422, #3424, #3428, #3429, #3438, #3442, #3443, #3447, #3449, #3461, #3482, #3485, #3495, #3500, #3528.
Checker Framework 3.5.0
Version 3.5.0, July 1, 2020
Use "allcheckers:" instead of "all:" as a prefix in a warning suppression string. Writing @SuppressWarnings("allcheckers")
means the same thing as @SuppressWarnings("all")
, unless the -ArequirePrefixInWarningSuppressions
command-line argument is supplied. See the manual for details.
It is no longer necessary to pass -Astubs=checker.jar/javadoc.astub when compiling a program that uses Javadoc classes.
Renamed command-line arguments:
- -AshowSuppressWarningKeys to -AshowSuppressWarningsStrings
The Signature Checker no longer considers Java keywords to be identifiers.
Renamed Signature Checker annotations:
@BinaryNameInUnnamedPackage => @BinaryNameWithoutPackage
@FieldDescriptorForPrimitiveOrArrayInUnnamedPackage => @FieldDescriptorWithoutPackage
@IdentifierOrArray => @ArrayWithoutPackage
Added new Signature Checker annotations:
@BinaryNameOrPrimitiveType
@DotSeparatedIdentifiersOrPrimitiveType
#IdentifierOrPrimitiveType
The Nullness Checker now treats System.getProperty()
soundly. Use -Alint=permitClearProperty
to disable special treatment of System.getProperty()
and to permit undefining built-in system properties.
Class qualifier parameters: When a generic class represents a collection, a user can write a type qualifier on the type argument, as in List<@Tainted Character>
versus List<@Untainted Character>
. When a non-generic class represents a collection with a hard-coded type (as StringBuffer
hard-codes Character
), you can use the new class qualifier parameter feature to distinguish StringBuffer
s that contain different types of characters.
The Dataflow Framework supports backward analysis. See its manual.
Implementation details:
Changed the types of some fields and methods from array to List:
- QualifierDefaults.validLocationsForUncheckedCodeDefaults()
- QualifierDefaults.STANDARD_CLIMB_DEFAULTS_TOP
- QualifierDefaults.STANDARD_CLIMB_DEFAULTS_BOTTOM
- QualifierDefaults.STANDARD_UNCHECKED_DEFAULTS_TOP
- QualifierDefaults.STANDARD_UNCHECKED_DEFAULTS_BOTTOM
Dataflow Framework: Analysis is now an interface. Added AbstractAnalysis, ForwardAnalysis, ForwardTransferFunction, ForwardAnalysisImpl, BackwardAnalysis, BackwardTransferFunction, and BackwardAnalysisImpl.
To adapt existing code:
extends Analysis<V, S, T>
=>extends ForwardAnalysisImpl<V, S, T>
implements TransferFunction<V, S>
=>implements ForwardTransferFunction<V, S>
In AbstractQualifierPolymorphism, use AnnotationMirrors instead of sets of annotation mirrors.
Renamed meta-annotation SuppressWarningsKeys to SuppressWarningsPrefix.
Renamed SourceChecker#getSuppressWarningsKeys(...) to getSuppressWarningsPrefixes.
Renamed SubtypingChecker#getSuppressWarningsKeys to getSuppressWarningsPrefixes.
Added GenericAnnotatedTypeFactory#postAnalyze, changed signature of GenericAnnotatedTypeFactory#handleCFGViz, and removed CFAbstractAnalysis#visualizeCFG.
Removed methods and classes marked deprecated in release 3.3.0 or earlier.
Closed issues:
#1362, #1727, #2632, #3249, #3296, #3300, #3356, #3357, #3358, #3359, #3380.
Checker Framework 3.4.1
Version 3.4.1, June 1, 2020
-Ainfer
now takes an argument:
-Ainfer=jaifs
uses.jaif
files to store the results of whole-program inference.-Ainfer=stubs
uses.astub
files to store the results of whole-program inference.-Ainfer
is deprecated but is the same as-Ainfer=jaifs
, for backwards compatibility.
New command-line option:
-AmergeStubsWithSource
If both a stub file and a source file are available, use both.
Closed issues:
2893, 3021, 3128, 3160, 3232, 3277, 3285, 3289, 3295, 3302, 3305, 3307, 3310, 3316, 3318, 3329.
Checker Framework 3.4.0
Version 3.4.0, May 3, 2020
The annotated jdk8.jar
is no longer used. You should remove any occurrence of
-Xbootclasspath/p:.../jdk8.jar
from your build scripts. Annotations for JDK 8 are included in checker.jar.
The Returns Receiver Checker enables documenting and checking that a method returns its receiver (i.e., the this
parameter).
Closed issues:
3267, 3263, 3217, 3212, 3201, 3111, 3010, 2943, 2930.