Skip to content

Commit 650ff8d

Browse files
author
Stephan Brandauer
committed
Java: automodel comments
1 parent 0781cb7 commit 650ff8d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

java/ql/src/Telemetry/AutomodelApplicationModeCharacteristics.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ newtype TApplicationModeEndpoint =
3333
idx = min(Argument arg, int n | arg = call.getArgument(n) and arg.isVararg() | n)
3434
}
3535

36+
/**
37+
* An endpoint is a node that is a candidate for modeling.
38+
*/
3639
abstract private class ApplicationModeEndpoint extends TApplicationModeEndpoint {
3740
abstract predicate isArgOf(Call c, int idx);
3841

@@ -82,6 +85,15 @@ class InstanceArgument extends ApplicationModeEndpoint, TInstanceArgument {
8285
override string toString() { result = arg.toString() }
8386
}
8487

88+
/**
89+
* An endpoint that represents an implicit varargs array.
90+
* We choose to represent the varargs array as a single endpoint, rather than as multiple endpoints.
91+
*
92+
* This avoids the problem of having to deal with redundant endpoints downstream.
93+
*
94+
* In order to be able to distinguish between varargs endpoints and regular endpoints, we export the `isVarargsArray`
95+
* meta data field in the extraction queries.
96+
*/
8597
class ImplicitVarargsArray extends ApplicationModeEndpoint, TImplicitVarargsArray {
8698
Call call;
8799
DataFlow::ImplicitVarargsArray varargs;

0 commit comments

Comments
 (0)