Skip to content

Commit

Permalink
Merge branch 'master' into misc-github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ao-senXiong authored Jan 3, 2025
2 parents d1ad2e1 + 68a6360 commit 152b2b6
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 32 deletions.
2 changes: 1 addition & 1 deletion checker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ dependencies {
testImplementation 'com.amazonaws:aws-java-sdk-ec2'
testImplementation 'com.amazonaws:aws-java-sdk-kms'
// The AWS SDK is used for testing the Called Methods Checker.
testImplementation platform('com.amazonaws:aws-java-sdk-bom:1.12.770')
testImplementation platform('com.amazonaws:aws-java-sdk-bom:1.12.780')
// For the Resource Leak Checker's support for JavaEE.
testImplementation 'javax.servlet:javax.servlet-api:4.0.1'
// For the Resource Leak Checker's support for IOUtils.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ protected boolean commonAssignmentCheck(
}
}

/// TODO: What does "take precedence over" mean? Both are issued, but the
/// "i18nformat.excess.arguments" appears first in the output. Is this meant to not call
/// super.commonAssignmentCheck() if `result` is already false?
// TODO: What does "take precedence over" mean? Both are issued, but the
// "i18nformat.excess.arguments" appears first in the output. Is this meant to not call
// super.commonAssignmentCheck() if `result` is already false?
// By calling super.commonAssignmentCheck() last, any "i18nformat.excess.arguments"
// message issued for a given line of code will take precedence over the
// "assignment.type.incompatible"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,16 @@ public TransferResult<CFValue, CFStore> visitAssignment(
* {@code node} is known to be {@code typeOfNode}. If the node is a plus or a minus then the
* types of the left and right operands can be refined to include offsets. If the node is a
* multiplication, its operands can also be refined. See {@link
* #propagateToAdditionOperand(LessThanLengthOf, Node, Node, TransferInput, CFStore)}, {@link
* #propagateToSubtractionOperands(LessThanLengthOf, NumericalSubtractionNode, TransferInput,
* CFStore)}, and {@link #propagateToMultiplicationOperand(LessThanLengthOf, Node, Node,
* TransferInput, CFStore)} for details.
* #propagateToAdditionOperand(UBQualifier.LessThanLengthOf, Node, Node, TransferInput,
* CFStore)}, {@link #propagateToSubtractionOperands(UBQualifier.LessThanLengthOf,
* NumericalSubtractionNode, TransferInput, CFStore)}, and {@link
* #propagateToMultiplicationOperand(UBQualifier.LessThanLengthOf, Node, Node, TransferInput,
* CFStore)} for details.
*
* @param typeOfNode type of node
* @param node the node
* @param in the TransferInput before propagate to this operand
* @param store location to store the refined type
*/
private void propagateToOperands(
LessThanLengthOf typeOfNode,
Expand Down Expand Up @@ -234,10 +240,10 @@ private void propagateToMultiplicationOperand(
*
* <p>This means that the left node is less than or equal to the length of the array when the
* right node is subtracted from the left node. Note that unlike {@link
* #propagateToAdditionOperand(LessThanLengthOf, Node, Node, TransferInput, CFStore)} and {@link
* #propagateToMultiplicationOperand(LessThanLengthOf, Node, Node, TransferInput, CFStore)},
* this method takes the NumericalSubtractionNode instead of the two operand nodes. This
* implements case 4.
* #propagateToAdditionOperand(UBQualifier.LessThanLengthOf, Node, Node, TransferInput,
* CFStore)} and {@link #propagateToMultiplicationOperand(UBQualifier.LessThanLengthOf, Node,
* Node, TransferInput, CFStore)}, this method takes the NumericalSubtractionNode instead of the
* two operand nodes. This implements case 4.
*
* @param typeOfSubtraction type of node
* @param node subtraction node that has typeOfSubtraction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public FlowRule getFlowRule() {
* Produce a string representation.
*
* @return a string representation
* @see org.checkerframework.dataflow.cfg.builder.CFGBuilder.PhaseOneResult#nodeToString
* @see org.checkerframework.dataflow.cfg.builder.PhaseOneResult#nodeToString
*/
@Override
public String toString() {
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/creating-a-checker.tex
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
repository \url{https://github.com/eisop/checker-framework}.
Another choice is to write it in a stand-alone repository. Here is a
template for a stand-alone repository:
\url{https://github.com/typetools/templatefora-checker}; at that URL,
\url{https://github.com/eisop/templatefora-checker}; at that URL,
click the ``Use this template'' button.

% You may also wish to consult Section~\ref{creating-testing-framework} for
Expand Down
4 changes: 2 additions & 2 deletions docs/manual/map-key-checker.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
\chapterAndLabel{Map Key Checker}{map-key-checker}

The Map Key Checker tracks which values are keys for which maps. If variable
\code{v} has type \code{@KeyFor("m")...}, then the value of \code{v} is a key
in Map \code{m}. That is, the expression \code{m.containsKey(v)} evaluates to
\code{k} has type \code{@KeyFor("m")...}, then the value of \code{k} is a key
in Map \code{m}. That is, the expression \code{m.containsKey(k)} evaluates to
\code{true}.

Section~\ref{map-key-qualifiers} describes how \code{@KeyFor} annotations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3815,7 +3815,7 @@ protected void reportMethodInvocabilityError(
* constructor result type. This is equivalent to down-casting.
*
* <p>For type checking of the enclosing expression of inner type instantiations, see {@link
* #checkEnclosingExpr(NewClassTree, AnnotatedExecutableType)}
* #checkEnclosingExpr(NewClassTree, AnnotatedTypeMirror.AnnotatedExecutableType)}
*
* @param invocation the AnnotatedDeclaredType of the constructor invocation
* @param constructor the AnnotatedExecutableType of the constructor declaration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ private AnnotatedExecutableType(ExecutableType type, AnnotatedTypeFactory factor
/** The parameter types; an unmodifiable list. */
private @MonotonicNonNull List<AnnotatedTypeMirror> paramTypes = null;

/** Whether {@link paramTypes} has been computed. */
/** Whether {@link #paramTypes} has been computed. */
private boolean paramTypesComputed = false;

/**
Expand All @@ -1223,32 +1223,33 @@ private AnnotatedExecutableType(ExecutableType type, AnnotatedTypeFactory factor
private @Nullable AnnotatedDeclaredType receiverType;

/**
* The varargs type is the last element of {@link paramTypes} if the method or constructor
* accepts a variable number of arguments and the {@link paramTypes} has not been expanded
* The varargs type is the last element of {@link #paramTypes} if the method or constructor
* accepts a variable number of arguments and the {@link #paramTypes} has not been expanded
* yet. This type needs to be stored in the field to avoid being affected by calling {@link
* AnnotatedTypes#adaptParameters(AnnotatedTypeFactory, AnnotatedExecutableType, List)}.
* AnnotatedTypes#adaptParameters(AnnotatedTypeFactory,
* AnnotatedTypeMirror.AnnotatedExecutableType, List, com.sun.source.tree.NewClassTree)}.
*/
private @MonotonicNonNull AnnotatedArrayType varargType = null;

/** Whether {@link receiverType} has been computed. */
/** Whether {@link #receiverType} has been computed. */
private boolean receiverTypeComputed = false;

/** The return type. */
private AnnotatedTypeMirror returnType;

/** Whether {@link returnType} has been computed. */
/** Whether {@link #returnType} has been computed. */
private boolean returnTypeComputed = false;

/** The thrown types; an unmodifiable list. */
private List<AnnotatedTypeMirror> thrownTypes;

/** Whether {@link thrownTypes} has been computed. */
/** Whether {@link #thrownTypes} has been computed. */
private boolean thrownTypesComputed = false;

/** The type variables; an unmodifiable list. */
private List<AnnotatedTypeVariable> typeVarTypes;

/** Whether {@link typeVarTypes} has been computed. */
/** Whether {@link #typeVarTypes} has been computed. */
private boolean typeVarTypesComputed = false;

/**
Expand Down Expand Up @@ -1285,7 +1286,7 @@ public void addAnnotation(AnnotationMirror annotation) {
/**
* Sets the parameter types of this executable type, excluding the receiver.If paramTypes
* has been computed and this type is a varargs method, computes and store {@link
* varargType} before calling this method, @see {@link varargType}
* #varargType} before calling this method, @see {@link #varargType}
*
* @param params an unmodifiable list of parameter types to be captured by this method,
* excluding the receiver
Expand Down Expand Up @@ -1344,19 +1345,19 @@ public List<AnnotatedTypeMirror> getParameterTypes() {
}

/**
* Computes the vararg type of this executable type and stores it in {@link varargType}.
* Computes the vararg type of this executable type and stores it in {@link #varargType}.
*
* <p>This method computes {@link varargType} using the {@link paramTypes} of this
* executable type. To use the {@link paramTypes} from different executable type, use {@link
* #computeVarargType(AnnotatedExecutableType)}.
* <p>This method computes {@link #varargType} using the {@link #paramTypes} of this
* executable type. To use the {@link #paramTypes} from different executable type, use
* {@link #computeVarargType(AnnotatedTypeMirror.AnnotatedExecutableType)}.
*/
/*package-private*/ void computeVarargType() {
computeVarargType(paramTypes);
}

/**
* Computes the vararg type using the passed executable type and stores it in this {@link
* varargType}.
* #varargType}.
*
* @param annotatedExecutableType an AnnotatedExecutableType
*/
Expand All @@ -1367,7 +1368,7 @@ public List<AnnotatedTypeMirror> getParameterTypes() {

/**
* Helper function for {@link #computeVarargType()} and {@link
* #computeVarargType(AnnotatedExecutableType)}.
* #computeVarargType(AnnotatedTypeMirror.AnnotatedExecutableType)}.
*
* @param paramTypes the parameter types to determine the vararg type
*/
Expand Down

0 comments on commit 152b2b6

Please sign in to comment.