Skip to content

Checker Framework 3.39.0-eisop1

Compare
Choose a tag to compare
@wmdietl wmdietl released this 22 Oct 19:02
· 334 commits to master since this release

Version 3.39.0-eisop1 (October 22, 2023)

User-visible changes:

The Initialization Checker is now separated from the Nullness Checker.
To unsoundly use the Nullness Checker without initialization checking, use the new -AassumeInitialized
command-line argument.
Error messages will now be either from the Initialization Checker or the Nullness Checker, which
simplifies the types in error messages.
@SuppressWarnings("initialization") should be used to suppress initialization warnings.
In this release, nullness continues to suppress warnings from the Initialization Checker, while
nullnessnoinit may be used to suppress warnings from the Nullness Checker only. A future release
will make suppression behavior consistent with other checkers.

The Initialization Checker supports the new qualifier @PolyInitialized to express qualifier polymorphism.

Fixed a bug in the Nullness Checker where an instance receiver is incorrectly marked non-null after
a static method or field access. This could lead to new nullness errors. The static access should be
changed to be through a class name.

Checkers now enforce @TargetLocations meta-annotations: if a qualifier is declared with the
meta-annotation @TargetLocations({TypeUseLocation...}), the qualifier should only be applied to
these type use locations.
The new command-line argument -AignoreTargetLocations disables validating the target locations
of qualifiers. This option is not enabled by default. With this flag, the checker ignores all
@TargetLocations meta-annotations and allows all qualifiers to be applied to every type use.

Implementation details:

Corrected the arguments to an ObjectCreationNode when the node refers to an
anonymous constructor invocation with an explicit enclosing expression in Java 11+.
Now the first argument is not treated as an enclosing expression if it is not.

Deprecated ObjectCreationNode#getConstructor in favor of new ObjectCreationNode#getTypeToInstantiate().

Removed class StringConcatenateAssignmentNode and its last usages.
The class was deprecated in release 3.21.3-eisop1 (March 23, 2022) and no longer used in CFGs.

Changed the return types of

  • BaseTypeChecker#getImmediateSubcheckerClasses() and overrides to
    Set<Class<? extends BaseTypeChecker>>,
  • AnalysisResult#getFinalLocalValues() to Map<VariableElement, V>, and
  • GenericAnnotatedTypeFactory#getFinalLocalValues() to Map<VariableElement, Value>.

Closed issues:

#297, #376, #400, #519, #532, #533, typetools#1590, typetools#1919.

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 langauge 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:

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

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:

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

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:

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

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.
    (EISOP note: these renamings break javac convention and are inconsistently applied.
    Only the last two changes are retained.)

Dataflow Framework:

  • New ExpressionStatementNode marks an expression that is used as a statement.
  • Removed class StringConcatenateAssignmentNode, which is now desugared.
    (EISOP note: these were performed in 3.21.2-eisop1 and 3.21.3-eisop1, respectively.)

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:
typetools#5908, typetools#5936, typetools#5971, typetools#6019, typetools#6025, typetools#6028, typetools#6030, typetools#6039, typetools#6053, typetools#6060, typetools#6069.

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() except as super.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:

typetools#4170, typetools#5722, typetools#5777, typetools#5807, typetools#5821, typetools#5826, typetools#5829, typetools#5837, typetools#5930.