| 1 | class StaticTaintTransfer { |
| 2 | |
| 3 | public static void main(String[] args) { |
| 4 | String arr[] = new String[1]; |
| 5 | arr[0] = SourceSink.source(); |
| 6 | String result[] = mapString(arr, new Mapper() { |
| 7 | @Override |
| 8 | public String map(String s) { |
| 9 | return concat("hello, ", s); |
| 10 | } |
| 11 | }); |
| 12 | SourceSink.sink(result[0]); |
| 13 | } |
| 14 | |
| 15 | static String concat(String lhs, String rhs) { |
| 16 | return new String(); |
| 17 | } |
| 18 | |
| 19 | static String[] mapString(String arr[], Mapper mapper) { |
| 20 | String result[] = new String[arr.length]; |
| 21 | for (int i = 0; i < arr.length; ++i) { |
| 22 | result[i] = mapper.map(arr[i]); |
| 23 | } |
| 24 | return result; |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | interface Mapper { |
| 29 | public String map(String s); |
nothing calls this directly
no outgoing calls
no test coverage detected