Skip to content

Commit 23b9028

Browse files
author
Sauyon Lee
committed
Correctly determine which support method definitions are required
1 parent 04e04b3 commit 23b9028

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

java/ql/src/utils/FlowTestCase.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,12 @@ class TestCase extends TTestCase {
267267
* Returns the definition of a `newWith` method needed to set up the input or a `get` method needed to set up the output for this test.
268268
*/
269269
SupportMethod getASupportMethod() {
270-
result = SupportMethod::genMethodFor(this.getInputType(), input) or
271-
result = SupportMethod::genMethodForContent(input.tail().drop(_)) or
270+
exists(SummaryComponentStack s | s = input.drop(_) and s.tail() != baseInput |
271+
result = SupportMethod::genMethodForContent(s)
272+
) or
273+
exists(SummaryComponentStack s | s = input.drop(_) and s.tail() = baseInput |
274+
result = SupportMethod::genMethodFor(this.getInputType(), s)
275+
) or
272276
result = SupportMethod::getMethodFor(this.getOutputType(), output) or
273277
result = SupportMethod::getMethodForContent(output.tail().drop(_))
274278
}

0 commit comments

Comments
 (0)