@@ -18,20 +18,20 @@ module StringOps {
1818 /**
1919 * Gets the `A` in `A.start_with?(B)`.
2020 */
21- DataFlow:: Node getBaseString ( ) { result = super .getBaseString ( ) }
21+ final DataFlow:: Node getBaseString ( ) { result = super .getBaseString ( ) }
2222
2323 /**
2424 * Gets the `B` in `A.start_with?(B)`.
2525 */
26- DataFlow:: Node getSubstring ( ) { result = super .getSubstring ( ) }
26+ final DataFlow:: Node getSubstring ( ) { result = super .getSubstring ( ) }
2727
2828 /**
2929 * Gets the polarity of the check.
3030 *
3131 * If the polarity is `false` the check returns `true` if the string does not start
3232 * with the given substring.
3333 */
34- boolean getPolarity ( ) { result = super .getPolarity ( ) }
34+ final boolean getPolarity ( ) { result = super .getPolarity ( ) }
3535 }
3636
3737 /**
@@ -75,15 +75,15 @@ module StringOps {
7575 /**
7676 * An expression of form `A.index(B) == 0` or `A.index(B) != 0`.
7777 */
78- private class StartsWith_IndexOfEquals extends Range , DataFlow :: Node {
78+ private class StartsWith_IndexOfEquals extends Range {
7979 private DataFlow:: CallNode indexOf ;
8080 private boolean polarity ;
8181
8282 StartsWith_IndexOfEquals ( ) {
8383 exists ( ExprNodes:: ComparisonOperationCfgNode comparison |
8484 this .asExpr ( ) = comparison and
8585 indexOf .getMethodName ( ) = "index" and
86- count ( indexOf .getArgument ( _) ) = 1 and
86+ strictcount ( indexOf .getArgument ( _) ) = 1 and
8787 indexOf .flowsTo ( any ( DataFlow:: Node n | n .asExpr ( ) = comparison .getAnOperand ( ) ) ) and
8888 comparison .getAnOperand ( ) .getConstantValue ( ) .getInt ( ) = 0
8989 |
@@ -110,10 +110,10 @@ module StringOps {
110110 */
111111 class Includes extends InclusionTest {
112112 /** Gets the `A` in `A.include?(B)`. */
113- DataFlow:: Node getBaseString ( ) { result = super .getContainerNode ( ) }
113+ final DataFlow:: Node getBaseString ( ) { result = super .getContainerNode ( ) }
114114
115115 /** Gets the `B` in `A.include?(B)`. */
116- DataFlow:: Node getSubstring ( ) { result = super .getContainedNode ( ) }
116+ final DataFlow:: Node getSubstring ( ) { result = super .getContainedNode ( ) }
117117 }
118118
119119 /**
@@ -123,20 +123,20 @@ module StringOps {
123123 /**
124124 * Gets the `A` in `A.start_with?(B)`.
125125 */
126- DataFlow:: Node getBaseString ( ) { result = super .getBaseString ( ) }
126+ final DataFlow:: Node getBaseString ( ) { result = super .getBaseString ( ) }
127127
128128 /**
129129 * Gets the `B` in `A.start_with?(B)`.
130130 */
131- DataFlow:: Node getSubstring ( ) { result = super .getSubstring ( ) }
131+ final DataFlow:: Node getSubstring ( ) { result = super .getSubstring ( ) }
132132
133133 /**
134134 * Gets the polarity if the check.
135135 *
136136 * If the polarity is `false` the check returns `true` if the string does not end
137137 * with the given substring.
138138 */
139- boolean getPolarity ( ) { result = super .getPolarity ( ) }
139+ final boolean getPolarity ( ) { result = super .getPolarity ( ) }
140140 }
141141
142142 /**
0 commit comments