Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
137224c
fix 6990
kelloggm Mar 20, 2025
6b2a991
Merge branch 'master' of https://github.com/typetools/checker-framewo…
kelloggm Mar 24, 2025
32e26b5
ignore excess warning on crash test
kelloggm Mar 24, 2025
aae6acd
annotations to remove false positives
kelloggm Mar 24, 2025
46a6d25
Merge branch 'master' of https://github.com/typetools/checker-framewo…
kelloggm Mar 25, 2025
0a8b1b9
Add Javadoc
mernst Mar 25, 2025
3ea4497
Merge branch 'master' into 6990
mernst Mar 25, 2025
e721baf
Merge branch 'master' of https://github.com/typetools/checker-framewo…
kelloggm Mar 26, 2025
7455157
Merge branch '6990' of github.com:kelloggm/checker-framework into 6990
kelloggm Mar 26, 2025
c6e6d94
Update checker/src/main/java/org/checkerframework/checker/initializat…
kelloggm Jul 18, 2025
5149197
Merge branch 'master' into 6990
kelloggm Jul 18, 2025
f1c4d32
Merge branch 'master' into 6990
kelloggm Jul 24, 2025
1116a40
Merge branch 'master' of https://github.com/typetools/checker-framewo…
kelloggm Jul 24, 2025
757062a
Merge branch '6990' of github.com:kelloggm/checker-framework into 6990
kelloggm Jul 24, 2025
0b0d74f
add suppressions and annotations to AFU
kelloggm Jul 24, 2025
43deefc
Merge ../checker-framework-branch-master into 6990
mernst Mar 3, 2026
ed45a17
Merge ../checker-framework-branch-master into 6990
mernst Mar 3, 2026
eeaba89
Merge ../checker-framework-branch-master into 6990
mernst Mar 4, 2026
4558806
Merge branch 'master' into 6990
mernst Apr 22, 2026
8a5e10b
Merge ../checker-framework-branch-master into 6990
mernst May 29, 2026
182fcd6
Javadoc
mernst Jun 2, 2026
e4a8a11
Javadoc
mernst Jun 2, 2026
7a74fd9
Merge ../checker-framework-branch-master into 6990
mernst Jun 2, 2026
02c7d3a
Reinstate debugging flag
mernst Jun 2, 2026
3ad4cbb
Grammar tweak
mernst Jun 2, 2026
c093575
add must call annotations to InitializationVisitor
kelloggm Jun 2, 2026
ab0d44d
Merge branch '6990' of github.com:kelloggm/checker-framework into 6990
kelloggm Jun 2, 2026
5117277
finish annotating InitializationVisitor
kelloggm Jun 2, 2026
86ae6ae
Javadoc
mernst Jun 2, 2026
e0cb9d7
Merge branch '6990' of github.com:kelloggm/checker-framework into 6990
mernst Jun 2, 2026
7429f78
Add redundant `messages.properties` file
mernst Jun 2, 2026
9e19901
Merge ../checker-framework-branch-master into 6990
mernst Jun 5, 2026
cdd7e3e
Formatting
mernst Jun 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.VariableElement;
import org.checkerframework.checker.mustcall.qual.MustCall;
import org.checkerframework.dataflow.cfg.node.MethodInvocationNode;
import org.checkerframework.dataflow.cfg.visualize.CFGVisualizer;
import org.checkerframework.dataflow.expression.ClassName;
Expand All @@ -28,10 +29,14 @@
* A store that extends {@code CFAbstractStore} and additionally tracks which fields of the 'self'
* reference have been initialized.
*
* @param <V> the type of values in the abstract store
* @param <S> the type of teh abstract store
Comment thread
kelloggm marked this conversation as resolved.
Outdated
* @see InitializationTransfer
*/
public class InitializationStore<V extends CFAbstractValue<V>, S extends InitializationStore<V, S>>
extends CFAbstractStore<V, S> {
public class InitializationStore<
V extends CFAbstractValue<@MustCall({}) V>,
S extends InitializationStore<@MustCall({}) V, @MustCall({}) S>>
extends CFAbstractStore<@MustCall({}) V, @MustCall({}) S> {

/** The set of fields that are initialized. */
protected final Set<VariableElement> initializedFields;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.ElementFilter;
import org.checkerframework.checker.mustcall.qual.MustCall;
import org.checkerframework.dataflow.analysis.RegularTransferResult;
import org.checkerframework.dataflow.analysis.TransferInput;
import org.checkerframework.dataflow.analysis.TransferResult;
Expand Down Expand Up @@ -56,7 +57,7 @@
public class InitializationTransfer<
V extends CFAbstractValue<V>,
T extends InitializationTransfer<V, T, S>,
S extends InitializationStore<V, S>>
S extends InitializationStore<@MustCall({}) V, @MustCall({}) S>>
Comment thread
mernst marked this conversation as resolved.
extends CFAbstractTransfer<V, S, T> {

protected final InitializationAnnotatedTypeFactory<?, ?, ?, ?> atypeFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public boolean derivedFromMustCallAlias() {
}

/**
* Gets the must-call type associated with the given resource alias, falling on back on the
* Gets the must-call type associated with the given resource alias, falling back on the
* declared type if there is no refined type for the alias in the store.
*
* @param alias a resource alias
Expand All @@ -366,7 +366,9 @@ private static AnnotationMirror getMustCallValue(
CFValue value = mcStore == null ? null : mcStore.getValue(reference);
if (value != null) {
AnnotationMirror result =
AnnotationUtils.getAnnotationByClass(value.getAnnotations(), MustCall.class);
mcAtf
.getQualifierHierarchy()
.findAnnotationInHierarchy(value.getAnnotations(), mcAtf.TOP);
if (result != null) {
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Demonstrates an issue in the Checker Framework with handling the nearest enclosing element for
* temporary variable declarations, leading to a crash during analysis.
*/
@SuppressWarnings("all") // only check for crashes
public abstract class CrashForTempVar<T extends Number> {

private final CrashForTempVar<T> _base;
Expand Down
15 changes: 15 additions & 0 deletions checker/tests/resourceleak/DropOwning.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// test case for https://github.com/typetools/checker-framework/issues/6990

import java.io.Closeable;
import org.checkerframework.checker.mustcall.qual.MustCallUnknown;
import org.checkerframework.checker.mustcall.qual.Owning;

public class DropOwning {

public void f(@Owning Closeable resource) {
drop(resource);
}

// :: error: required.method.not.known
private void drop(@Owning @MustCallUnknown Object resourceCF6990) {}
}