Java: Add pragma[only_bind_out] to Top::toString() calls

This commit is contained in:
Chuan-kai Lin
2023-05-04 11:46:35 -07:00
parent e42bf2efd8
commit d968cee2c4
4 changed files with 19 additions and 9 deletions

View File

@@ -27,7 +27,9 @@ class ImportType extends Import {
/** Gets the imported type. */
ClassOrInterface getImportedType() { imports(this, result, _, _) }
override string toString() { result = "import " + this.getImportedType().toString() }
override string toString() {
result = "import " + pragma[only_bind_out](this.getImportedType()).toString()
}
override string getAPrimaryQlClass() { result = "ImportType" }
}
@@ -49,7 +51,9 @@ class ImportOnDemandFromType extends Import {
/** Gets an imported type. */
NestedType getAnImport() { result.getEnclosingType() = this.getTypeHoldingImport() }
override string toString() { result = "import " + this.getTypeHoldingImport().toString() + ".*" }
override string toString() {
result = "import " + pragma[only_bind_out](this.getTypeHoldingImport()).toString() + ".*"
}
override string getAPrimaryQlClass() { result = "ImportOnDemandFromType" }
}
@@ -71,7 +75,7 @@ class ImportOnDemandFromPackage extends Import {
/** Gets a printable representation of this import declaration. */
override string toString() {
result = "import " + this.getPackageHoldingImport().toString() + ".*"
result = "import " + pragma[only_bind_out](this.getPackageHoldingImport()).toString() + ".*"
}
override string getAPrimaryQlClass() { result = "ImportOnDemandFromPackage" }
@@ -100,7 +104,7 @@ class ImportStaticOnDemand extends Import {
/** Gets a printable representation of this import declaration. */
override string toString() {
result = "import static " + this.getTypeHoldingImport().toString() + ".*"
result = "import static " + pragma[only_bind_out](this.getTypeHoldingImport()).toString() + ".*"
}
override string getAPrimaryQlClass() { result = "ImportStaticOnDemand" }
@@ -141,7 +145,9 @@ class ImportStaticTypeMember extends Import {
/** Gets a printable representation of this import declaration. */
override string toString() {
result = "import static " + this.getTypeHoldingImport().toString() + "." + this.getName()
result =
"import static " + pragma[only_bind_out](this.getTypeHoldingImport()).toString() + "." +
this.getName()
}
override string getAPrimaryQlClass() { result = "ImportStaticTypeMember" }