Skip to content

Commit 701e815

Browse files
authored
Merge pull request github#5628 from hvitved/java/remove-unique
Java: Remove `unique` wrapper from `DataFlow::Node::getEnclosingCallable()`
2 parents 992a4df + 2faf52b commit 701e815

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

java/ql/src/semmle/code/java/dataflow/internal/DataFlowUtil.qll

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,15 @@ class Node extends TNode {
8080
result = this.(ImplicitPostUpdateNode).getPreUpdateNode().getType()
8181
}
8282

83-
private Callable getEnclosingCallableImpl() {
83+
/** Gets the callable in which this node occurs. */
84+
Callable getEnclosingCallable() {
8485
result = this.asExpr().getEnclosingCallable() or
8586
result = this.asParameter().getCallable() or
8687
result = this.(ImplicitVarargsArray).getCall().getEnclosingCallable() or
8788
result = this.(InstanceParameterNode).getCallable() or
8889
result = this.(ImplicitInstanceAccess).getInstanceAccess().getEnclosingCallable() or
8990
result = this.(MallocNode).getClassInstanceExpr().getEnclosingCallable() or
90-
result = this.(ImplicitPostUpdateNode).getPreUpdateNode().getEnclosingCallableImpl()
91-
}
92-
93-
/** Gets the callable in which this node occurs. */
94-
Callable getEnclosingCallable() {
95-
result = unique(DataFlowCallable c | c = this.getEnclosingCallableImpl() | c)
91+
result = this.(ImplicitPostUpdateNode).getPreUpdateNode().getEnclosingCallable()
9692
}
9793

9894
private Type getImprovedTypeBound() {

0 commit comments

Comments
 (0)