Skip to content

Commit c010f92

Browse files
Jami CogswellJami Cogswell
authored andcommitted
simplified predicates, removed overridden getFile predicate
1 parent 6e10fcf commit c010f92

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

java/ql/lib/semmle/code/xml/AndroidManifest.qll

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ class AndroidManifestXmlFile extends XMLFile {
2222
/**
2323
* Holds if this Android manifest file is located in a build directory.
2424
*/
25-
predicate isInBuildDirectory() {
26-
exists(AndroidManifestXmlFile file |
27-
file = this.getFile() and
28-
file.getRelativePath().matches("%build%")
29-
)
30-
}
25+
predicate isInBuildDirectory() { this.getFile().getRelativePath().matches("%build%") }
3126
}
3227

3328
/**
@@ -65,19 +60,7 @@ class AndroidApplicationXmlElement extends XMLElement {
6560
/**
6661
* Holds if this application element has the attribute `android:debuggable` set to `true`.
6762
*/
68-
predicate isDebuggable() {
69-
exists(AndroidXmlAttribute attr |
70-
this.getAnAttribute() = attr and
71-
attr.getName() = "debuggable" and
72-
attr.getValue() = "true"
73-
)
74-
}
75-
76-
/**
77-
* Overrides the getFile() predicate of the XMLElement class to get the
78-
* AndroidManifest.xml file itself.
79-
*/
80-
override AndroidManifestXmlFile getFile() { result = super.getFile() }
63+
predicate isDebuggable() { this.getAttributeValue("debuggable") = "true" }
8164
}
8265

8366
/**

0 commit comments

Comments
 (0)