mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Rename companion object QL class
This commit is contained in:
@@ -711,15 +711,11 @@ class ClassObject extends Class {
|
||||
}
|
||||
|
||||
/** A Kotlin `companion object`. */
|
||||
class ClassCompanionObject extends Class {
|
||||
ClassCompanionObject() {
|
||||
type_companion_object(_, _, this)
|
||||
}
|
||||
class CompanionObject extends Class {
|
||||
CompanionObject() { type_companion_object(_, _, this) }
|
||||
|
||||
/** Gets the instance variable that implements this `companion object`. */
|
||||
Field getInstance() {
|
||||
type_companion_object(_, result, this)
|
||||
}
|
||||
Field getInstance() { type_companion_object(_, result, this) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -961,7 +957,7 @@ class ClassOrInterface extends RefType, @classorinterface {
|
||||
predicate isSealed() { exists(this.getAPermittedSubtype()) }
|
||||
|
||||
/** Get the companion object of this class or interface, if any. */
|
||||
ClassCompanionObject getCompanionObject() { type_companion_object(this, _, result) }
|
||||
CompanionObject getCompanionObject() { type_companion_object(this, _, result) }
|
||||
}
|
||||
|
||||
private string getAPublicObjectMethodSignature() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import java
|
||||
|
||||
from VarAccess va, ClassCompanionObject cco
|
||||
from VarAccess va, CompanionObject cco
|
||||
where va.getVariable() = cco.getInstance()
|
||||
select cco, va
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import java
|
||||
|
||||
from ClassOrInterface c, ClassCompanionObject cco, Field f
|
||||
where c.fromSource()
|
||||
and cco = c.getCompanionObject()
|
||||
and f = cco.getInstance()
|
||||
from ClassOrInterface c, CompanionObject cco, Field f
|
||||
where
|
||||
c.fromSource() and
|
||||
cco = c.getCompanionObject() and
|
||||
f = cco.getInstance()
|
||||
select c, f, cco, concat(f.getAModifier().toString(), ",")
|
||||
|
||||
Reference in New Issue
Block a user