-
Enhancement
-
Resolution: Unresolved
-
P4
-
9
-
generic
-
generic
An explicit initialization of a volatile class instance variable, such as private volatile Object = null; or private volatile int scale = 0; is unnecessary since the Java spec automatically initializes objects to null and primitive type short, int, long, float and double to 0 and boolean to false. Explicit initialization of volatile variable to a value the same as the default implicit initialized value results in an unnecessary store and membar operation.
- relates to
-
JDK-8145948 C2: Initializing volatile fields to default values should be optimized
-
- Open
-
-
JDK-8035284 AbstractMap unnecessarily initializes two volatiles to null
-
- Resolved
-
There are no Sub-Tasks for this issue.