@@ -2,11 +2,12 @@ import java
2
2
import semmle.code.java.dataflow.internal.DataFlowPrivate
3
3
import semmle.code.java.dataflow.ExternalFlow
4
4
import semmle.code.java.dataflow.FlowSummary
5
+ import semmle.code.java.dataflow.internal.FlowSummaryImpl
5
6
6
7
bindingset [ this ]
7
8
abstract class CsvRow extends string { }
8
9
9
- Type getParameterType ( SummarizedCallableExternal callable , int i ) {
10
+ Type getParameterType ( Private :: External :: SummarizedCallableExternal callable , int i ) {
10
11
if i = - 1 then result = callable .getDeclaringType ( ) else result = callable .getParameterType ( i )
11
12
}
12
13
@@ -66,15 +67,15 @@ Type getRootSourceDeclaration(Type t) {
66
67
67
68
newtype TRowTestSnippet =
68
69
MkSnippet (
69
- CsvRow row , SummarizedCallableExternal callable , SummaryComponentStack input ,
70
+ CsvRow row , Private :: External :: SummarizedCallableExternal callable , SummaryComponentStack input ,
70
71
SummaryComponentStack output , boolean preservesValue
71
72
) {
72
73
callable .propagatesFlowForRow ( input , output , preservesValue , row )
73
74
}
74
75
75
76
class RowTestSnippet extends TRowTestSnippet {
76
77
string row ;
77
- SummarizedCallableExternal callable ;
78
+ Private :: External :: SummarizedCallableExternal callable ;
78
79
SummaryComponentStack input ;
79
80
SummaryComponentStack output ;
80
81
SummaryComponentStack baseInput ;
@@ -122,7 +123,10 @@ class RowTestSnippet extends TRowTestSnippet {
122
123
// new Type(filler, in, out, filler);
123
124
exists ( string storePrefix , string invokePrefix , string args |
124
125
(
125
- if baseOutput = SummaryComponentStack:: return ( )
126
+ if
127
+ baseOutput = SummaryComponentStack:: return ( )
128
+ or
129
+ callable instanceof Constructor and baseOutput = SummaryComponentStack:: argument ( - 1 )
126
130
then storePrefix = "out = "
127
131
else storePrefix = ""
128
132
) and
@@ -213,15 +217,15 @@ class RowTestSnippet extends TRowTestSnippet {
213
217
214
218
string getASupportMethodModel ( ) {
215
219
exists ( SummaryComponent c , string contentSsvDescription |
216
- c = input .drop ( _) .head ( ) and c = interpretComponent ( contentSsvDescription )
220
+ c = input .drop ( _) .head ( ) and c = Private :: External :: interpretComponent ( contentSsvDescription )
217
221
|
218
222
result =
219
223
"generatedtest;Test;false;newWith" + contentToken ( getContent ( c ) ) + ";;;Argument[0];" +
220
224
contentSsvDescription + " of ReturnValue;value"
221
225
)
222
226
or
223
227
exists ( SummaryComponent c , string contentSsvDescription |
224
- c = output .drop ( _) .head ( ) and c = interpretComponent ( contentSsvDescription )
228
+ c = output .drop ( _) .head ( ) and c = Private :: External :: interpretComponent ( contentSsvDescription )
225
229
|
226
230
result =
227
231
"generatedtest;Test;false;get" + contentToken ( getContent ( c ) ) + ";;;" + contentSsvDescription
0 commit comments