Releases: eisop/checker-framework
Checker Framework 3.32.0-eisop1
Version 3.32.0-eisop1 (March 9, 2023)
User-visible changes:
The new command-line argument -AcheckEnclosingExpr
enables type checking for
enclosing expression types of inner class instantiations. This fixes an
unsoundness, in particular for the Nullness Initialization Checker, which did
not detect the use of an uninitialized outer class for an inner class
instantiation.
The option is off by default to avoid many false-positive errors.
Implementation details:
Added method AnnotatedExecutableType.getVarargType
to access the vararg type
of a method/constructor.
This allows us to remove usages of AnnotatedTypes.adaptParameters()
.
A VariableDeclarationNode
is now correctly added to the CFG for the binding
variable in a BindingPatternTree
.
Remove the fastAssemble
task which is subsumed by assembleForJavac
.
Successfully compiles with Java 20 and 21.
Closed issues:
#282, #310, #312, typetools#5672.
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.
(EISOP note: contrary to this description, one needs to use
-AinvocationPreservesArgumentNullness=false
to get the unsound behavior.
EISOP keeps only the -AconservativeArgumentNullnessAfterInvocation
option,
introduced in version 3.25.0-eisop1, which this typetools option is based on.)
Implementation details:
Moved TreeUtils.isAutoGeneratedRecordMember(Element)
to ElementUtils
.
(EISOP note: originally introduced the method in the correct location in Version 3.27.0-eisop1.)
Renamed TreeUtils.instanceOfGetPattern()
to TreeUtils.instanceOfTreeGetPattern()
.
(EISOP note: EISOP performed this renaming in Version 3.21.2-eisop1.)
Deprecated AnnotatedTypes#isExplicitlySuperBounded
and AnnotatedTypes#isExplicitlyExtendsBounded
because they are duplicates of #hasExplicitSuperBound
and #hasExplicitExtendsBound
.
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:
typetools#5597.
Version 3.30.0 (February 2, 2023)
Implementation details:
getQualifierKind()
throws an exception rather than returning null.
(EISOP note: this method is in ElementQualifierHierarchy
and QualifierKindHierarchy
.)
Renamed Gradle task copyJarsToDist
to assembleForJavac
.
Closed issues:
typetools#5402, typetools#5486, typetools#5489, typetools#5519, typetools#5524, typetools#5526.
Version 3.29.0 (January 5, 2023)
User-visible changes:
Dropped support for -ApermitUnsupportedJdkVersion
command-line argument.
You can now run the Checker Framework under any JDK version, without a warning.
(EISOP note: a note is however still issued. Use the EISOP option
-AnoJreVersionCheck
to also suppress the note.)
Pass -Astubs=permit-nullness-assertion-exception.astub
to not be warned about null
pointer exceptions within nullness assertion methods like Objects.requireNonNull
.
Pass -Astubs=sometimes-nullable.astub
to unsoundly permit passing null to
calls if null is sometimes but not always permitted.
Closed issues:
typetools#5412, typetools#5431, typetools#5435, typetools#5438, typetools#5447, typetools#5450, typetools#5453, typetools#5471, typetools#5472, typetools#5487.
Checker Framework 3.28.0-eisop1
Version 3.28.0-eisop1 (December 7, 2022)
User-visible changes:
Support JSpecify annotations in the org.jspecify.annotations
package.
Implementation details:
Remove duplicate code in AnnotatedTypeFactory
and javacutil
.
Version 3.28.0 (December 1, 2022)
User-visible changes:
The Checker Framework runs under JDK 19 -- that is, it runs on a version 19 JVM.
Implementation details:
Renamed TryFinallyScopeCell
to LabelCell
.
Renamed TreeUtils.isEnumSuper
to isEnumSuperCall
.
Closed issues:
Checker Framework 3.27.0-eisop1
Version 3.27.0-eisop1 (November 6, 2022)
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 for this type and location.
Support additional Nullness Checker annotation aliases from:
io.micronaut.core.annotation
io.vertx.codegen.annotations
jakarta.annotation
net.bytebuddy[.agent].utility.nullability
Implementation details:
When reporting issues on an artificial tree (generated by the compiler), always
try to find the closest non-artificial parent in the AST path to provide position
information.
Formatting rules for *.ajava
files are now consistent with the ones for *.java
files.
Imports are now ignored when parsing ajava
files.
Moved method isAutoGeneratedRecordMember(Element e)
, which was added in 3.27.0,
from TreeUtils
to the more appropriate ElementUtils
.
Refined the return types of several TreeUtils
elementFromDeclaration
methods
to be @NonNull
.
Closed issues:
Version 3.27.0 (November 1, 2022)
User-visible changes:
The Constant Value Checker supports new annotation @DoesNotMatchRegex
.
Closed issues:
typetools#5238, typetools#5360, typetools#5362, typetools#5387.
Checker Framework 3.26.0-eisop1
Version 3.26.0-eisop1 (October 13, 2022)
Implementation details:
Documentation improvements and various code fixes.
Closed issues:
Version 3.26.0 (October 3, 2022)
User-visible changes:
The Checker Framework runs under JDK 18 -- that is, it runs on a version 18 JVM.
(It worked before, but gave a warning that it was not tested.)
Annotations are available for some new JDK 17 APIs (some of those
introduced since JDK 11).
Added -AnoWarnMemoryConstraints
to change the "Memory constraints are impeding
performance; please increase max heap size" message from a warning to a note.
'unneeded.suppression' warnings can now themeselves be suppressed.
Implementation details:
Deprecated TreeUtils.constructor()
in favor of TreeUtils.elementFromUse()
.
Added method isSideEffectFree()
to the AnnotationProvider
interface.
Deprecated CFAbstractStore.isSideEffectFree()
in favor of new method
AnnotationProvider.isSideEffectFree()
. Note the different contracts of
PurityUtils.isSideEffectFree()
and AnnotationProvider.isSideEffectFree()
.
Use TreeUtils.elementFromDeclaration
and TreeUtils.elementFromUse
in
preference to TreeUtils.elementFromTree
, when possible.
For code formatting, use ./gradlew spotlessCheck
and ./gradlew spotlessApply
.
The checkFormat
and reformat
Gradle tasks have been removed.
Removed variable BaseTypeVisitor.inferPurity
.
Closed issues:
typetools#5081, typetools#5159, typetools#5245, typetools#5302, typetools#5319, typetools#5323.
Checker Framework 3.25.0-eisop1
Version 3.25.0-eisop1 (September 3, 2022)
User-visible changes:
The new command-line argument -AconservativeArgumentNullnessAfterInvocation
improves
the soundness of the Nullness Checker. In previous versions and without supplying the
new flag, the receiver and arguments that are passed to non-null parameters in a method call
or constructor invocation are assumed to be non-null after the invocation.
This assumption is unsound in general, but holds for most code.
Use the new flag to soundly handle the nullness of the receiver and arguments in an invocation.
In a future version, we might change the default for this option.
Support the JSpecify NonNull annotation as an alias in the Nullness Checker.
Fixed ordering of command-line and JDK stubs.
Closed issues:
Version 3.25.0 (September 1, 2022)
User-visible changes:
Make mustcall.not.inheritable
a warning rather than an error.
The Property File Checker, Internationalization Checker, and Compiler
Message Checker use File.pathSeparator
to separate property file paths in
-Apropfiles
, rather than ':'.
Added DoNothingChecker
that does nothing.
Closed issues:
typetools#5216, typetools#5240, typetools#5256, typetools#5273.
Checker Framework 3.24.0-eisop1
Version 3.24.0-eisop1 (August 5, 2022)
User-visible changes:
Postconditions on the parameters of a constructor are now used at new object creations.
Version 3.24.0 (August 3, 2022)
User-visible changes:
Performance improvements.
Minor bug fixes and enhancements.
Implementation details:
Prefer SystemUtil.jreVersion
to SystemUtil.getJreVersion()
.
Closed issues:
Checker Framework 3.23.0-eisop2
Version 3.23.0-eisop2 (July 22, 2022)
Implementation details:
Improved defaulting in stub files:
As an extension to the fix for #270, we now allow internally parsing
multiple stub files at the same time. This should make AnnotatedTypeFactory.getDeclAnnotations
return the expected declaration annotations for all kinds of elements,
even if it is parsing a different stub file.
Closed issues:
#308.
Checker Framework 3.23.0-eisop1
Version 3.23.0-eisop1 (July 14, 2022)
Implementation details:
Added support for viewpoint adaptation of types via the added
ViewpointAdapter interface. This support is experimental and the API
will change, in particular if the feature is fully integrated with
the DependentTypesHelper.
Improved defaulting in stub files:
Method AnnotatedTypeFactory.getDeclAnnotations
now returns the
annotations for a package element. Previously, it returned an empty set
when parsing another file. (#270)
Method CFAbstractTransfer.visitMethodInvocation
now only creates a
ConditionalTransferResult
when the method return type is boolean or
Boolean. This avoids unnecessary duplication of many stores, reducing
memory consumption.
Improved the CFG type of implicit this receivers. (typetools#5174)
Closed issues:
Checker Framework 3.22.1-eisop1
Version 3.22.1-eisop1 (June 3, 2022)
User-visible changes:
Type parameters with explicit j.l.Object upper bounds and
unannotated, unbounded wildcards now behave the same in .astub
files and in .java files.
Implementation details:
In PropagationTreeAnnotator.visitBinary
, we now consider the two cases where
the resulting Java type of a binary operation can be different from the operands'
types: string concatenation and binary comparison. We apply the declaration
bounds of the resulting Java type to ensure annotations in the ATM are valid.
Deprecated AnnotatedTypeFactory.binaryTreeArgTypes(AnnotatedTypeMirror, AnnotatedTypeMirror)
in favor of
AnnotatedTypeFactory.binaryTreeArgTypes(BinaryTree)
and
AnnotatedTypeFactory.compoundAssignmentTreeArgTypes(CompoundAssignmentTree)
.
Closed issues:
typetools#3025, typetools#3030, typetools#3236.
Test cases for issues that already pass:
typetools#2722, typetools#2995, typetools#3015, typetools#3027.
typetools#58 was closed in error. See
#242
for follow-up discussions.
Checker Framework 3.22.0-eisop1
Version 3.22.0-eisop1 (May 6, 2022)
User-visible changes:
Added reaching definitions and very busy expressions analysis demos.
Implementation details:
Fixed the types of MethodInvocationNode#arguments
and
ObjectCreationNode#arguments
in CFGs. Previously, argument nodes are created
using the types from the method declaration, which means some nodes are using
type variables that are not substituted by type arguments at the call site.
For example, we used to observe new T[]{"a", "b"}
instead of
new String[]{"a", "b"}
, while the second one makes more sense.
Added a new gradle task fastAssemble
to quickly rebuild the Checker
Framework for local development. This command will assemble the jar
files without generating any Javadoc or sources.jar files, thus it is
faster than the gradle assemble task.
Type system test drivers no longer need to pass -Anomsgtext
.
The Checker Framework test driver (in TypecheckExecutor.compile
) now always
passes the -Anomsgtext
option.
Moved the -AajavaChecks
option from CheckerFrameworkPerDirectoryTest
to
TypecheckExecutor.compile
to ensure the option is used for all tests.
Closed issues:
#210.