@@ -17,66 +17,66 @@ void test() throws Exception {
1717 StrLookup <String > taintedLookup = StrLookup .mapLookup (taintedMap );
1818
1919 // Test constructors:
20- StrSubstitutor ss1 = new StrSubstitutor (); ss1 .setVariableResolver (taintedLookup ); sink (ss1 .replace ("input" )); // $hasTaintFlow=y
21- StrSubstitutor ss2 = new StrSubstitutor (taintedMap ); sink (ss2 .replace ("input" )); // $hasTaintFlow=y
22- StrSubstitutor ss3 = new StrSubstitutor (taintedMap , "{" , "}" ); sink (ss3 .replace ("input" )); // $hasTaintFlow=y
23- StrSubstitutor ss4 = new StrSubstitutor (taintedMap , "{" , "}" , ' ' ); sink (ss4 .replace ("input" )); // $hasTaintFlow=y
24- StrSubstitutor ss5 = new StrSubstitutor (taintedMap , "{" , "}" , ' ' , "," ); sink (ss5 .replace ("input" )); // $hasTaintFlow=y
25- StrSubstitutor ss6 = new StrSubstitutor (taintedLookup ); sink (ss6 .replace ("input" )); // $hasTaintFlow=y
26- StrSubstitutor ss7 = new StrSubstitutor (taintedLookup , "{" , "}" , ' ' ); sink (ss7 .replace ("input" )); // $hasTaintFlow=y
27- StrSubstitutor ss8 = new StrSubstitutor (taintedLookup , "{" , "}" , ' ' , "," ); sink (ss8 .replace ("input" )); // $hasTaintFlow=y
28- StrSubstitutor ss9 = new StrSubstitutor (taintedLookup , (StrMatcher )null , null , ' ' ); sink (ss9 .replace ("input" )); // $hasTaintFlow=y
29- StrSubstitutor ss10 = new StrSubstitutor (taintedLookup , (StrMatcher )null , null , ' ' , null ); sink (ss10 .replace ("input" )); // $hasTaintFlow=y
20+ StrSubstitutor ss1 = new StrSubstitutor (); ss1 .setVariableResolver (taintedLookup ); sink (ss1 .replace ("input" )); // $hasTaintFlow
21+ StrSubstitutor ss2 = new StrSubstitutor (taintedMap ); sink (ss2 .replace ("input" )); // $hasTaintFlow
22+ StrSubstitutor ss3 = new StrSubstitutor (taintedMap , "{" , "}" ); sink (ss3 .replace ("input" )); // $hasTaintFlow
23+ StrSubstitutor ss4 = new StrSubstitutor (taintedMap , "{" , "}" , ' ' ); sink (ss4 .replace ("input" )); // $hasTaintFlow
24+ StrSubstitutor ss5 = new StrSubstitutor (taintedMap , "{" , "}" , ' ' , "," ); sink (ss5 .replace ("input" )); // $hasTaintFlow
25+ StrSubstitutor ss6 = new StrSubstitutor (taintedLookup ); sink (ss6 .replace ("input" )); // $hasTaintFlow
26+ StrSubstitutor ss7 = new StrSubstitutor (taintedLookup , "{" , "}" , ' ' ); sink (ss7 .replace ("input" )); // $hasTaintFlow
27+ StrSubstitutor ss8 = new StrSubstitutor (taintedLookup , "{" , "}" , ' ' , "," ); sink (ss8 .replace ("input" )); // $hasTaintFlow
28+ StrSubstitutor ss9 = new StrSubstitutor (taintedLookup , (StrMatcher )null , null , ' ' ); sink (ss9 .replace ("input" )); // $hasTaintFlow
29+ StrSubstitutor ss10 = new StrSubstitutor (taintedLookup , (StrMatcher )null , null , ' ' , null ); sink (ss10 .replace ("input" )); // $hasTaintFlow
3030
3131 // Test replace overloads (tainted substitution map):
3232 StrSubstitutor taintedSubst = ss2 ;
33- sink (taintedSubst .replace ((Object )"input" )); // $hasTaintFlow=y
34- sink (taintedSubst .replace ("input" )); // $hasTaintFlow=y
35- sink (taintedSubst .replace ("input" , 0 , 0 )); // $hasTaintFlow=y
36- sink (taintedSubst .replace ("input" .toCharArray ())); // $hasTaintFlow=y
37- sink (taintedSubst .replace ("input" .toCharArray (), 0 , 0 )); // $hasTaintFlow=y
38- sink (taintedSubst .replace ((CharSequence )"input" )); // $hasTaintFlow=y
39- sink (taintedSubst .replace ((CharSequence )"input" , 0 , 0 )); // $hasTaintFlow=y
40- sink (taintedSubst .replace (new StrBuilder ("input" ))); // $hasTaintFlow=y
41- sink (taintedSubst .replace (new StrBuilder ("input" ), 0 , 0 )); // $hasTaintFlow=y
42- sink (taintedSubst .replace (new StringBuilder ("input" ))); // $hasTaintFlow=y
43- sink (taintedSubst .replace (new StringBuilder ("input" ), 0 , 0 )); // $hasTaintFlow=y
44- sink (taintedSubst .replace (new StringBuffer ("input" ))); // $hasTaintFlow=y
45- sink (taintedSubst .replace (new StringBuffer ("input" ), 0 , 0 )); // $hasTaintFlow=y
33+ sink (taintedSubst .replace ((Object )"input" )); // $hasTaintFlow
34+ sink (taintedSubst .replace ("input" )); // $hasTaintFlow
35+ sink (taintedSubst .replace ("input" , 0 , 0 )); // $hasTaintFlow
36+ sink (taintedSubst .replace ("input" .toCharArray ())); // $hasTaintFlow
37+ sink (taintedSubst .replace ("input" .toCharArray (), 0 , 0 )); // $hasTaintFlow
38+ sink (taintedSubst .replace ((CharSequence )"input" )); // $hasTaintFlow
39+ sink (taintedSubst .replace ((CharSequence )"input" , 0 , 0 )); // $hasTaintFlow
40+ sink (taintedSubst .replace (new StrBuilder ("input" ))); // $hasTaintFlow
41+ sink (taintedSubst .replace (new StrBuilder ("input" ), 0 , 0 )); // $hasTaintFlow
42+ sink (taintedSubst .replace (new StringBuilder ("input" ))); // $hasTaintFlow
43+ sink (taintedSubst .replace (new StringBuilder ("input" ), 0 , 0 )); // $hasTaintFlow
44+ sink (taintedSubst .replace (new StringBuffer ("input" ))); // $hasTaintFlow
45+ sink (taintedSubst .replace (new StringBuffer ("input" ), 0 , 0 )); // $hasTaintFlow
4646
4747 // Test replace overloads (tainted input):
4848 StrSubstitutor untaintedSubst = ss1 ;
49- sink (untaintedSubst .replace ((Object )taint ())); // $hasTaintFlow=y
50- sink (untaintedSubst .replace (taint ())); // $hasTaintFlow=y
51- sink (untaintedSubst .replace (taint (), 0 , 0 )); // $hasTaintFlow=y
52- sink (untaintedSubst .replace (taint ().toCharArray ())); // $hasTaintFlow=y
53- sink (untaintedSubst .replace (taint ().toCharArray (), 0 , 0 )); // $hasTaintFlow=y
54- sink (untaintedSubst .replace ((CharSequence )taint ())); // $hasTaintFlow=y
55- sink (untaintedSubst .replace ((CharSequence )taint (), 0 , 0 )); // $hasTaintFlow=y
56- sink (untaintedSubst .replace (new StrBuilder (taint ()))); // $hasTaintFlow=y
57- sink (untaintedSubst .replace (new StrBuilder (taint ()), 0 , 0 )); // $hasTaintFlow=y
58- sink (untaintedSubst .replace (new StringBuilder (taint ()))); // $hasTaintFlow=y
59- sink (untaintedSubst .replace (new StringBuilder (taint ()), 0 , 0 )); // $hasTaintFlow=y
60- sink (untaintedSubst .replace (new StringBuffer (taint ()))); // $hasTaintFlow=y
61- sink (untaintedSubst .replace (new StringBuffer (taint ()), 0 , 0 )); // $hasTaintFlow=y
49+ sink (untaintedSubst .replace ((Object )taint ())); // $hasTaintFlow
50+ sink (untaintedSubst .replace (taint ())); // $hasTaintFlow
51+ sink (untaintedSubst .replace (taint (), 0 , 0 )); // $hasTaintFlow
52+ sink (untaintedSubst .replace (taint ().toCharArray ())); // $hasTaintFlow
53+ sink (untaintedSubst .replace (taint ().toCharArray (), 0 , 0 )); // $hasTaintFlow
54+ sink (untaintedSubst .replace ((CharSequence )taint ())); // $hasTaintFlow
55+ sink (untaintedSubst .replace ((CharSequence )taint (), 0 , 0 )); // $hasTaintFlow
56+ sink (untaintedSubst .replace (new StrBuilder (taint ()))); // $hasTaintFlow
57+ sink (untaintedSubst .replace (new StrBuilder (taint ()), 0 , 0 )); // $hasTaintFlow
58+ sink (untaintedSubst .replace (new StringBuilder (taint ()))); // $hasTaintFlow
59+ sink (untaintedSubst .replace (new StringBuilder (taint ()), 0 , 0 )); // $hasTaintFlow
60+ sink (untaintedSubst .replace (new StringBuffer (taint ()))); // $hasTaintFlow
61+ sink (untaintedSubst .replace (new StringBuffer (taint ()), 0 , 0 )); // $hasTaintFlow
6262
6363 // Test static replace methods:
64- sink (StrSubstitutor .replace (taint (), new HashMap <String , String >())); // $hasTaintFlow=y
65- sink (StrSubstitutor .replace (taint (), new HashMap <String , String >(), "{" , "}" )); // $hasTaintFlow=y
66- sink (StrSubstitutor .replace ("input" , taintedMap )); // $hasTaintFlow=y
67- sink (StrSubstitutor .replace ("input" , taintedMap , "{" , "}" )); // $hasTaintFlow=y
64+ sink (StrSubstitutor .replace (taint (), new HashMap <String , String >())); // $hasTaintFlow
65+ sink (StrSubstitutor .replace (taint (), new HashMap <String , String >(), "{" , "}" )); // $hasTaintFlow
66+ sink (StrSubstitutor .replace ("input" , taintedMap )); // $hasTaintFlow
67+ sink (StrSubstitutor .replace ("input" , taintedMap , "{" , "}" )); // $hasTaintFlow
6868 Properties taintedProps = new Properties ();
6969 taintedProps .put ("key" , taint ());
70- sink (StrSubstitutor .replace (taint (), new Properties ())); // $hasTaintFlow=y
71- sink (StrSubstitutor .replace ("input" , taintedProps )); // $hasTaintFlow=y
70+ sink (StrSubstitutor .replace (taint (), new Properties ())); // $hasTaintFlow
71+ sink (StrSubstitutor .replace ("input" , taintedProps )); // $hasTaintFlow
7272
7373 // Test replaceIn methods:
74- StrBuilder strBuilder1 = new StrBuilder (); taintedSubst .replaceIn (strBuilder1 ); sink (strBuilder1 .toString ()); // $hasTaintFlow=y
75- StrBuilder strBuilder2 = new StrBuilder (); taintedSubst .replaceIn (strBuilder2 , 0 , 0 ); sink (strBuilder2 .toString ()); // $hasTaintFlow=y
76- StringBuilder stringBuilder1 = new StringBuilder (); taintedSubst .replaceIn (stringBuilder1 ); sink (stringBuilder1 .toString ()); // $hasTaintFlow=y
77- StringBuilder stringBuilder2 = new StringBuilder (); taintedSubst .replaceIn (stringBuilder2 , 0 , 0 ); sink (stringBuilder2 .toString ()); // $hasTaintFlow=y
78- StringBuffer stringBuffer1 = new StringBuffer (); taintedSubst .replaceIn (stringBuffer1 ); sink (stringBuffer1 .toString ()); // $hasTaintFlow=y
79- StringBuffer stringBuffer2 = new StringBuffer (); taintedSubst .replaceIn (stringBuffer2 , 0 , 0 ); sink (stringBuffer2 .toString ()); // $hasTaintFlow=y
74+ StrBuilder strBuilder1 = new StrBuilder (); taintedSubst .replaceIn (strBuilder1 ); sink (strBuilder1 .toString ()); // $hasTaintFlow
75+ StrBuilder strBuilder2 = new StrBuilder (); taintedSubst .replaceIn (strBuilder2 , 0 , 0 ); sink (strBuilder2 .toString ()); // $hasTaintFlow
76+ StringBuilder stringBuilder1 = new StringBuilder (); taintedSubst .replaceIn (stringBuilder1 ); sink (stringBuilder1 .toString ()); // $hasTaintFlow
77+ StringBuilder stringBuilder2 = new StringBuilder (); taintedSubst .replaceIn (stringBuilder2 , 0 , 0 ); sink (stringBuilder2 .toString ()); // $hasTaintFlow
78+ StringBuffer stringBuffer1 = new StringBuffer (); taintedSubst .replaceIn (stringBuffer1 ); sink (stringBuffer1 .toString ()); // $hasTaintFlow
79+ StringBuffer stringBuffer2 = new StringBuffer (); taintedSubst .replaceIn (stringBuffer2 , 0 , 0 ); sink (stringBuffer2 .toString ()); // $hasTaintFlow
8080 }
8181
82- }
82+ }
0 commit comments