char[] is not an immutable class. Thread safety issue happens on that type, not the fault of String type.
It is weird Java considered it a bug, I expect it to be resolved as "wont do"
It is weird Java considered it a bug, I expect it to be resolved as "wont do"
I might tell you about another "bug" and "invariant violation" which is possible but is not a bug. Try to use Sets or Maps with keys having broken hashcode.
Is it good that this can happen? No, Java must be more like Scala and push immutability as sane default.
Is it a bug? No.
Is it possible to "fix" the language and the VM at this stage? Yes, but that would be a new language and new VM. So, that's not going to happen.
But it's specified that standard Java classes are thread unsafe by default. So this is a specified behaviour.