mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
guarded by inspections: don't fail on invalid code
EA-124454 - SIOOBE: JCiPUtil.getGuardValue
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import javax.annotation.concurrent.GuardedBy;
|
||||
|
||||
class CheapReadWriteLock {
|
||||
@GuardedBy(<error descr="Incompatible types. Found: 'int', required: 'java.lang.String'">1</error>) private volatile int value;
|
||||
|
||||
public int getValue() { return value; }
|
||||
|
||||
public synchronized int increment() {
|
||||
return value++;
|
||||
}
|
||||
}
|
||||
+4
@@ -43,6 +43,10 @@ public class FieldAccessedNotGuardedInspectionTest extends LightCodeInsightFixtu
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncompleteCode() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testStaticSyncOnClass() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user