@@ -9,22 +9,22 @@ void FormatTests()
9
9
String . Format ( "{0} {1} {2}" , 0 , 1 , 2 ) ;
10
10
11
11
// BAD: Missing arg {0}
12
- String . Format ( "X" , 1 ) ; // $ Alert Sink
12
+ String . Format ( "X" , 1 ) ; // $ Alert
13
13
14
14
// BAD: Missing {1}
15
- String . Format ( "{0}" , 1 , 2 ) ; // $ Alert Sink
15
+ String . Format ( "{0}" , 1 , 2 ) ; // $ Alert
16
16
17
17
// BAD: Missing {1}
18
- String . Format ( "{0} {0}" , 1 , 2 ) ; // $ Alert Sink
18
+ String . Format ( "{0} {0}" , 1 , 2 ) ; // $ Alert
19
19
20
20
// BAD: Missing {0}
21
- String . Format ( "{1} {1}" , 1 , 2 ) ; // $ Alert Sink
21
+ String . Format ( "{1} {1}" , 1 , 2 ) ; // $ Alert
22
22
23
23
// BAD: Missing {0}, {1} and {2}
24
- String . Format ( "abcdefg" , 0 , 1 , 2 ) ; // $ Alert Sink
24
+ String . Format ( "abcdefg" , 0 , 1 , 2 ) ; // $ Alert
25
25
26
26
// BAD: {0} is unused
27
- String . Format ( "{{sdc}}" , 0 ) ; // $ Alert Sink
27
+ String . Format ( "{{sdc}}" , 0 ) ; // $ Alert
28
28
29
29
// GOOD: {0} is used
30
30
String . Format ( "{{{0:D}}}" , 0 ) ;
@@ -36,7 +36,7 @@ void FormatTests()
36
36
String . Format ( "{0} {1} {2}" , ps ) ;
37
37
38
38
// BAD: Would display "{0}"
39
- String . Format ( "{{0}}" , 1 ) ; // $ Alert Sink
39
+ String . Format ( "{{0}}" , 1 ) ; // $ Alert
40
40
41
41
// GOOD: Ignore the empty string as it's often used as the default value
42
42
// of GetResource().
@@ -50,35 +50,35 @@ void CompositeFormatTests()
50
50
var format11 = CompositeFormat . Parse ( "{1}{1}" ) ; // $ Source=source6
51
51
52
52
// BAD: Unused arg {0}
53
- String . Format < string > ( null , format , "" ) ; // $ Alert=source4 Sink=source4
53
+ String . Format < string > ( null , format , "" ) ; // $ Alert=source4
54
54
55
55
// BAD: Unused arg {1}
56
- String . Format < string , string > ( null , format00 , "" , "" ) ; // $ Alert=source5 Sink=source5
56
+ String . Format < string , string > ( null , format00 , "" , "" ) ; // $ Alert=source5
57
57
58
58
// BAD: Unused arg {0}
59
- String . Format < string , string > ( null , format11 , "" , "" ) ; // $ Alert=source6 Sink=source6
59
+ String . Format < string , string > ( null , format11 , "" , "" ) ; // $ Alert=source6
60
60
61
61
// BAD: Unused arg {0}
62
- sb . AppendFormat ( null , format , "" ) ; // $ Alert=source4 Sink=source4
63
- sb . AppendFormat < string > ( null , format , "" ) ; // $ Alert=source4 Sink=source4
62
+ sb . AppendFormat ( null , format , "" ) ; // $ Alert=source4
63
+ sb . AppendFormat < string > ( null , format , "" ) ; // $ Alert=source4
64
64
65
65
// BAD: Unused arg {1}
66
- sb . AppendFormat < string , string > ( null , format00 , "" , "" ) ; // $ Alert=source5 Sink=source5
66
+ sb . AppendFormat < string , string > ( null , format00 , "" , "" ) ; // $ Alert=source5
67
67
68
68
// BAD: Unused arg {0}
69
- sb . AppendFormat < string , string > ( null , format11 , "" , "" ) ; // $ Alert=source6 Sink=source6
69
+ sb . AppendFormat < string , string > ( null , format11 , "" , "" ) ; // $ Alert=source6
70
70
71
71
var span = new Span < char > ( ) ;
72
72
73
73
// BAD: Unused arg {0}
74
- span . TryWrite ( null , format , out _ , "" ) ; // $ Alert=source4 Sink=source4
75
- span . TryWrite < string > ( null , format , out _ , "" ) ; // $ Alert=source4 Sink=source4
74
+ span . TryWrite ( null , format , out _ , "" ) ; // $ Alert=source4
75
+ span . TryWrite < string > ( null , format , out _ , "" ) ; // $ Alert=source4
76
76
77
77
// BAD: Unused arg {1}
78
- span . TryWrite < string , string > ( null , format00 , out _ , "" , "" ) ; // $ Alert=source5 Sink=source5
78
+ span . TryWrite < string , string > ( null , format00 , out _ , "" , "" ) ; // $ Alert=source5
79
79
80
80
// BAD: Unused arg {0}
81
- span . TryWrite < string , string > ( null , format11 , out _ , "" , "" ) ; // $ Alert=source6 Sink=source6
81
+ span . TryWrite < string , string > ( null , format11 , out _ , "" , "" ) ; // $ Alert=source6
82
82
}
83
83
84
84
object [ ] ps ;
0 commit comments