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
| This issue relates to: | ||||
| GROOVY-1063 | No access protection for private static fields |
|
|
|
| This issue is related to: | ||||
| GROOVY-1875 | private fields and private methods are not private |
|
|
|
"Groovy recipies" has dedicated a whole page (70) to "Groovy ignores the private modifier", and portray this as a functionality of Groovy.
Can you comment on whether Groovy wants to remove this feature?