Skip to content

Releases: typetools/checker-framework

Checker Framework 3.39.0

02 Oct 17:38
Compare
Choose a tag to compare

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 of NodeVisitor must be updated.
  • Method InstanceOfNode.getBindingVariable() is deprecated; use getPatternNode() or getBindingVariables() instead.

WPI uses 1-based indexing for formal parameters and arguments.

Closed issues:

#5911, #5967, #6155, #6173, #6201.

Checker Framework 3.38.0

01 Sep 14:06
Compare
Choose a tag to compare

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:

#2156, #5672, #6110, #6111, #6116, #6125, #6129, #6136.

Checker Framework 3.37.0

01 Aug 17:58
Compare
Choose a tag to compare

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 to isSubypeQualifiers() and made protected. Clients that are not in a qualifier hierarchy should call isSubtypeShallow() or, rarely, new method isSubtypeQualifiersOnly().
    • New public method isSubtypeShallow()' that takes two more arguments than isSubypeQualifiers()`.
  • Similar changes to greatestLowerBound() and leastUpperBound().

Closed issues:

#6076, #6077, #6078, #6098, #6100, #6104, #6113.

Checker Framework 3.36.0

03 Jul 21:56
Compare
Choose a tag to compare

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() to getTypeFactoryOfSubcheckerOrNull.
  • Added new getTypeFactoryOfSubchecker() that never returns null.

Return types changed:

  • GenericAnnotatedTypeFactory.getFinalLocalValues() return type changed to Map, though the returned value is still a HashMap.
  • BaseTypeChecker.getImmediateSubcheckerClasses() return type changed to Set, though the returned value is still a LinkedHashSet.

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

01 Jun 18:22
Compare
Choose a tag to compare

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 to isStrongerThan() and no longer takes an AnnotatedTypeFactory

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

02 May 15:55
Compare
Choose a tag to compare

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

Closed issues:
#803, #5739, #5749, #5767, #5781, #5787.

Checker Framework 3.33.0

03 Apr 17:02
Compare
Choose a tag to compare

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:

#3785, #5436, #5708, #5717, #5720, #5721, #5727, #5732.

Checker Framework 3.32.0

02 Mar 22:27
Compare
Choose a tag to compare

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

17 Feb 21:17
Compare
Choose a tag to compare

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.

Checker Framework 3.30.0

02 Feb 21:20
Compare
Choose a tag to compare

Version 3.30.0 (February 2, 2023)

Implementation details:

getQualifierKind() throws an exception rather than returning null.

Renamed gradle task copyJarsToDist to assembleForJavac.

Closed issues:
#5402, #5486, #5489, #5519, #5524, #5526.