Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 1.5.4
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:linux
-
Testcase included:yes
-
Patch Submitted:Yes
-
Number of attachments :
Description
This is best shown by a small example. I've attached a trivial patch as well.
class A {
String toString()
}
A.metaClass.toString = { ->
"changed";
}
def a = new A();
println a.toString();
println "$
";
brandon@Brandon:~/localtmp/groovy-1.5.4$ unset GROOVY_HOME
brandon@Brandon:~/localtmp/groovy-1.5.4$ groovy-unpatched test.groovy
changed
unchanged
brandon@Brandon:~/localtmp/groovy-1.5.4$ groovy test.groovy
changed
changed
Issue Links
- duplicates
-
GROOVY-2599
unable to overwritel toString() via MOP in some cases
-