Skip to content

Commit 45ca301

Browse files
author
Max Schaefer
committed
Rename a predicate.
1 parent ea26e21 commit 45ca301

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

java/ql/automodel/src/AutomodelFrameworkModeCharacteristics.qll

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ abstract class FrameworkModeEndpoint extends TFrameworkModeEndpoint {
8383
/**
8484
* Returns the callable that contains the endpoint.
8585
*/
86-
abstract Callable getEnclosingCallable();
86+
abstract Callable getCallable();
8787

8888
abstract Top asTop();
8989

@@ -117,7 +117,7 @@ class ExplicitParameterEndpoint extends FrameworkModeEndpoint, TExplicitParamete
117117

118118
override string getParamName() { result = param.getName() }
119119

120-
override Callable getEnclosingCallable() { result = param.getCallable() }
120+
override Callable getCallable() { result = param.getCallable() }
121121

122122
override Top asTop() { result = param }
123123

@@ -137,7 +137,7 @@ class QualifierEndpoint extends FrameworkModeEndpoint, TQualifier {
137137

138138
override string getParamName() { result = "this" }
139139

140-
override Callable getEnclosingCallable() { result = callable }
140+
override Callable getCallable() { result = callable }
141141

142142
override Top asTop() { result = callable }
143143

@@ -155,7 +155,7 @@ class ReturnValue extends FrameworkModeEndpoint, TReturnValue {
155155

156156
override string getParamName() { none() }
157157

158-
override Callable getEnclosingCallable() { result = callable }
158+
override Callable getCallable() { result = callable }
159159

160160
override Top asTop() { result = callable }
161161

@@ -174,7 +174,7 @@ class OverridableParameter extends FrameworkModeEndpoint, TOverridableParameter
174174

175175
override string getParamName() { result = param.getName() }
176176

177-
override Callable getEnclosingCallable() { result = method }
177+
override Callable getCallable() { result = method }
178178

179179
override Top asTop() { result = param }
180180

@@ -192,7 +192,7 @@ class OverridableQualifier extends FrameworkModeEndpoint, TOverridableQualifier
192192

193193
override string getParamName() { result = "this" }
194194

195-
override Callable getEnclosingCallable() { result = m }
195+
override Callable getCallable() { result = m }
196196

197197
override Top asTop() { result = m }
198198

@@ -257,8 +257,8 @@ module FrameworkCandidatesImpl implements SharedCharacteristics::CandidateSig {
257257
additional predicate sinkSpec(
258258
Endpoint e, string package, string type, string name, string signature, string ext, string input
259259
) {
260-
e.getEnclosingCallable().hasQualifiedName(package, type, name) and
261-
signature = ExternalFlow::paramsString(e.getEnclosingCallable()) and
260+
e.getCallable().hasQualifiedName(package, type, name) and
261+
signature = ExternalFlow::paramsString(e.getCallable()) and
262262
ext = "" and
263263
input = e.getMaDInput()
264264
}
@@ -267,8 +267,8 @@ module FrameworkCandidatesImpl implements SharedCharacteristics::CandidateSig {
267267
Endpoint e, string package, string type, string name, string signature, string ext,
268268
string output
269269
) {
270-
e.getEnclosingCallable().hasQualifiedName(package, type, name) and
271-
signature = ExternalFlow::paramsString(e.getEnclosingCallable()) and
270+
e.getCallable().hasQualifiedName(package, type, name) and
271+
signature = ExternalFlow::paramsString(e.getCallable()) and
272272
ext = "" and
273273
output = e.getMaDOutput()
274274
}
@@ -280,10 +280,10 @@ module FrameworkCandidatesImpl implements SharedCharacteristics::CandidateSig {
280280
*/
281281
RelatedLocation getRelatedLocation(Endpoint e, RelatedLocationType type) {
282282
type = MethodDoc() and
283-
result = e.getEnclosingCallable().(Documentable).getJavadoc()
283+
result = e.getCallable().(Documentable).getJavadoc()
284284
or
285285
type = ClassDoc() and
286-
result = e.getEnclosingCallable().getDeclaringType().(Documentable).getJavadoc()
286+
result = e.getCallable().getDeclaringType().(Documentable).getJavadoc()
287287
}
288288
}
289289

@@ -308,13 +308,13 @@ class FrameworkModeMetadataExtractor extends string {
308308
string input, string output, string parameterName
309309
) {
310310
(if exists(e.getParamName()) then parameterName = e.getParamName() else parameterName = "") and
311-
name = e.getEnclosingCallable().getName() and
311+
name = e.getCallable().getName() and
312312
(if exists(e.getMaDInput()) then input = e.getMaDInput() else input = "") and
313313
(if exists(e.getMaDOutput()) then output = e.getMaDOutput() else output = "") and
314-
package = e.getEnclosingCallable().getDeclaringType().getPackage().getName() and
315-
type = e.getEnclosingCallable().getDeclaringType().getErasure().(RefType).nestedName() and
316-
subtypes = AutomodelJavaUtil::considerSubtypes(e.getEnclosingCallable()).toString() and
317-
signature = ExternalFlow::paramsString(e.getEnclosingCallable())
314+
package = e.getCallable().getDeclaringType().getPackage().getName() and
315+
type = e.getCallable().getDeclaringType().getErasure().(RefType).nestedName() and
316+
subtypes = AutomodelJavaUtil::considerSubtypes(e.getCallable()).toString() and
317+
signature = ExternalFlow::paramsString(e.getCallable())
318318
}
319319
}
320320

@@ -336,8 +336,8 @@ private class UnexploitableIsCharacteristic extends CharacteristicsImpl::Neither
336336
UnexploitableIsCharacteristic() { this = "unexploitable (is-style boolean method)" }
337337

338338
override predicate appliesToEndpoint(Endpoint e) {
339-
e.getEnclosingCallable().getName().matches("is%") and
340-
e.getEnclosingCallable().getReturnType() instanceof BooleanType and
339+
e.getCallable().getName().matches("is%") and
340+
e.getCallable().getReturnType() instanceof BooleanType and
341341
(
342342
e.getExtensibleType() = "sinkModel" and
343343
not FrameworkCandidatesImpl::isSink(e, _, _)
@@ -362,11 +362,11 @@ private class UnexploitableExistsCharacteristic extends CharacteristicsImpl::Nei
362362

363363
override predicate appliesToEndpoint(Endpoint e) {
364364
exists(Callable callable |
365-
callable = e.getEnclosingCallable() and
365+
callable = e.getCallable() and
366366
callable.getName().toLowerCase() = ["exists", "notexists"] and
367367
callable.getReturnType() instanceof BooleanType
368368
|
369-
e.getExtensibleType() = "sourceModel" and
369+
e.getExtensibleType() = "sinkModel" and
370370
not FrameworkCandidatesImpl::isSink(e, _, _)
371371
or
372372
e.getExtensibleType() = "sourceModel" and
@@ -384,7 +384,7 @@ private class ExceptionCharacteristic extends CharacteristicsImpl::NeitherSource
384384
ExceptionCharacteristic() { this = "exception" }
385385

386386
override predicate appliesToEndpoint(Endpoint e) {
387-
e.getEnclosingCallable().getDeclaringType().getASupertype*() instanceof TypeThrowable and
387+
e.getCallable().getDeclaringType().getASupertype*() instanceof TypeThrowable and
388388
(
389389
e.getExtensibleType() = "sinkModel" and
390390
not FrameworkCandidatesImpl::isSink(e, _, _)
@@ -405,6 +405,6 @@ private class NotAModelApi extends CharacteristicsImpl::UninterestingToModelChar
405405
NotAModelApi() { this = "not a model API" }
406406

407407
override predicate appliesToEndpoint(Endpoint e) {
408-
not e.getEnclosingCallable() instanceof ModelExclusions::ModelApi
408+
not e.getCallable() instanceof ModelExclusions::ModelApi
409409
}
410410
}

0 commit comments

Comments
 (0)