Issue1241

classification
Title: Assignment to static variable shadows value
Type: behaviour Severity: major
Components: Core Versions: 2.5b1
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: cgroves Nosy List: cgroves, nriley
Priority: Keywords:

Created on 2009-01-18.06:37:45 by nriley, last changed 2009-01-26.03:10:59 by cgroves.

Messages
msg4057 (view) Author: Nicholas Riley (nriley) Date: 2009-01-18.06:37:44
public class Test {

    public static int get_x() {
        return x;
    }
    
    public static void set_x(int new_x) {
        x = new_x;
    }

    public static int x = 0;
}

Jython 2.5b1+ (trunk:5944, Jan 18 2009, 00:35:11) 
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_07
Type "help", "copyright", "credits" or "license" for more information.
>>> import Test
>>> Test.x
0
>>> Test.set_x(3)
>>> Test.x
3
>>> Test.x = 5
>>> Test.x
5
>>> Test.get_x()
3

This worked fine in r5735, before the newstyle-java-types branch was merged.
msg4080 (view) Author: Charlie Groves (cgroves) Date: 2009-01-26.03:10:59
Fixed in r5982!
History
Date User Action Args
2009-01-26 03:10:59cgrovessetstatus: open -> closed
resolution: fixed
messages: + msg4080
2009-01-18 06:37:45nrileycreate