Releases: typetools/checker-framework
Checker Framework 3.42.0
Version 3.42.0 (December 15, 2023)
User-visible changes:
Method annotation @AssertMethod
indicates that a method checks a value and possibly throws an assertion. Using it can make flow-sensitive type refinement more effective.
In org.checkerframework.common.util.debug
, renamed EmptyProcessor
to DoNothingProcessor
.
Removed org.checkerframework.common.util.report.DoNothingChecker
.
Moved ReportChecker
from org.checkerframework.common.util.report
to org.checkerframework.common.util.count.report
.
Checker Framework 3.41.0
Version 3.41.0 (December 4, 2023)
User-visible changes:
New command-line options:
-AassumePureGetters Unsoundly assume that every getter method is pure
Implementation details:
Added method isDeterministic()
to the AnnotationProvider
interface.
CFAbstractValue#leastUpperBound
and CFAbstractValue#widenUpperBound
are now final. Subclasses should override method CFAbstractValue#upperBound(V, TypeMirror, boolean)
instead.
Closed issues:
#1497, #3345, #6037, #6204, #6276, #6282, #6290, #6296, #6319, #6327.
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: