mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Java: Performance tweaks
This commit is contained in:
@@ -29,7 +29,7 @@ class ArchiveEntryNameMethod extends Method {
|
||||
archiveEntry.hasQualifiedName("java.util.zip", "ZipEntry") or
|
||||
archiveEntry.hasQualifiedName("org.apache.commons.compress.archivers", "ArchiveEntry")
|
||||
|
|
||||
this.getDeclaringType().getASupertype*() = archiveEntry and
|
||||
this.getDeclaringType().getAnAncestor() = archiveEntry and
|
||||
this.hasName("getName")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ private predicate alwaysReturnsTrue(HostnameVerifierVerify m) {
|
||||
*/
|
||||
class TrustAllHostnameVerifier extends RefType {
|
||||
TrustAllHostnameVerifier() {
|
||||
this.getASupertype*() instanceof HostnameVerifier and
|
||||
this.getAnAncestor() instanceof HostnameVerifier and
|
||||
exists(HostnameVerifierVerify m |
|
||||
m.getDeclaringType() = this and
|
||||
alwaysReturnsTrue(m)
|
||||
|
||||
@@ -134,7 +134,7 @@ predicate inDifferentBranches(MethodAccess ma1, MethodAccess ma2) {
|
||||
/** The method access `ma` occurs in method `runnable`, which is an implementation of `Runnable.run()`. */
|
||||
predicate inRunnable(MethodAccess ma, Method runnable) {
|
||||
runnable.getName() = "run" and
|
||||
runnable.getDeclaringType().getASupertype+().hasQualifiedName("java.lang", "Runnable") and
|
||||
runnable.getDeclaringType().getAStrictAncestor().hasQualifiedName("java.lang", "Runnable") and
|
||||
ma.getEnclosingCallable() = runnable
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user