Skip to content

Commit 2132ee5

Browse files
author
Sauyon Lee
committed
Restrict the size of appliesTo for default methods
1 parent abf3bbb commit 2132ee5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

java/ql/src/utils/FlowTestCaseSupportMethods.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ private import semmle.code.java.dataflow.ExternalFlow
88
private import semmle.code.java.dataflow.FlowSummary
99
private import semmle.code.java.dataflow.internal.FlowSummaryImpl
1010
private import FlowTestCaseUtils
11+
private import FlowTestCase
1112

1213
/**
1314
* Returns a valid Java token naming the field `fc`.
@@ -157,7 +158,7 @@ private class DefaultGetMethod extends GetMethod {
157158
override predicate appliesTo(Type t, Content c1) {
158159
c = c1 and
159160
// suppress unused variable warning
160-
t = t
161+
t = [any(TestCase tc).getOutputType(), any(VoidType v)]
161162
}
162163

163164
bindingset[arg]
@@ -297,7 +298,7 @@ private class DefaultGenMethod extends GenMethod {
297298
override predicate appliesTo(Type t, Content c1) {
298299
c = c1 and
299300
// suppress unused variable warning
300-
t = t
301+
t = [any(TestCase tc).getInputType(), any(VoidType v)]
301302
}
302303

303304
bindingset[arg]

0 commit comments

Comments
 (0)