|
Groovy example source code file (WriteOnlyPropertyBug.groovy)
The Groovy WriteOnlyPropertyBug.groovy source code
package groovy.bugs
/**
* @version $Revision: 10122 $
*/
class WriteOnlyPropertyBug extends GroovyTestCase {
void testSettingWriteOnlyProperty() {
def c = new WriteOnlyBean()
c.writeOnlyProperty = 'x' + 'y'
assert c.thingValue() == 'xy'
}
}
class WriteOnlyBean {
private thing = null
public setWriteOnlyProperty(String s) {
thing = s
}
public thingValue() {
thing
}
}
Other Groovy examples (source code examples)Here is a short list of links related to this Groovy WriteOnlyPropertyBug.groovy source code file: |
Other websites by Alvin Alexander:
Life/living in Alaska (OneMansAlaska.com)
How I Sold My Business (HowISoldMyBusiness.com)
Copyright 1998-2011 Alvin Alexander, devdaily.com
All Rights Reserved.