2020-12-24 17:32:25 +00:00
|
|
|
/* /nodynamiccopyright/ */
|
2020-12-08 23:04:01 +00:00
|
|
|
|
|
|
|
package java.lang;
|
|
|
|
|
|
|
|
@jdk.internal.ValueBased
|
|
|
|
public final class SomeVbc {
|
|
|
|
|
|
|
|
public SomeVbc() {}
|
|
|
|
|
|
|
|
final String ref = "String";
|
|
|
|
|
|
|
|
void abuseVbc() {
|
|
|
|
|
|
|
|
synchronized(ref) { // OK
|
|
|
|
synchronized (this) { // WARN
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
final class AuxilliaryAbuseOfVbc {
|
|
|
|
|
|
|
|
void abuseVbc(SomeVbc vbc) {
|
|
|
|
|
|
|
|
synchronized(this) { // OK
|
|
|
|
synchronized (vbc) { // WARN
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|