Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
1.5
-
None
-
None
-
Windows XP
Description
Hello everyone,
A massive change in the attitude of groovy 1.5 to groovy 1.1B3
Consider the following 3 files
---------- Basis ------------------------------
Superclass sc = new Extendclass()
println sc.sayName()
-----------------------------------------------
---------- Superklasse ------------------------
class Superclass {
def sayName = {
return this.getClass().getName()
}
}
-----------------------------------------------
--------- abgeleitete Klasse ------------------
class Extendclass extends Superclass {
def sayName = {
return "Ich bin Extendclass"
}
}
-----------------------------------------------
Here are the console outputs:
==================== 1.1B3 ==========================
$groovy -v
Groovy Version: 1.1-beta-3 JVM: 1.6.0_02-b06
$groovy -cp %cd% callclass.groovy
Ich bin Extendclass
$
==================== 1.5 ==========================
$groovy -v
Groovy Version: 1.5.0 JVM: 1.6.0_02-b06
$groovy -cp %cd% callclass.groovy
Extendclass
$
Now this is really bad!
Apparently are the named Closures not overwritten!
Can anyone understand this? Or I am making a mistake?
Please see also the thread "http://www.nabble.com/Problem-by-extends-class-in-groovy-1.5-to14290776.html#a14293842 " in Nabble.
\ ^ / ili
(Wilhelm Nagy)