mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
Merge pull request #5645 from Marcono1234/marcono1234/primary-ql-class
Java: Override getAPrimaryQlClass() for more classes
This commit is contained in:
@@ -159,6 +159,8 @@ class Folder extends Container, @folder {
|
||||
|
||||
/** Gets the URL of this folder. */
|
||||
override string getURL() { result = "folder://" + getAbsolutePath() }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Folder" }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,6 +173,8 @@ class File extends Container, @file {
|
||||
|
||||
/** Gets the URL of this file. */
|
||||
override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "File" }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -204,4 +208,6 @@ class JarFile extends File {
|
||||
string getManifestEntryAttribute(string entry, string key) {
|
||||
jarManifestEntries(this, entry, key, result)
|
||||
}
|
||||
|
||||
override string getAPrimaryQlClass() { result = "JarFile" }
|
||||
}
|
||||
|
||||
@@ -27,4 +27,6 @@ class Exception extends Element, @exception {
|
||||
override predicate hasName(string name) { this.getType().hasName(name) }
|
||||
|
||||
override string toString() { result = this.getType().toString() }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Exception" }
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import Element
|
||||
class Modifier extends Element, @modifier {
|
||||
/** Gets the element to which this modifier applies. */
|
||||
Element getElement() { hasModifier(result, this) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Modifier" }
|
||||
}
|
||||
|
||||
/** An element of the Java syntax tree that may have a modifier. */
|
||||
|
||||
@@ -29,4 +29,6 @@ class Package extends Element, Annotatable, @package {
|
||||
* since packages do not have locations.
|
||||
*/
|
||||
string getURL() { result = "file://:0:0:0:0" }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Package" }
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ class LocalVariableDecl extends @localvar, LocalScopeVariable {
|
||||
|
||||
/** Gets the initializer expression of this local variable declaration. */
|
||||
override Expr getInitializer() { result = getDeclExpr().getInit() }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "LocalVariableDecl" }
|
||||
}
|
||||
|
||||
/** A formal parameter of a callable. */
|
||||
|
||||
Reference in New Issue
Block a user