Visiblity

Other topics

Private fields and methods are not private in groovy

class MyClass { 
    private String privateField 
} 

def prvtClss = new MyClass(privateField: 'qwerty') 
println prvtClss.privateField

will print us 'qwerty'

This issue is known since version 1.1 and there is a bug report on that: http://jira.codehaus.org/browse/GROOVY-1875. It is not resolved even with groovy 2 release.

Contributors

Topic Id: 6522

Example Ids: 22359

This site is not affiliated with any of the contributors.