Skip to content

Commit 59a49ee

Browse files
authored
Add aliases for public, importable renamed classes and predicates.
Also rename and aliases a couple of uses of Access noted along the way.
1 parent f552a15 commit 59a49ee

20 files changed

+93
-19
lines changed

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,13 +1933,19 @@ class MethodCall extends Expr, Call, @methodaccess {
19331933
*/
19341934
predicate isOwnMethodCall() { Qualifier::ownMemberAccess(this) }
19351935

1936+
/** DEPRECATED: Alias for `isOwnMethodCall`. */
1937+
deprecated predicate isOwnMethodAccess() { this.isOwnMethodCall() }
1938+
19361939
/**
19371940
* Holds if this is a method access to an instance method of the enclosing
19381941
* class `t`. That is, the qualifier is either an explicit or implicit
19391942
* `t`-qualified `this` or `super`.
19401943
*/
19411944
predicate isEnclosingMethodCall(RefType t) { Qualifier::enclosingMemberAccess(this, t) }
19421945

1946+
/** DEPRECATED: Alias for `isEnclosingMethodCall`. */
1947+
deprecated predicate isEnclosingMethodAccess() { this.isEnclosingMethodCall() }
1948+
19431949
override string getAPrimaryQlClass() { result = "MethodCall" }
19441950
}
19451951

java/ql/lib/semmle/code/java/JDK.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ class MethodCallSystemGetProperty extends MethodCall {
276276
}
277277
}
278278

279+
/** DEPRECATED: Alias for `MethodCallSystemGetProperty`. */
280+
deprecated class MethodAccessSystemGetProperty = MethodCallSystemGetProperty;
281+
279282
/**
280283
* Any method named `exit` on class `java.lang.Runtime` or `java.lang.System`.
281284
*/

java/ql/lib/semmle/code/java/Reflection.qll

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ class ReflectiveClassIdentifierMethodCall extends ReflectiveClassIdentifier, Met
8383
}
8484
}
8585

86+
/** DEPRECATED: Alias for `ReflectiveClassIdentifierMethodCall`. */
87+
deprecated class ReflectiveClassIdentifierMethodAccess = ReflectiveClassIdentifierMethodCall;
88+
8689
/**
8790
* Gets a `ReflectiveClassIdentifier` that we believe may represent the value of `expr`.
8891
*/
@@ -317,26 +320,35 @@ class ClassMethodCall extends MethodCall {
317320
}
318321
}
319322

323+
/** DEPRECATED: Alias for `ClassMethodCall`. */
324+
deprecated class ClassMethodAccess = ClassMethodCall;
325+
320326
/**
321327
* A call to `Class.getConstructors(..)` or `Class.getDeclaredConstructors(..)`.
322328
*/
323-
class ReflectiveConstructorsAccess extends ClassMethodCall {
324-
ReflectiveConstructorsAccess() {
329+
class ReflectiveConstructorsCall extends ClassMethodCall {
330+
ReflectiveConstructorsCall() {
325331
this.getCallee().hasName("getConstructors") or
326332
this.getCallee().hasName("getDeclaredConstructors")
327333
}
328334
}
329335

336+
/** DEPRECATED: Alias for `ReflectiveConstructorsCall`. */
337+
deprecated class ReflectiveConstructorsAccess = ReflectiveConstructorsCall;
338+
330339
/**
331340
* A call to `Class.getMethods(..)` or `Class.getDeclaredMethods(..)`.
332341
*/
333-
class ReflectiveMethodsAccess extends ClassMethodCall {
334-
ReflectiveMethodsAccess() {
342+
class ReflectiveMethodsCall extends ClassMethodCall {
343+
ReflectiveMethodsCall() {
335344
this.getCallee().hasName("getMethods") or
336345
this.getCallee().hasName("getDeclaredMethods")
337346
}
338347
}
339348

349+
/** DEPRECATED: Alias for `ReflectiveMethodsCall`. */
350+
deprecated class ReflectiveMethodsAccess = ReflectiveMethodsCall;
351+
340352
/**
341353
* A call to `Class.getMethod(..)` or `Class.getDeclaredMethod(..)`.
342354
*/
@@ -366,11 +378,14 @@ class ReflectiveMethodCall extends ClassMethodCall {
366378
}
367379
}
368380

381+
/** DEPRECATED: Alias for `ReflectiveMethodCall`. */
382+
deprecated class ReflectiveMethodAccess = ReflectiveMethodCall;
383+
369384
/**
370385
* A call to `Class.getAnnotation(..)`.
371386
*/
372-
class ReflectiveAnnotationAccess extends ClassMethodCall {
373-
ReflectiveAnnotationAccess() { this.getCallee().hasName("getAnnotation") }
387+
class ReflectiveAnnotationCall extends ClassMethodCall {
388+
ReflectiveAnnotationCall() { this.getCallee().hasName("getAnnotation") }
374389

375390
/**
376391
* Gets a possible annotation type for this reflective annotation access.
@@ -380,11 +395,14 @@ class ReflectiveAnnotationAccess extends ClassMethodCall {
380395
}
381396
}
382397

398+
/** DEPRECATED: Alias for `ReflectiveAnnotationCall`. */
399+
deprecated class ReflectiveAnnotationAccess = ReflectiveAnnotationCall;
400+
383401
/**
384402
* A call to `Class.getField(..)` that accesses a field.
385403
*/
386-
class ReflectiveFieldAccess extends ClassMethodCall {
387-
ReflectiveFieldAccess() {
404+
class ReflectiveFieldCall extends ClassMethodCall {
405+
ReflectiveFieldCall() {
388406
this.getCallee().hasName("getField") or
389407
this.getCallee().hasName("getDeclaredField")
390408
}
@@ -405,3 +423,6 @@ class ReflectiveFieldAccess extends ClassMethodCall {
405423
result.hasName(this.getArgument(0).(StringLiteral).getValue())
406424
}
407425
}
426+
427+
/** DEPRECATED: Alias for `ReflectiveFieldCall`. */
428+
deprecated class ReflectiveFieldAccess = ReflectiveFieldCall;

java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,11 @@ class ObjectOutputStreamVar extends LocalVariableDecl {
464464
result.getQualifier() = this.getAnAccess() and
465465
result.getMethod().hasName("writeObject")
466466
}
467+
468+
/** DEPRECATED: Alias for `getAWriteObjectMethodCall`. */
469+
deprecated MethodCall getAWriteObjectMethodAccess() {
470+
result = this.getAWriteObjectMethodCall()
471+
}
467472
}
468473

469474
/** Flow through string formatting. */

java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private module Impl {
267267

268268
/** Holds if `f` can have any sign. */
269269
predicate fieldWithUnknownSign(Field f) {
270-
exists(ReflectiveFieldAccess rfa | rfa.inferAccessedField() = f)
270+
exists(ReflectiveFieldCall rfa | rfa.inferAccessedField() = f)
271271
}
272272

273273
/** Holds if `f` is accessed in an increment operation. */

java/ql/lib/semmle/code/java/deadcode/DeadCode.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ class LiveClass extends SourceClassOrInterface {
173173
exists(NestedType r | r.getEnclosingType() = this | r instanceof LiveClass)
174174
or
175175
// An annotation on the class is reflectively accessed.
176-
exists(ReflectiveAnnotationAccess reflectiveAnnotationAccess |
177-
this = reflectiveAnnotationAccess.getInferredClassType() and
178-
isLive(reflectiveAnnotationAccess.getEnclosingCallable())
176+
exists(ReflectiveAnnotationCall reflectiveAnnotationCall |
177+
this = reflectiveAnnotationCall.getInferredClassType() and
178+
isLive(reflectiveAnnotationCall.getEnclosingCallable())
179179
)
180180
or
181181
this instanceof AnonymousClass

java/ql/lib/semmle/code/java/deadcode/DeadField.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class JUnitAnnotatedField extends ReflectivelyReadField {
130130
*/
131131
class ClassReflectivelyReadField extends ReflectivelyReadField {
132132
ClassReflectivelyReadField() {
133-
exists(ReflectiveFieldAccess fieldAccess | this = fieldAccess.inferAccessedField())
133+
exists(ReflectiveFieldCall fieldAccess | this = fieldAccess.inferAccessedField())
134134
}
135135
}
136136

java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ class ReflectiveMethodCallEntryPoint extends EntryPoint, ReflectiveMethodCall {
172172
}
173173
}
174174

175+
/** DEPRECATED: Alias for `ReflectiveMethodCallEntryPoint`. */
176+
deprecated class ReflectiveMethodAccessEntryPoint = ReflectiveMethodCallEntryPoint;
177+
175178
/**
176179
* Classes that are entry points recognised by annotations.
177180
*/

java/ql/lib/semmle/code/java/frameworks/Mockito.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class MockitoVerifiedMethodCall extends MethodCall {
2525
}
2626
}
2727

28+
/** DEPRECATED: Alias for `MockitoVerifiedMethodCall`. */
29+
deprecated class MockitoVerifiedMethodAccess = MockitoVerifiedMethodCall;
30+
2831
/**
2932
* A type that can be mocked by Mockito.
3033
*/

java/ql/lib/semmle/code/java/security/CleartextStorageAndroidDatabaseQuery.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ class LocalDatabaseOpenMethodCall extends Storable, Call {
4343
}
4444
}
4545

46+
/** DEPRECATED: Alias for `LocalDatabaseOpenMethodCall`. */
47+
deprecated class LocalDatabaseOpenMethodAccess = LocalDatabaseOpenMethodCall;
48+
4649
/** A method that is both a database input and a database store. */
4750
private class LocalDatabaseInputStoreMethod extends Method {
4851
LocalDatabaseInputStoreMethod() {

0 commit comments

Comments
 (0)