Menu

#776 private variables accessible from interactions pane

4: Serious
closed-duplicate
nobody
5
2009-10-16
2009-08-06
No

I am a big fan of DrJava. I am an educator who has used DrJava for about 6 years to teach thousands of university students. However I was surprised and disappointed to find that in the Sep 2008 stable version, one was able to access an object's private variables from the interactions pane. For example:

> Thing thing = new Thing();
> thing.x = 10; // should fail but doesn't

The statement above succeeds even if x is private. This would (logically) fail in prior versions, such as the 2007 stable version. The fact that the statement above succeeds is a big problem for us because it doesn't demonstrate how the private keyword protects a variable. It puts a serious kink the educational value of the interactions pane. Now we have to say "well, we shouldn't be able to change x but the DrJava interactions pane has a bug." Perhaps this has been fixed in the new beta version? I haven't had time to check. I very much hope this problem can be fixed and incorporated in a new version before the fall semester starts!

Discussion

  • Mathias Ricken

    Mathias Ricken - 2009-10-16
    • status: open --> closed-duplicate
     

Log in to post a comment.