mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
Java: Fix external API name for nested types
This fixes the name of reported external APIs for nested types. The `toString()` method of `getSourceDeclaration()` would report the name of a type, but not the name of the enclosing type. This results in missing information in the `UnsupportedExternalAPIs.ql` query. For example, previously it would report: ``` org.zapodot.junit.db.Builder#build() ``` However, the `Builder` class does not exist in the package and is only a nested type within `EmbeddedDatabaseRule`. The correct name should be: ``` org.zapodot.junit.db.EmbeddedDatabaseRule$Builder#build() ``` This name also matches the format of MaD.
This commit is contained in:
@@ -27,8 +27,8 @@ class ExternalApi extends Callable {
|
||||
*/
|
||||
string getApiName() {
|
||||
result =
|
||||
this.getDeclaringType().getPackage() + "." + this.getDeclaringType().getSourceDeclaration() +
|
||||
"#" + this.getName() + paramsString(this)
|
||||
this.getDeclaringType().getPackage() + "." + this.getDeclaringType().nestedName() + "#" +
|
||||
this.getName() + paramsString(this)
|
||||
}
|
||||
|
||||
private string getJarName() {
|
||||
|
||||
Reference in New Issue
Block a user