Details
-
Type:
Sub-task
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.0-RC-1
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
If I declare a private field like this...
Person.groovy
class Person {
private firstName
}
I can still access this field from another class like this...
Foo.groovy
class Foo {
def doIt() {
def p = new Person(firstName:'Jeff')
println p.firstName
}
static void main(args) {
new Foo().doIt()
}
}
I don't think that I should be able to access p.firstName inside of the Foo class.
Issue Links
- is related to
-
GROOVY-1875
private fields and private methods are not private
-
- relates to
-
GROOVY-1063
No access protection for private static fields
-