Skip to content

Commit d9f47bd

Browse files
committed
Java: Improve join-order by properly annotating haveIntersection.
1 parent 7883124 commit d9f47bd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

java/ql/lib/semmle/code/java/Type.qll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,14 +1261,21 @@ private Type erase(Type t) {
12611261
*
12621262
* For the definition of the notion of *erasure* see JLS v8, section 4.6 (Type Erasure).
12631263
*/
1264+
bindingset[t1, t2]
12641265
overlay[caller?]
1265-
pragma[inline]
1266+
pragma[inline_late]
12661267
predicate haveIntersection(RefType t1, RefType t2) {
12671268
exists(RefType e1, RefType e2 | e1 = erase(t1) and e2 = erase(t2) |
1268-
erasedHaveIntersection(e1, e2)
1269+
erasedHaveIntersectionFilter(e1, e2)
12691270
)
12701271
}
12711272

1273+
bindingset[t1, t2]
1274+
pragma[inline_late]
1275+
private predicate erasedHaveIntersectionFilter(RefType t1, RefType t2) {
1276+
erasedHaveIntersection(t1, t2)
1277+
}
1278+
12721279
/**
12731280
* Holds if there is no common (reflexive, transitive) subtype of the erasures
12741281
* of types `t1` and `t2`.

0 commit comments

Comments
 (0)