Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.5
-
Fix Version/s: 1.6-beta-1, 1.5.7
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
From GROOVY-1875:
def s = '12'
s.value = 'ABCD'
println s
==>
AB
The 'value' field is a private final variable in class java.lang.String.
Therfore Groovy makes String mutable!
It's crazy world that it's come to this point. I wonder if the fact that this would be possible occurred to any of the groovy developers as groovy was being written, or if this is an innocent mistake. If it occurred to someone pre-release... I'd love to see the discussion on the matter on why on earth this should be permitted.