Use nestedName for getting the name of an API

This changes the Java `CallableMethod.getApiName()` to use `nestedName`
instead of `getSourceDeclaration`. `getSourceDeclaration` would return a
`RefType`, on which the `toString()` method returns its `getName`().
However, for nested types this wouldn't work and wouldn't include the
enclosing type. This fixes it by using `nestedName` which matches the
method that is also used for determining whether a type matches an
extensible predicate.
This commit is contained in:
Koen Vlaswinkel
2023-06-27 14:38:19 +02:00
parent bd0e5604a8
commit a053792d6e

View File

@@ -81,7 +81,7 @@ class CallableMethod extends Method {
*/
string getApiName() {
result =
this.getDeclaringType().getPackage() + "." + this.getDeclaringType().getSourceDeclaration() +
this.getDeclaringType().getPackage() + "." + this.getDeclaringType().nestedName() +
"#" + this.getName() + paramsString(this)
}