@@ -18,20 +18,20 @@ module StringOps {
18
18
/**
19
19
* Gets the `A` in `A.start_with?(B)`.
20
20
*/
21
- DataFlow:: Node getBaseString ( ) { result = super .getBaseString ( ) }
21
+ final DataFlow:: Node getBaseString ( ) { result = super .getBaseString ( ) }
22
22
23
23
/**
24
24
* Gets the `B` in `A.start_with?(B)`.
25
25
*/
26
- DataFlow:: Node getSubstring ( ) { result = super .getSubstring ( ) }
26
+ final DataFlow:: Node getSubstring ( ) { result = super .getSubstring ( ) }
27
27
28
28
/**
29
29
* Gets the polarity of the check.
30
30
*
31
31
* If the polarity is `false` the check returns `true` if the string does not start
32
32
* with the given substring.
33
33
*/
34
- boolean getPolarity ( ) { result = super .getPolarity ( ) }
34
+ final boolean getPolarity ( ) { result = super .getPolarity ( ) }
35
35
}
36
36
37
37
/**
@@ -75,15 +75,15 @@ module StringOps {
75
75
/**
76
76
* An expression of form `A.index(B) == 0` or `A.index(B) != 0`.
77
77
*/
78
- private class StartsWith_IndexOfEquals extends Range , DataFlow :: Node {
78
+ private class StartsWith_IndexOfEquals extends Range {
79
79
private DataFlow:: CallNode indexOf ;
80
80
private boolean polarity ;
81
81
82
82
StartsWith_IndexOfEquals ( ) {
83
83
exists ( ExprNodes:: ComparisonOperationCfgNode comparison |
84
84
this .asExpr ( ) = comparison and
85
85
indexOf .getMethodName ( ) = "index" and
86
- count ( indexOf .getArgument ( _) ) = 1 and
86
+ strictcount ( indexOf .getArgument ( _) ) = 1 and
87
87
indexOf .flowsTo ( any ( DataFlow:: Node n | n .asExpr ( ) = comparison .getAnOperand ( ) ) ) and
88
88
comparison .getAnOperand ( ) .getConstantValue ( ) .getInt ( ) = 0
89
89
|
@@ -110,10 +110,10 @@ module StringOps {
110
110
*/
111
111
class Includes extends InclusionTest {
112
112
/** Gets the `A` in `A.include?(B)`. */
113
- DataFlow:: Node getBaseString ( ) { result = super .getContainerNode ( ) }
113
+ final DataFlow:: Node getBaseString ( ) { result = super .getContainerNode ( ) }
114
114
115
115
/** Gets the `B` in `A.include?(B)`. */
116
- DataFlow:: Node getSubstring ( ) { result = super .getContainedNode ( ) }
116
+ final DataFlow:: Node getSubstring ( ) { result = super .getContainedNode ( ) }
117
117
}
118
118
119
119
/**
@@ -123,20 +123,20 @@ module StringOps {
123
123
/**
124
124
* Gets the `A` in `A.start_with?(B)`.
125
125
*/
126
- DataFlow:: Node getBaseString ( ) { result = super .getBaseString ( ) }
126
+ final DataFlow:: Node getBaseString ( ) { result = super .getBaseString ( ) }
127
127
128
128
/**
129
129
* Gets the `B` in `A.start_with?(B)`.
130
130
*/
131
- DataFlow:: Node getSubstring ( ) { result = super .getSubstring ( ) }
131
+ final DataFlow:: Node getSubstring ( ) { result = super .getSubstring ( ) }
132
132
133
133
/**
134
134
* Gets the polarity if the check.
135
135
*
136
136
* If the polarity is `false` the check returns `true` if the string does not end
137
137
* with the given substring.
138
138
*/
139
- boolean getPolarity ( ) { result = super .getPolarity ( ) }
139
+ final boolean getPolarity ( ) { result = super .getPolarity ( ) }
140
140
}
141
141
142
142
/**
0 commit comments