Java 12: tweak queries to preserve behavior

This accounts for the changes in af8faee1.
This commit is contained in:
yh-semmle
2019-04-26 08:52:46 -04:00
parent de47f25141
commit 6d59b4e049
2 changed files with 6 additions and 4 deletions

View File

@@ -13,10 +13,10 @@
import java
/** A `synchronized` method or statement. */
class Synched extends StmtParent {
/** A `synchronized` method body or statement. */
class Synched extends Stmt {
Synched() {
this.(Method).isSynchronized() or
this.getParent().(Method).isSynchronized() or
this instanceof SynchronizedStmt
}
}

View File

@@ -46,7 +46,9 @@ class Synched extends Top {
or
result = this.(SynchronizedStmt).getAChild+()
or
exists(MethodAccess ma | ma = result | ma.getEnclosingStmt().getEnclosingStmt*() = this)
exists(MethodAccess ma | ma = result |
ma.getEnclosingStmt().getEnclosingStmt*() = this or ma.getEnclosingCallable() = this
)
}
/** The variable on which synchronization is performed, provided this element is a `SynchronizedStmt`. */