Skip to content

Releases: eisop/checker-framework

Checker Framework 3.42.0-eisop5

20 Dec 23:39
Compare
Choose a tag to compare

Version 3.42.0-eisop5 (December 20, 2024)

User-visible changes:

Removed support for the -Anocheckjdk option, which was deprecated in version 3.1.1.
Use -ApermitMissingJdk instead.

The Nullness Checker now reports an error if an array or object creation is annotated
with @Nullable, as array and object creations are intrinsically non-null.

Implementation details:

Changed org.checkerframework.framework.util.ContractsFromMethod to an interface.
Use DefaultContractsFromMethod to get the default behavior or use the new
NoContractsFromMethod if you want no support for contracts.

Make SourceChecker#suppressWarningsString protected to allow adaptation in subclasses.

Closed issues:

#413, #782, #815, #826, #860, #873, #875, #927,
#982, #1012.

Checker Framework 3.42.0-eisop4

13 Jul 02:39
Compare
Choose a tag to compare

Version 3.42.0-eisop4 (July 12, 2024)

Implementation details:

New method GenericAnnotatedTypeFactory#addComputedTypeAnnotationsWithoutFlow(Tree, AnnotatedTypeMirror)
that sets useFlow to false before calling addComputedTypeAnnotations. Subclasses should override
method GenericAnnotatedTypeFactory#addComputedTypeAnnotations(Tree, AnnotatedTypeMirror) instead.
Deprecated the GenericAnnotatedTypeFactory#addComputedTypeAnnotations(Tree, AnnotatedTypeMirror, boolean)
overload.

Changed the return type of AnnotatedTypeFactory#getEnumConstructorQualifiers from Set<AnnotationMirror>
to AnnotationMirrorSet.

Field AnnotatedTypeFactory#root is now private and can only be accessed through getRoot/setRoot.

framework-test:

  • Improvements to more consistently handle tests that do not use -Anomsgtext.
  • Added new class DetailedTestDiagnostic to directly represent test diagnostics when
    -Adetailedmsgtext is used.

Closed issues:

#742, #777, #795, typetools#6704.

Checker Framework 3.42.0-eisop3

02 Mar 00:03
Compare
Choose a tag to compare

Version 3.42.0-eisop3 (March 1, 2024)

User-visible changes:

Performance improvements in the Nullness Checker.

Implementation details:

Support separate defaults for wildcard and type variable upper bounds.
Add support for defaults for type variable uses.
See changes in TypeUseLocation, QualiferDefaults, and QualifierHierarchy,
as well as the new ParametricTypeVariableUseQualifier meta-annotation.

Refactored the TypeInformationPresenter into several classes in the new
org.checkerframework.framework.util.visualize package.

Closed issues:

#703, typetools#6433, typetools#6438.

Checker Framework 3.42.0-eisop2

09 Jan 16:35
Compare
Choose a tag to compare

Version 3.42.0-eisop2 (January 9, 2024)

Implementation details:

Moved ErrorTypeKindException from org.checkerframework.framework.util.element.ElementAnnotationUtil to
org.checkerframework.framework.type.AnnotatedTypeMirror. Properly raise these errors in more cases.

Deprecated AnnotationUtils#isDeclarationAnnotation and added the clearer AnnotationUtils#isTypeUseAnnotation.

Removed the dependency on the classgraph library, which added over 500kB to checker.jar.
It is easy to add the dependency for debugging.

Closed issues:

#666, #673.

Checker Framework 3.42.0-eisop1

02 Jan 15:13
Compare
Choose a tag to compare

Version 3.42.0-eisop1 (January 2, 2024)

Closed issues:

typetools#6373, typetools#6374.

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.
(EISOP note: we did not follow this renaming - if anything, counting could be a special case of reporting, not
the other way around.)

Checker Framework 3.41.0-eisop1

05 Dec 19:06
Compare
Choose a tag to compare

Version 3.41.0-eisop1 (December 5, 2023)

User-visible changes:

The Nullness Checker now warns about redundant null cases in switch statements and expressions when
using the -Alint=redundantNullComparison command-line argument.

Closed issues:

#628, #635, #640, #641.

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.

(EISOP note: typetools added the new method annotation org.checkerframework.dataflow.qual.AssertMethod
to treat such methods like assert statements. EISOP might change the implementation of this feature
in a future release.)

Closed issues:

typetools#1497, typetools#3345, typetools#6037, typetools#6204, typetools#6276, typetools#6282, typetools#6290, typetools#6296, typetools#6319, typetools#6327.

Checker Framework 3.40.0-eisop2

25 Nov 04:24
Compare
Choose a tag to compare

Version 3.40.0-eisop2 (November 24, 2023)

Implementation details:

Always use reflective access for TreeMaker#Select, to allow artifacts built with
Java 21+ to be executed on Java <21.

Checker Framework 3.40.0-eisop1

24 Nov 19:08
Compare
Choose a tag to compare

Version 3.40.0-eisop1 (November 24, 2023)

User-visible changes:

Improvements to initialization type frames in the Initialization Checker.

Implementation details:

New method TreeUtils#isEnhancedSwitchStatement to determine if a switch statement tree
is an enhanced switch statement.

Closed issues:

#609, #610, #612.

Version 3.40.0 (November 1, 2023)

User-visible changes:

Optional Checker: checker-util.jar defines OptionalUtil.castPresent() for
suppressing false positive warnings from the Optional Checker.

Closed issues:

typetools#4947, typetools#6179, typetools#6215, typetools#6218, typetools#6222, typetools#6247, typetools#6259, typetools#6260.

Checker Framework 3.39.0-eisop1

22 Oct 19:02
Compare
Choose a tag to compare

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.

Checker Framework 3.34.0-eisop1

09 May 23:06
Compare
Choose a tag to compare

Version 3.34.0-eisop1 (May 9, 2023)

User-visible changes:

There is now a dedicated website for the EISOP Framework at https://eisop.github.io/ .

The new command-line arguments -AaliasedTypeAnnos={aliases} and -AaliasedDeclAnnos={aliases}
define custom type and declaration annotation aliases for the canonical annotations of a checker.
aliases is in the format
FQN.canonical.Qualifier1:FQN.alias1.Qual1,FQN.alias2.Qual1;FQN.canonical.Qualifier2:FQN.alias1.Qual2.

Implementation details:

The EISOP Framework continues to build and run on JDK 8.

Improvements to -AwarnRedundantAnnotations with type variables and the Interning Checker.

Refactored handling of test options and fixed the interaction between the detailedmsgtext and
nomsgtext options.

New CFGVisualizeOptions class for handling command-line arguments, making the
dataflow demo Playground applications much easier to use.

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, typetools#5739, typetools#5749, typetools#5767, typetools#5781, typetools#5787.

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.
(EISOP note: this was implemented in Version 3.27.0-eisop1.)

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.
(EISOP note: the EISOP Framework continues to build and run on JDK 8.)

Closed issues:

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