It is true that C# improved this. Separating primitives and references in Java was definitely an error and it cannot be fixed at this point.
The good news is that a linter trivially detects this bug.
The good news is that a linter trivially detects this bug.