Improve reflective class names

This commit is contained in:
Chris Smowton
2023-10-24 13:29:32 +01:00
committed by GitHub
parent 011666b48c
commit 06238dd5f6
6 changed files with 29 additions and 29 deletions

View File

@@ -173,7 +173,7 @@ class LiveClass extends SourceClassOrInterface {
exists(NestedType r | r.getEnclosingType() = this | r instanceof LiveClass)
or
// An annotation on the class is reflectively accessed.
exists(ReflectiveAnnotationCall reflectiveAnnotationCall |
exists(ReflectiveGetAnnotationCall reflectiveAnnotationCall |
this = reflectiveAnnotationCall.getInferredClassType() and
isLive(reflectiveAnnotationCall.getEnclosingCallable())
)

View File

@@ -130,7 +130,7 @@ class JUnitAnnotatedField extends ReflectivelyReadField {
*/
class ClassReflectivelyReadField extends ReflectivelyReadField {
ClassReflectivelyReadField() {
exists(ReflectiveFieldCall fieldAccess | this = fieldAccess.inferAccessedField())
exists(ReflectiveGetFieldCall fieldAccess | this = fieldAccess.inferAccessedField())
}
}

View File

@@ -164,7 +164,7 @@ class NewInstanceCall extends EntryPoint, NewInstance {
/**
* A call to either `Class.getMethod(...)` or `Class.getDeclaredMethod(...)`.
*/
class ReflectiveMethodCallEntryPoint extends EntryPoint, ReflectiveMethodCall {
class ReflectiveGetMethodCallEntryPoint extends EntryPoint, ReflectiveGetMethodCall {
override Method getALiveCallable() {
result = this.inferAccessedMethod() and
// The `getMethod(...)` call must be used in a live context.
@@ -172,8 +172,8 @@ class ReflectiveMethodCallEntryPoint extends EntryPoint, ReflectiveMethodCall {
}
}
/** DEPRECATED: Alias for `ReflectiveMethodCallEntryPoint`. */
deprecated class ReflectiveMethodAccessEntryPoint = ReflectiveMethodCallEntryPoint;
/** DEPRECATED: Alias for `ReflectiveGetMethodCallEntryPoint`. */
deprecated class ReflectiveMethodAccessEntryPoint = ReflectiveGetMethodCallEntryPoint;
/**
* Classes that are entry points recognised by annotations.