mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 00:20:54 +07:00
34 lines
1.0 KiB
Java
34 lines
1.0 KiB
Java
import valuebased.classes.OpenValueBased;
|
|
class One extends OpenValueBased { }
|
|
class Two extends One { }
|
|
class Three extends Two { }
|
|
class ComplexVBHierarchy extends Three { }
|
|
|
|
class Main {
|
|
final ComplexVBHierarchy vb = new ComplexVBHierarchy();
|
|
{
|
|
final ComplexVBHierarchy localVb = new ComplexVBHierarchy();
|
|
final Object objectVb = new ComplexVBHierarchy();
|
|
|
|
synchronized (<warning descr="Synchronization on instance of value-based class">vb</warning>) {}
|
|
synchronized (<warning descr="Synchronization on instance of value-based class">localVb</warning>) {}
|
|
synchronized (<warning descr="Synchronization on instance of value-based class">objectVb</warning>) {}
|
|
synchronized (ComplexVBHierarchy.class) {}
|
|
f(vb);
|
|
g(vb);
|
|
}
|
|
|
|
void f(ComplexVBHierarchy vb) {
|
|
synchronized (<warning descr="Synchronization on instance of value-based class">vb</warning>) {}
|
|
}
|
|
|
|
void g(Object vb) {
|
|
synchronized (vb) {}
|
|
}
|
|
|
|
@SuppressWarnings("synchronization")
|
|
void h(ComplexVBHierarchy vb) {
|
|
synchronized (vb) {}
|
|
}
|
|
}
|