Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 747ab12

Browse files
author
Benjamin Muskalla
committed
Restrict fluent api models to same type access
1 parent 8564c90 commit 747ab12

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

java/ql/src/utils/model-generator/CaptureSummaryModels.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ string captureFlow(Callable api) {
2222
string captureQualifierFlow(Callable api) {
2323
exists(ReturnStmt rtn |
2424
rtn.getEnclosingCallable() = api and
25-
rtn.getResult() instanceof ThisAccess
25+
rtn.getResult().(ThisAccess).isOwnInstanceAccess()
2626
) and
2727
result = asValueModel(api, "Argument[-1]", "ReturnValue")
2828
}

java/ql/test/utils/model-generator/p/FluentAPI.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@ public FluentAPI returnsThis(String input) {
66
return this;
77
}
88

9+
public class Inner {
10+
public FluentAPI notThis(String input) {
11+
return FluentAPI.this;
12+
}
13+
}
14+
915
}

0 commit comments

Comments
 (0)