Skip to content

Commit

Permalink
Rename -AnoAccumulationFrames to -AnoCreatesObligation (#4686)
Browse files Browse the repository at this point in the history
  • Loading branch information
kelloggm authored May 24, 2021
1 parent 50f3f8d commit 0085ce5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
* Methods Checker, so the client has to "start over" as if a fresh {@code SocketContainer} object
* had been created.
*
* <p>When the -AnoAccumulationFrames command-line argument is passed to the checker, this
* <p>When the {@code -AnoCreatesObligation} command-line argument is passed to the checker, this
* annotation is ignored and all fields are treated as non-owning.
*
* @checker_framework.manual #must-call-checker Must Call Checker
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// DO NOT INCLUDE ANNOTATIONS THAT RELY ON ACCUMULATION FRAMES IN THIS FILE.
// This file is loaded regardless of the -AnoAccumulationFrames option. All
// assumptions that rely on the presence of accumulation frames (such as @MustCall({})
// on unconnected sockets) MUST go in SocketAccumulationFrames.astub. CreatesObligation
// okay, because the OCC turns that off anyway.
// DO NOT INCLUDE ANNOTATIONS THAT RELY ON OBLIGATION CREATION IN THIS FILE.
// This file is loaded regardless of the -AnoCreatesObligation option. All
// assumptions that rely on the presence of obligation creation (such as @MustCall({})
// on unconnected sockets) MUST go in SocketCreatesObligation.astub.

import org.checkerframework.checker.mustcall.qual.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
@StubFiles({
"JavaEE.astub",
"Reflection.astub",
"SocketAccumulationFrames.astub",
"SocketCreatesObligation.astub",
})
@SupportedOptions({
MustCallChecker.NO_ACCUMULATION_FRAMES,
MustCallChecker.NO_CREATES_OBLIGATION,
MustCallChecker.NO_LIGHTWEIGHT_OWNERSHIP,
MustCallChecker.NO_RESOURCE_ALIASES
})
public class MustCallChecker extends BaseTypeChecker {

/** Disables @CreatesObligation support. */
public static final String NO_ACCUMULATION_FRAMES = "noAccumulationFrames";
public static final String NO_CREATES_OBLIGATION = "noCreatesObligation";

/** Disables @Owning/@NotOwning support. */
public static final String NO_LIGHTWEIGHT_OWNERSHIP = "noLightweightOwnership";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

/**
* This copy of the Must Call Checker is identical, except that it does not load the stub files that
* treat unconnected sockets as {@code @MustCall({})}. See SocketAccumulationFrames.astub.
* treat unconnected sockets as {@code @MustCall({})}. See SocketCreatesObligation.astub.
*
* <p>The only difference is the contents of the @StubFiles annotation.
*/
@StubFiles({
"JavaEE.astub",
"Reflection.astub",
})
@SupportedOptions({MustCallChecker.NO_ACCUMULATION_FRAMES})
public class MustCallNoAccumulationFramesChecker extends MustCallChecker {}
@SupportedOptions({MustCallChecker.NO_CREATES_OBLIGATION})
public class MustCallNoCreatesObligationChecker extends MustCallChecker {}
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public TransferResult<CFValue, CFStore> visitMethodInvocation(
TransferResult<CFValue, CFStore> result = super.visitMethodInvocation(n, in);

updateStoreWithTempVar(result, n);
if (!atypeFactory.getChecker().hasOption(MustCallChecker.NO_ACCUMULATION_FRAMES)) {
if (!atypeFactory.getChecker().hasOption(MustCallChecker.NO_CREATES_OBLIGATION)) {
List<JavaExpression> targetExprs =
CreatesObligationElementSupplier.getCreatesObligationExpressions(
n, atypeFactory, atypeFactory);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This version of the standard assumptions for sockets is intended for use with accumulation frame support (i.e.
// without the -AnoAccumulationFrames argument to the checker). It includes @MustCall({}) annotations for no-argument
// socket constructors, which would be unsound if accumulation frame support was disabled. The checker chooses
// whether to use it automatically, when invoked via the Object Construction Checker.
// This version of the standard assumptions for sockets is intended for use with obligation creation support (i.e.
// without the -AnoCreatesObligation argument to the checker). It includes @MustCall({}) annotations for no-argument
// socket constructors, which would be unsound if obligation creation support was disabled. The checker chooses
// whether to use it automatically, when invoked via the Resource Leak Checker.

package java.net;

Expand Down

0 comments on commit 0085ce5

Please sign in to comment.