File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -152,4 +152,23 @@ public void get(HttpServletRequest req) {
152152 // ruleid: formatted-sql-string
153153 ResultSet rs = statement .executeQuery ();
154154 }
155+ }
156+
157+ public class SqlExampleNonStringBuilderConstructor {
158+
159+ public Retry <ResultSet > getRetry (final String mainQuery , final Connection connection ) {
160+ // not a StringBuilder
161+ return new Retry <>(
162+ // also not a StringBuilder
163+ new Callable <ResultSet >() {
164+ public ResultSet call () throws SQLException {
165+ PreparedStatement statement = connection .prepareStatement (
166+ mainQuery , ResultSet .TYPE_FORWARD_ONLY , ResultSet .CONCUR_READ_ONLY );
167+ statement .setFetchSize (Integer .MIN_VALUE );
168+ // ok: formatted-sql-string
169+ return statement .executeQuery ();
170+ }
171+ },
172+ Retry .RETRY_FOREVER );
173+ }
155174}
Original file line number Diff line number Diff line change @@ -52,12 +52,17 @@ rules:
5252 - pattern-either :
5353 - pattern : $X + $INPUT
5454 - pattern : $X += $INPUT
55- - pattern : $STRB.append($INPUT)
5655 - pattern : String.format(..., $INPUT, ...)
5756 - pattern : String.join(..., $INPUT, ...)
5857 - pattern : (String $STR).concat($INPUT)
5958 - pattern : $INPUT.concat(...)
60- - pattern : new $STRB(..., $INPUT, ...)
59+ - patterns :
60+ - pattern-either :
61+ - pattern : $STRB.append($INPUT)
62+ - pattern : new $STRB(..., $INPUT, ...)
63+ - metavariable-type :
64+ metavariable : $STRB
65+ type : StringBuilder
6166 label : CONCAT
6267 requires : INPUT
6368 pattern-propagators :
You can’t perform that action at this time.
0 commit comments