Skip to content

Commit aae6acd

Browse files
committed
annotations to remove false positives
1 parent 32e26b5 commit aae6acd

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

checker/src/main/java/org/checkerframework/checker/initialization/InitializationStore.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import javax.lang.model.element.AnnotationMirror;
99
import javax.lang.model.element.Element;
1010
import javax.lang.model.element.VariableElement;
11+
import org.checkerframework.checker.mustcall.qual.MustCall;
1112
import org.checkerframework.dataflow.cfg.node.MethodInvocationNode;
1213
import org.checkerframework.dataflow.cfg.visualize.CFGVisualizer;
1314
import org.checkerframework.dataflow.expression.ClassName;
@@ -30,8 +31,10 @@
3031
*
3132
* @see InitializationTransfer
3233
*/
33-
public class InitializationStore<V extends CFAbstractValue<V>, S extends InitializationStore<V, S>>
34-
extends CFAbstractStore<V, S> {
34+
public class InitializationStore<
35+
V extends CFAbstractValue<@MustCall({}) V>,
36+
S extends InitializationStore<@MustCall({}) V, @MustCall({}) S>>
37+
extends CFAbstractStore<@MustCall({}) V, @MustCall({}) S> {
3538

3639
/** The set of fields that are initialized. */
3740
protected final Set<VariableElement> initializedFields;

checker/src/main/java/org/checkerframework/checker/initialization/InitializationTransfer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import javax.lang.model.type.TypeKind;
1414
import javax.lang.model.type.TypeMirror;
1515
import javax.lang.model.util.ElementFilter;
16+
import org.checkerframework.checker.mustcall.qual.MustCall;
1617
import org.checkerframework.dataflow.analysis.RegularTransferResult;
1718
import org.checkerframework.dataflow.analysis.TransferInput;
1819
import org.checkerframework.dataflow.analysis.TransferResult;
@@ -56,7 +57,7 @@
5657
public class InitializationTransfer<
5758
V extends CFAbstractValue<V>,
5859
T extends InitializationTransfer<V, T, S>,
59-
S extends InitializationStore<V, S>>
60+
S extends InitializationStore<@MustCall({}) V, @MustCall({}) S>>
6061
extends CFAbstractTransfer<V, S, T> {
6162

6263
protected final InitializationAnnotatedTypeFactory<?, ?, ?, ?> atypeFactory;

0 commit comments

Comments
 (0)