Skip to content

Releases: eisop/checker-framework

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.

Checker Framework 3.32.0-eisop1

09 Mar 17:38
Compare
Choose a tag to compare

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.