Skip to content

Commit

Permalink
Tweak comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst committed Oct 29, 2020
1 parent 363f182 commit 2d93c75
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@
* LockTransfer handles constructors, initializers, synchronized methods, and synchronized blocks.
*/
public class LockTransfer extends CFAbstractTransfer<CFValue, LockStore, LockTransfer> {
/** The type factory associated with this transfer function. */
private final LockAnnotatedTypeFactory atypeFactory;

/**
* Create a transfer function for the Lock Checker.
*
* @param analysis the analysis this transfer function belongs to
* @param checker the type-checker this transfer function belongs to
*/
public LockTransfer(LockAnalysis analysis, LockChecker checker) {
// Always run the Lock Checker with -AconcurrentSemantics turned on.
super(analysis, true /* useConcurrentSemantics */);
super(analysis, /*useConcurrentSemantics=*/ true);
this.atypeFactory = (LockAnnotatedTypeFactory) analysis.getTypeFactory();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,14 @@ public void initializeThisValue(AnnotationMirror a, TypeMirror underlyingType) {
}
}

/*
* Indicates whether the given method is side-effect-free as far as the
* current store is concerned.
* In some cases, a store for a checker allows for other mechanisms to specify
* whether a method is side-effect-free. For example, unannotated methods may
* be considered side-effect-free by default.
*
* @param atypeFactory the type factory used to retrieve annotations on the method element
* @param method the method element
/**
* Indicates whether the given method is side-effect-free as far as the current store is
* concerned. In some cases, a store for a checker allows for other mechanisms to specify
* whether a method is side-effect-free. For example, unannotated methods may be considered
* side-effect-free by default.
*
* @param atypeFactory the type factory used to retrieve annotations on the method element
* @param method the method element
* @return whether the method is side-effect-free
*/
protected boolean isSideEffectFree(
Expand Down Expand Up @@ -207,7 +205,7 @@ public void updateForMethodCall(
FieldAccess fieldAccess = e.getKey();
V otherVal = e.getValue();

// case 3:
// case 3: the field has a monotonic annotation
if (!((GenericAnnotatedTypeFactory<?, ?, ?, ?>) atypeFactory)
.getSupportedMonotonicTypeQualifiers()
.isEmpty()) {
Expand Down Expand Up @@ -250,10 +248,10 @@ public void updateForMethodCall(
}
fieldValues = newFieldValues;

arrayValues.clear();

// update method values
methodValues.entrySet().removeIf(e -> !e.getKey().isUnmodifiableByOtherCode());

arrayValues.clear();
}

// store information about method call if possible
Expand Down

0 comments on commit 2d93c75

Please sign in to comment.