7
7
import java
8
8
9
9
/**
10
+ * DEPRECATED: Use `conditionCheckMethodArgument` instead.
10
11
* Holds if `m` is a non-overridable method that checks that its first argument
11
12
* is equal to `checkTrue` and throws otherwise.
12
13
*/
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 )
15
16
}
16
17
17
18
/**
18
19
* Holds if `m` is a non-overridable method that checks that its zero-indexed `argument`
19
20
* is equal to `checkTrue` and throws otherwise.
20
21
*/
21
- predicate conditionCheckMethod ( Method m , int argument , boolean checkTrue ) {
22
+ predicate conditionCheckMethodArgument ( Method m , int argument , boolean checkTrue ) {
22
23
condtionCheckMethodGooglePreconditions ( m , checkTrue ) and argument = 0
23
24
or
24
25
conditionCheckMethodApacheCommonsLang3Validate ( m , checkTrue ) and argument = 0
@@ -29,7 +30,7 @@ predicate conditionCheckMethod(Method m, int argument, boolean checkTrue) {
29
30
p = m .getParameter ( argument ) and
30
31
not m .isOverridable ( ) and
31
32
m .getBody ( ) .getStmt ( 0 ) .( ExprStmt ) .getExpr ( ) = ma and
32
- conditionCheck ( ma , argIndex , ct ) and
33
+ conditionCheckArgument ( ma , argIndex , ct ) and
33
34
ma .getArgument ( argIndex ) = arg and
34
35
(
35
36
arg .( LogNotExpr ) .getExpr ( ) .( VarAccess ) .getVariable ( ) = p and
@@ -105,15 +106,16 @@ private predicate condtionCheckMethodTestingFramework(Method m, int argument, bo
105
106
}
106
107
107
108
/**
109
+ * DEPRECATED: Use `conditionCheckArgument` instead.
108
110
* Holds if `ma` is an access to a non-overridable method that checks that its
109
111
* first argument is equal to `checkTrue` and throws otherwise.
110
112
*/
111
- predicate conditionCheck ( MethodAccess ma , boolean checkTrue ) { conditionCheck ( ma , 0 , checkTrue ) }
113
+ deprecated predicate conditionCheck ( MethodAccess ma , boolean checkTrue ) { conditionCheckArgument ( ma , 0 , checkTrue ) }
112
114
113
115
/**
114
116
* Holds if `ma` is an access to a non-overridable method that checks that its
115
117
* zero-indexed `argument` is equal to `checkTrue` and throws otherwise.
116
118
*/
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 )
119
121
}
0 commit comments