File tree Expand file tree Collapse file tree
java/ql/src/semmle/code/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ class FormatString extends string {
368368 /*abstract*/ int getASkippedFmtSpecIndex ( ) { none ( ) }
369369
370370 /**
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.
372372 */
373373 int getAnArgUsageOffset ( int argNo ) { none ( ) }
374374}
@@ -451,7 +451,6 @@ private class PrintfFormatString extends FormatString {
451451 override int getAnArgUsageOffset ( int argNo ) {
452452 argNo = fmtSpecRefersToSpecificIndex ( result )
453453 or
454- fmtSpecRefersToSequentialIndex ( result ) and
455454 result = rank [ argNo ] ( int i | fmtSpecRefersToSequentialIndex ( i ) )
456455 or
457456 fmtSpecRefersToPrevious ( result ) and
@@ -485,8 +484,5 @@ private class LoggerFormatString extends FormatString {
485484
486485 override int getMaxFmtSpecIndex ( ) { result = count ( int i | fmtPlaceholder ( i ) ) }
487486
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 ) ) }
492488}
You can’t perform that action at this time.
0 commit comments