jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-992

Can not set property from sub class

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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

Task - A task that needs to be done. GROOVY-754 scoping

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Kim, Pilho added a comment - 03/Aug/05 9:09 PM

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) }
}

Show
Kim, Pilho added a comment - 03/Aug/05 9:09 PM 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) } }
Hide
Permalink
blackdrag blackdrag added a comment - 19/Jan/06 7:27 PM

the scoping fix changed much bytecode. It seems this case was covered too. Fixed now

Show
blackdrag blackdrag added a comment - 19/Jan/06 7:27 PM the scoping fix changed much bytecode. It seems this case was covered too. Fixed now

People

  • Assignee:
    blackdrag blackdrag
    Reporter:
    Christof Vollrath
Vote (0)
Watch (0)

Dates

  • Created:
    27/Jul/05 4:49 PM
    Updated:
    19/Jan/06 7:27 PM
    Resolved:
    19/Jan/06 7:27 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.