File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
java/ql/src/semmle/code/java Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ class FormatString extends string {
368
368
/*abstract*/ int getASkippedFmtSpecIndex ( ) { none ( ) }
369
369
370
370
/**
371
- * Gets an offset in this format string where argument `argNo` will be interpolated, if any.
371
+ * Gets an offset (zero-based) in this format string where argument `argNo` (1-based) will be interpolated, if any.
372
372
*/
373
373
int getAnArgUsageOffset ( int argNo ) { none ( ) }
374
374
}
@@ -451,7 +451,6 @@ private class PrintfFormatString extends FormatString {
451
451
override int getAnArgUsageOffset ( int argNo ) {
452
452
argNo = fmtSpecRefersToSpecificIndex ( result )
453
453
or
454
- fmtSpecRefersToSequentialIndex ( result ) and
455
454
result = rank [ argNo ] ( int i | fmtSpecRefersToSequentialIndex ( i ) )
456
455
or
457
456
fmtSpecRefersToPrevious ( result ) and
@@ -485,8 +484,5 @@ private class LoggerFormatString extends FormatString {
485
484
486
485
override int getMaxFmtSpecIndex ( ) { result = count ( int i | fmtPlaceholder ( i ) ) }
487
486
488
- override int getAnArgUsageOffset ( int argNo ) {
489
- fmtPlaceholder ( result ) and
490
- argNo = count ( int i | fmtPlaceholder ( i ) and i < result )
491
- }
487
+ override int getAnArgUsageOffset ( int argNo ) { result = rank [ argNo ] ( int i | fmtPlaceholder ( i ) ) }
492
488
}
You can’t perform that action at this time.
0 commit comments