8263995: Incorrect double-checked locking in Types.arraySuperType()
Reviewed-by: mcimadamore, jlahoda
This commit is contained in:
parent
d7268fa3a6
commit
c087f3ed40
@ -4076,17 +4076,13 @@ public class Types {
|
||||
return buf.toList();
|
||||
}
|
||||
|
||||
private Type arraySuperType = null;
|
||||
private Type arraySuperType;
|
||||
private Type arraySuperType() {
|
||||
// initialized lazily to avoid problems during compiler startup
|
||||
if (arraySuperType == null) {
|
||||
synchronized (this) {
|
||||
if (arraySuperType == null) {
|
||||
// JLS 10.8: all arrays implement Cloneable and Serializable.
|
||||
arraySuperType = makeIntersectionType(List.of(syms.serializableType,
|
||||
syms.cloneableType), true);
|
||||
}
|
||||
}
|
||||
// JLS 10.8: all arrays implement Cloneable and Serializable.
|
||||
arraySuperType = makeIntersectionType(List.of(syms.serializableType,
|
||||
syms.cloneableType), true);
|
||||
}
|
||||
return arraySuperType;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user