If the type of the right-hand operand of a compound assignment is not assignment compatible with the type of the variable, a cast is implied and possible lossy conversion may occur.
While this is convenient coding pattern, for formal classes it is a poor programming practice and it should be addressed in JDK.
This is an umbrella issue and it is expected to contain more specific sub-tasks and relate with other issues addressing "possibly lossy conversion in compound assignments" in various JDK sub-components.
While this is convenient coding pattern, for formal classes it is a poor programming practice and it should be addressed in JDK.
This is an umbrella issue and it is expected to contain more specific sub-tasks and relate with other issues addressing "possibly lossy conversion in compound assignments" in various JDK sub-components.
- relates to
-
JDK-8244681 Add a warning for possibly lossy conversion in compound assignments
- Resolved