Releases: typetools/checker-framework
Checker Framework 3.40.0
Checker Framework 3.39.0
Version 3.39.0 (October 2, 2023)
User-visible changes:
The Checker Framework runs on a version 21 JVM. It does not yet soundly check all new Java 21 language features, but it does not
crash when compiling them.
Implementation details:
Dataflow supports all the new Java 21 language features.
- A new node,
DeconstructorPatternNode
, was added, so any implementation ofNodeVisitor
must be updated. - Method
InstanceOfNode.getBindingVariable()
is deprecated; usegetPatternNode()
orgetBindingVariables()
instead.
WPI uses 1-based indexing for formal parameters and arguments.
Closed issues:
Checker Framework 3.38.0
Version 3.38.0 (September 1, 2023)
User-visible changes:
Eliminated the @SignedPositiveFromUnsigned
annotation, which users were advised against using.
Implementation details:
Renamed SourceChecker.processArg()' to
processErrorMessageArg()`.
Closed issues:
Checker Framework 3.37.0
Version 3.37.0 (August 1, 2023)
User-visible changes:
Removed support for deprecated option -AuseDefaultsForUncheckedCode
.
The Signedness Checker no longer allows (nor needs) @UnknownSignedness
to be written on a non-integral type.
Implementation details:
QualifierHierarchy
:
- The constructor takes an
AnnotatedTypeFactory
. - Changes to
isSubtype()
:isSubtype()
has been renamed toisSubypeQualifiers()
and made protected. Clients that are not in a qualifier hierarchy should callisSubtypeShallow()
or, rarely, new methodisSubtypeQualifiersOnly()
.- New public method
isSubtypeShallow()' that takes two more arguments than
isSubypeQualifiers()`.
- Similar changes to
greatestLowerBound()
andleastUpperBound()
.
Closed issues:
Checker Framework 3.36.0
Version 3.36.0 (July 3, 2023)
User-visible changes:
The Initialization Checker issues a cast.unsafe
warning instead of an initialization.cast
error.
The Resource Leak Checker now issues a required.method.not.known
error when an expression with type @MustCallUnknown
has a must-call obligation (e.g., because it is a parameter annotated as @Owning
).
The Resource Leak Checker's default MustCall type for type variables has been changed from @MustCallUnknown
to @MustCall({})
. This change reduces the number of false positive warnings in code that uses type variables but not resources. However, it makes some code that uses type variables and resources unverifiable with any annotation.
Implementation details:
Deprecated ElementUtils.getSimpleNameOrDescription()
in favor of getSimpleDescription()
.
Renamed methods in AnnotatedTypeMirror
.
The old versions are deprecated. Because the *PrimaryAnnotation*
methods might not return an annotation of a type variable or wildcard, it is better to call getEffectiveAnnotation*
or hasEffectiveAnnotation*
instead.
clearAnnotations*()
=>clearPrimaryAnnotations()
getAnnotation*()
=>getPrimaryAnnotation*()
.hasAnnotation*()
=>hasPrimaryAnnotation()
.removeAnnotation*()
=>removePrimaryAnnotation*()
.isAnnotatedInHierarchy()
=>hasPrimaryAnnotationInHierarchy()
removeNonTopAnnotationInHierarchy()
should not be used.
Dataflow Framework:
- New
ExpressionStatementNode
marks an expression that is used as a statement. - Removed class
StringConcatenateAssignmentNode
, which is now desugared.
GenericAnnotatedTypeFactory
:
- Renamed
getTypeFactoryOfSubchecker()
togetTypeFactoryOfSubcheckerOrNull
. - Added new
getTypeFactoryOfSubchecker()
that never returns null.
Return types changed:
GenericAnnotatedTypeFactory.getFinalLocalValues()
return type changed toMap
, though the returned value is still aHashMap
.BaseTypeChecker.getImmediateSubcheckerClasses()
return type changed toSet
, though the returned value is still aLinkedHashSet
.
Renamed methods in CFAbstractValue
:
combineOneAnnotation()
=>combineAnnotationWithTypeVar()
combineNoAnnotations()
=>combineTwoTypeVars()
Closed issues:
#5908, #5936, #5971, #6019, #6025, #6028, #6030, #6039, #6053, #6060, #6069.
Checker Framework 3.35.0
Version 3.35.0 (June 1, 2023)
User-visible changes:
The Checker Framework no longer issues type.checking.not.run
errors. This reduces clutter in the output.
Signedness Checker:
- The receiver type of
Object.hashCode()
is now@UnknownSignedness
.
Implementation details:
Instead of overriding isRelevant()
, a type factory implementation should override isRelevantImpl()
. Clients should continue to call isRelevant()
; never call isRelevantImpl()
.
Methods that now return a boolean
rather than void
:
commonAssignmentCheck()
checkArrayInitialization()
checkLock()
checkLockOfThisOrTree()
ensureExpressionIsEffectivelyFinal()
Methods that now return AnnotationMirrorSet
instead of Set<? extends AnnotationMirror>
:
getTopAnnotations()
getBottomAnnotations()
getDefaultTypeDeclarationBounds()
getExceptionParameterLowerBoundAnnotations()
Renamed BaseTypeVisitor.checkExtendsImplements()
to checkExtendsAndImplements()
.
Class FieldInvariants
:
- constructor now takes an
AnnotatedTypeFactory
isSuperInvariant()
has been renamed toisStrongerThan()
and no longer takes anAnnotatedTypeFactory
CFAbstractValue.validateSet()
takes a type factory rather than a QualifierHierarchy
.
Removed methods that have been deprecated for over two years.
Closed issues:
#4170, #5722, #5777, #5807, #5821, #5826, #5829, #5837, #5930.
Checker Framework 3.34.0
Version 3.34.0 (May 2, 2023)
User-visible changes:
The Checker Framework runs under JDK 20 -- that is, it runs on a version 20 JVM.
Explicit lambda parameters are defaulted the same as method parameters. For example, in (String s) -> {...}
the type of s
is @NonNull String
.
Implementation details:
Renamings in AnnotatedTypeFactory
:
prepareCompilationUnitForWriting()
=>wpiPrepareCompilationUnitForWriting()
prepareClassForWriting()
=>wpiPrepareClassForWriting()
prepareMethodForWriting()
=>wpiPrepareMethodForWriting()
and changed its signature by adding two formal parameters
Checker Framework 3.33.0
Version 3.33.0 (April 3, 2023)
User-visible changes:
The new command-line argument -AwarnRedundantAnnotations
warns about redundant annotations. With this flag, a warning is issued if an explicitly written annotation on a type is the same as the default annotation. This feature does not warn about all redundant annotations, only some.
The Value Checker is cognizant of signedness annotations. This eliminates some false positive warnings.
Implementation details:
The Checker Framework no longer builds under JDK 8. However, you can still run the Checker Framework under JDK 8.
Closed issues:
Checker Framework 3.32.0
Version 3.32.0 (March 2, 2023)
User-visible changes:
Fixed a bug in the Nullness Checker where a call to a side-effecting method did not make some formal parameters possibly-null. The Nullness Checker is likely to issue more warnings for your code. For ways to eliminate the new warnings, see https://checkerframework.org/manual/#type-refinement-side-effects .
If you supply the -AinvocationPreservesArgumentNullness
command-line option, the Nullness Checker unsoundly assumes that arguments passed to non-null parameters in an invocation remain non-null after the invocation. This assumption is unsound in general, but it holds for most code.
Implementation details:
Moved TreeUtils.isAutoGeneratedRecordMember(Element)
to ElementUtils
.
Renamed TreeUtils.instanceOfGetPattern()
to TreeUtils.instanceOfTreeGetPattern()
.
Deprecated AnnotatedTypes#isExplicitlySuperBounded
and AnnotatedTypes#isExplicitlyExtendsBounded
because they are duplicates of #hasExplicitSuperBound
and #hasExplicitExtendsBound
.
Checker Framework 3.31.0
Version 3.31.0 (February 17, 2023)
User-visible changes:
Command-line argument -AshowPrefixInWarningMessages
puts the checker name on the first line of each warning and error message.
Signedness Checker changes:
- Cast expressions are not subject to type refinement. When a programmer writes a cast such as
(@Signed int) 2
, it is not refined to@SignednessGlb
and cannot be used in an unsigned context. - When incompatible arguments are passed to
@PolySigned
formal parameters, the error is expressed in terms of@SignednessBottom
rather than the greatest lower bound of the argument types.
Implementation details:
Moved AnnotationMirrorSet
and AnnotationMirrorMap
from org.checkerframework.framework.util
to org.checkerframework.javacutil
.
Changed uses of Set<AnnotationMirror>
to AnnotationMirrorSet
including in APIs.
Removed methods from AnnotationUtils that are no longer useful:
createAnnotationMap
, createAnnotationSet
, createUnmodifiableAnnotationSet
.
Closed issues:
#5597.