Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-JSR-2
-
Fix Version/s: 1.0-JSR-5
-
Component/s: None
-
Labels:None
-
Environment:WinXp
Description
When I assign a value to a property of the superclass in a subclass the assignment has no affect:
class Class1 {
@Property prop
}
class Class2 extends Class1 {
void method() {
prop = "hallo" // this does not work, null is printed
// setProp("hallo") // this works
}
public static void main(String[] args) {
def class2 = new Class2()
class2.method()
println(class2.prop)
}
}
Issue Links
- is depended upon by
-
GROOVY-754
scoping
-
class Class1 {
@Property prop
}
class Class2 extends Class1 {
void method() { prop = prop // This is a workaround to access the property of super classe prop = "hallo" }
public static void main(String[] args) { def class2 = new Class2() class2.method() println(class2.prop) }
}