Changelog History
Page 1
-
v3.8.0 Changes
December 01, 2020๐ 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
andSubtypeIsSupersetQualifierHierarchy
.๐ 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()
, changedboolean
parameter to enumBeforeOrAfter
.โ Removed
org.checkerframework.framework.util.AnnotatedTypes#getIteratedType
; useAnnotatedTypeFactory#getIterableElementType(ExpressionTree)
instead.Closed issues:
#3287, #3390, #3681, #3839, #3850, #3851, #3862, #3871, #3884, #3888, #3908, #3929, #3932, #3935. -
v3.7.1 Changes
November 02, 2020๐ 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. -
v3.7.0 Changes
October 01, 2020๐ 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
, andorg.jspecify.annotations.Nullable
.๐ The Signature Checker supports annotations
@CanonicalName
and@CanonicalNameOrEmpty
.
The Signature Checker treatsjdk.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
andorg.checkerframework.framework.util.GraphQualifierHierarchy
. RemovedAnnotatedTypeFactory#createQualifierHierarchy(MultiGraphFactory)
andAnnotatedTypeFactory#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.isIntegralPrimitiveThe 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. -
v3.6.1
September 02, 2020 -
v3.6.0 Changes
August 03, 2020๐ 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.
0๏ธโฃ 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. -
v3.5.0 Changes
July 01, 2020๐ 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
@DotSeparatedIdentifiersOrPrimitiveTypeIdentifierOrPrimitiveType
๐ The Nullness Checker now treats
System.getProperty()
soundly. Use-Alint=permitClearProperty
to disable special treatment ofSystem.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>
versusList<@Untainted Character>
. When a non-generic class represents a collection with a hard-coded type (asStringBuffer
hard-codesCharacter
), you can use the new class qualifier parameter feature to distinguishStringBuffer
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:
- 0๏ธโฃ 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. -
v3.4.1 Changes
June 01, 2020๐ 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. -
v3.4.0 Changes
May 03, 2020๐ 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. -
v3.3.0 Changes
April 01, 2020๐ Version 3.3.0, April 1, 2020
๐ New command-line options:
๐ -Alint=trustArrayLenZero trust @arraylen(0) annotations when determining the type of Collections.toArray.Renamings:
0๏ธโฃ -AuseDefaultsForUncheckedCode to -AuseConservativeDefaultsForUncheckedCode
๐ The old name works temporarily but will be removed in a future release.๐ For collection methods with
Object
formal parameter type, such as contains, indexOf, and remove, the annotated JDK now forbids null as an argument. To make the Nullness Checker permit null, pass-Astubs=checker.jar/collection-object-parameters-may-be-null.astub
.โ The argument to
@SuppressWarnings
can be a substring of a message key that extends at each end to a period or an end of the key. (Previously, any substring worked, including the empty string which suppressed all warnings. Use "all" to suppress all warnings.)All postcondition annotations are repeatable (e.g.,
@EnsuresNonNull
,@EnsuresNonNullIf
, ...).๐ Renamed wrapper annotations (which users should not write):
- 0๏ธโฃ
@DefaultQualifiers
=>@DefaultQualifier.List
@EnsuresQualifiersIf
=>@EnsuresQualifierIf.List
@EnsuresQualifiers
=>@EnsuresQualifier.List
@RequiresQualifiers
=>@RequiresQualifier.List
Implementation details:
- โ Removed
@DefaultInUncheckedCodeFor
and@DefaultQualifierInHierarchyInUncheckedCode
. - Renamings:
0๏ธโฃ applyUncheckedCodeDefaults() to applyConservativeDefaults()
0๏ธโฃ useUncheckedCodeDefault() to useConservativeDefault()
AnnotatedTypeReplacer to AnnotatedTypeCopierWithReplacement
AnnotatedTypeMerger to AnnotatedTypeReplacer - ๐ Deprecated the
framework.source.Result
class; useDiagMessage
orList<DiagMessage>
instead. If you were creating aResult
just to pass it toreport
, then call new methodsreportError
andreportWarning
instead. - AbstractTypeProcessor#typeProcessingOver() always gets called.
Closed issues:
1307, 1881, 1929, 2432, 2793, 3040, 3046, 3050, 3056, 3083, 3124, 3126, 3129, 3132, 3139, 3149, 3150, 3167, 3189. - 0๏ธโฃ
-
v3.2.0 Changes
March 02, 2020๐ Version 3.2.0, March 2, 2020
โ
@SuppressWarnings("initialization")
suppresses only warnings whose key contains "initialization". Previously, it suppressed all warnings issued by the Nullness Checker or the Initialization Checker.Closed issues:
2719, 3001, 3020, 3069, 3093, 3120.