Skip to content

Commit ee83ca9

Browse files
michaelnebelMathiasVP
authored andcommitted
Java: Update model generator implementation and test expected output.
1 parent 09dc3c8 commit ee83ca9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

java/ql/src/utils/modelgenerator/internal/CaptureModels.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module ModelGeneratorCommonInput implements ModelGeneratorCommonInputSig<Locatio
9292

9393
string qualifierString() { result = "Argument[this]" }
9494

95-
string parameterAccess(J::Parameter p) {
95+
string parameterApproximateAccess(J::Parameter p) {
9696
if
9797
p.getType() instanceof J::Array and
9898
not isPrimitiveTypeUsedForBulkData(p.getType().(J::Array).getElementType())
@@ -103,20 +103,20 @@ module ModelGeneratorCommonInput implements ModelGeneratorCommonInputSig<Locatio
103103
else result = "Argument[" + p.getPosition() + "]"
104104
}
105105

106-
string parameterContentAccess(J::Parameter p) { result = "Argument[" + p.getPosition() + "]" }
106+
string parameterExactAccess(J::Parameter p) { result = "Argument[" + p.getPosition() + "]" }
107107

108108
class InstanceParameterNode = DataFlow::InstanceParameterNode;
109109

110110
bindingset[c]
111-
string paramReturnNodeAsOutput(Callable c, ParameterPosition pos) {
112-
result = parameterAccess(c.getParameter(pos))
111+
string paramReturnNodeAsApproximateOutput(Callable c, ParameterPosition pos) {
112+
result = parameterApproximateAccess(c.getParameter(pos))
113113
or
114114
result = qualifierString() and pos = -1
115115
}
116116

117117
bindingset[c]
118-
string paramReturnNodeAsContentOutput(Callable c, ParameterPosition pos) {
119-
result = parameterContentAccess(c.getParameter(pos))
118+
string paramReturnNodeAsExactOutput(Callable c, ParameterPosition pos) {
119+
result = parameterExactAccess(c.getParameter(pos))
120120
or
121121
result = qualifierString() and pos = -1
122122
}

java/ql/test/utils/modelgenerator/dataflow/p/Sources.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public InputStream wrappedSocketStream() throws IOException {
4040
return socketStream();
4141
}
4242

43-
// source=p;Sources;true;sourceToParameter;(InputStream[],List);;Argument[0].ArrayElement;remote;df-generated
44-
// source=p;Sources;true;sourceToParameter;(InputStream[],List);;Argument[1].Element;remote;df-generated
43+
// source=p;Sources;true;sourceToParameter;(InputStream[],List);;Argument[0];remote;df-generated
44+
// source=p;Sources;true;sourceToParameter;(InputStream[],List);;Argument[1];remote;df-generated
4545
// neutral=p;Sources;sourceToParameter;(InputStream[],List);summary;df-generated
4646
public void sourceToParameter(InputStream[] streams, List<InputStream> otherStreams)
4747
throws IOException {

0 commit comments

Comments
 (0)