Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/valuebased/ExtendValueBasedClass.java
Bas Leijdekkers 2b32d9bb56 Java: basic support for Valhalla Value Classes (IDEA-364548)
GitOrigin-RevId: 93b0394866aae35772ccc90e7de822af8a94c6ce
2024-12-18 18:05:29 +00:00

33 lines
858 B
Java

import valuebased.classes.AbstractValueBased;
class AC extends AbstractValueBased {
final AC ac = new AC();
final Object objectAc = new AC();
{
final AC localAc = new AC();
synchronized (<warning descr="Synchronization on instance of value-based class">ac</warning>) {}
synchronized (<warning descr="Synchronization on instance of value-based class">objectAc</warning>) {}
synchronized (<warning descr="Synchronization on instance of value-based class">localAc</warning>) {}
synchronized (AC.class) {}
synchronized (new Object()) {}
f(ac);
g(ac);
}
void f(AC ac) {
synchronized (<warning descr="Synchronization on instance of value-based class">ac</warning>) {}
}
void g(Object ac) {
synchronized (ac) {}
}
@SuppressWarnings("synchronization")
void h(AC ac) {
synchronized (ac) {}
}
}