mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
35 lines
965 B
Plaintext
35 lines
965 B
Plaintext
/**
|
|
* Provides classes and predicates for working with the Apache Thrift framework.
|
|
*/
|
|
|
|
import java
|
|
|
|
/**
|
|
* A file detected as generated by the Apache Thrift Compiler.
|
|
*/
|
|
class ThriftGeneratedFile extends GeneratedFile {
|
|
ThriftGeneratedFile() {
|
|
exists(JavadocElement t | t.getFile() = this |
|
|
exists(string msg | msg = t.getText() | msg.regexpMatch("(?i).*\\bAutogenerated by Thrift.*"))
|
|
)
|
|
}
|
|
}
|
|
|
|
/**
|
|
* A Thrift `Iface` interface in a class generated by the Apache Thrift Compiler.
|
|
*/
|
|
class ThriftIface extends Interface {
|
|
ThriftIface() {
|
|
this.hasName("Iface") and
|
|
this.getEnclosingType() instanceof TopLevelType and
|
|
this.getFile() instanceof ThriftGeneratedFile
|
|
}
|
|
|
|
/** Gets an implementation of a method of this interface. */
|
|
Method getAnImplementingMethod() {
|
|
result.getDeclaringType().(Class).getAStrictAncestor() = this and
|
|
result.overrides+(this.getAMethod()) and
|
|
not result.getFile() = this.getFile()
|
|
}
|
|
}
|