77import java
88
99/**
10+ * DEPRECATED: Use `conditionCheckMethodArgument` instead.
1011 * Holds if `m` is a non-overridable method that checks that its first argument
1112 * is equal to `checkTrue` and throws otherwise.
1213 */
13- predicate conditionCheckMethod ( Method m , boolean checkTrue ) {
14- conditionCheckMethod ( m , 0 , checkTrue )
14+ deprecated predicate conditionCheckMethod ( Method m , boolean checkTrue ) {
15+ conditionCheckMethodArgument ( m , 0 , checkTrue )
1516}
1617
1718/**
1819 * Holds if `m` is a non-overridable method that checks that its zero-indexed `argument`
1920 * is equal to `checkTrue` and throws otherwise.
2021 */
21- predicate conditionCheckMethod ( Method m , int argument , boolean checkTrue ) {
22+ predicate conditionCheckMethodArgument ( Method m , int argument , boolean checkTrue ) {
2223 condtionCheckMethodGooglePreconditions ( m , checkTrue ) and argument = 0
2324 or
2425 conditionCheckMethodApacheCommonsLang3Validate ( m , checkTrue ) and argument = 0
@@ -29,7 +30,7 @@ predicate conditionCheckMethod(Method m, int argument, boolean checkTrue) {
2930 p = m .getParameter ( argument ) and
3031 not m .isOverridable ( ) and
3132 m .getBody ( ) .getStmt ( 0 ) .( ExprStmt ) .getExpr ( ) = ma and
32- conditionCheck ( ma , argIndex , ct ) and
33+ conditionCheckArgument ( ma , argIndex , ct ) and
3334 ma .getArgument ( argIndex ) = arg and
3435 (
3536 arg .( LogNotExpr ) .getExpr ( ) .( VarAccess ) .getVariable ( ) = p and
@@ -105,15 +106,16 @@ private predicate condtionCheckMethodTestingFramework(Method m, int argument, bo
105106}
106107
107108/**
109+ * DEPRECATED: Use `conditionCheckArgument` instead.
108110 * Holds if `ma` is an access to a non-overridable method that checks that its
109111 * first argument is equal to `checkTrue` and throws otherwise.
110112 */
111- predicate conditionCheck ( MethodAccess ma , boolean checkTrue ) { conditionCheck ( ma , 0 , checkTrue ) }
113+ deprecated predicate conditionCheck ( MethodAccess ma , boolean checkTrue ) { conditionCheckArgument ( ma , 0 , checkTrue ) }
112114
113115/**
114116 * Holds if `ma` is an access to a non-overridable method that checks that its
115117 * zero-indexed `argument` is equal to `checkTrue` and throws otherwise.
116118 */
117- predicate conditionCheck ( MethodAccess ma , int argument , boolean checkTrue ) {
118- conditionCheckMethod ( ma .getMethod ( ) .getSourceDeclaration ( ) , argument , checkTrue )
119+ predicate conditionCheckArgument ( MethodAccess ma , int argument , boolean checkTrue ) {
120+ conditionCheckMethodArgument ( ma .getMethod ( ) .getSourceDeclaration ( ) , argument , checkTrue )
119121}
0 commit comments