Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-4
-
None
-
None
-
Linux with JDK 1.5.0
Description
Run the following Groovy program. The instance variable "success" changes value between the end of the second constructor and the end of the first constructor. This program works as expected in Java.
class Pinger {
boolean success
Pinger(String destHost) {
this(destHost, 1, 100)
println "at end of little constructor, success is type ${success.class} a\
nd value ${success}"
}
Pinger(String destHost, int in_n, int in_hops) {
success = true
println "at end of constructor, success is type ${success.class} and valu\
e ${success}"
}
}
Pinger p = new Pinger("www.yahoo.com")
println "Success is ${p.success}"