mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
java: rewrite conflict detection
- favour unary predicates over binary ones (the natural "conflicting access" is binary) - switch to a dual solution to trade recursion through forall for simple existentials. Co-authored-by: Anders Schack-Mulligen <aschackmull@github.com>
This commit is contained in:
@@ -40,7 +40,7 @@ public class Test {
|
||||
*/
|
||||
public void setYCorrect(int y) {
|
||||
lock.lock();
|
||||
this.y = y; // $ Alert
|
||||
this.y = y;
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class Test {
|
||||
* @param y
|
||||
*/
|
||||
private void setYPrivate(int y) {
|
||||
this.y = y;
|
||||
this.y = y; // $ Alert
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,7 +57,7 @@ public class Test {
|
||||
* @param y
|
||||
*/
|
||||
public void setYWrongLock(int y) {
|
||||
this.y = y;
|
||||
this.y = y; // $ Alert
|
||||
lock.lock();
|
||||
lock.unlock();
|
||||
}
|
||||
@@ -71,6 +71,6 @@ public class Test {
|
||||
}
|
||||
|
||||
public void testMethod() {
|
||||
this.y = y + 2;
|
||||
this.y = y + 2; // $ Alert
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user