Skip to content

Commit 2c20ec4

Browse files
committed
Java: Drive-by: fix oversight in #13823
In PR #13823, we had rewritten the endpoints that are being considered for framework mode. We used to use `DataFlow::ParameterNode` as endpoints. However, `ParameterNode`s do not exist for the implicit `this` parameter; they also do not exist for bodiless interface-methods. In PR #13823, we forgot to model that `this` only exists for non-static methods and to only consider parameters that we have source code for.
1 parent 279b36f commit 2c20ec4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/ql/src/Telemetry/AutomodelFrameworkModeCharacteristics.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ abstract class FrameworkModeEndpoint extends TFrameworkModeEndpoint {
5656
class ExplicitParameterEndpoint extends FrameworkModeEndpoint, TExplicitParameter {
5757
Parameter param;
5858

59-
ExplicitParameterEndpoint() { this = TExplicitParameter(param) }
59+
ExplicitParameterEndpoint() { this = TExplicitParameter(param) and param.fromSource() }
6060

6161
override int getIndex() { result = param.getPosition() }
6262

@@ -70,7 +70,7 @@ class ExplicitParameterEndpoint extends FrameworkModeEndpoint, TExplicitParamete
7070
class QualifierEndpoint extends FrameworkModeEndpoint, TQualifier {
7171
Callable callable;
7272

73-
QualifierEndpoint() { this = TQualifier(callable) }
73+
QualifierEndpoint() { this = TQualifier(callable) and not callable.isStatic() and callable.fromSource() }
7474

7575
override int getIndex() { result = -1 }
7676

0 commit comments

Comments
 (0)