Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.1-beta-2
-
None
-
None
-
Windows XP, Java 1.5, also Ubuntu 7.04 "Feisty Fawn" (JDK 1.6.0) + Groovy Subversion r6911
Description
Groovysh lets you set & read private member fields, as long as they're static:
groovy> class C
{ private static x }groovy> C.x = new Integer(10)
groovy> println C.x
groovy> go
10
Note that it doesn't let you access regular private fields:
groovy> class B
{ private x }groovy> b = new B()
groovy> b.x = new Integer(10)
groovy> go
Caught: groovy.lang.IllegalPropertyAccessException: Can not access the
private field x in class B
Attachments
Issue Links
- is related to
-
GROOVY-1591 Private Fields Are Accessible From Other Classes
- Open
-
GROOVY-1875 private fields and private methods are not private
- Open